#1 Le 29/06/2010, à 22:10
- Nikonoel
[Apache]Deux sites sur deux ports différents // Erreur 403
Salut à tous,
J'ai un serveur Apache que je fais tourner sur mon serveur à la maison. J'ai un petit site sur mon port 80 qui est accessible à tout le monde et j'en ai un autre sur le port 8000 qui n'est accessible qu'aux gens qui sont sur le réseau local. Le site ouvert à tout le monde est dans /var/www/, tandis que le site réservé aux gens sur le réseau local est dans /home/nikonoel/Vidéos.
Jusqu'ici, j'utilisais la commande SimpleHTTPServer de python pour mon serveur sur le port 8000, mais j'ai remarqué que cela fonctionne moins rapidement qu'Apache. Je me suis donc mis en tête de configurer un deuxième VirtualHost pour que ce soit apache qui serve les fichiers qui sont dans /home/nikonoel/Vidéos (pour l'instant sur le port 8001 pour faire mes tests).
Voici mon fichier /etc/apache2/sites-enabled/000-default :
<VirtualHost *:80>
ServerAdmin nikonoel@localhostDocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warnCustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
Alias /webmail/ "var/lib/roundcube/"</VirtualHost>
<VirtualHost *:8001>
ServerAdmin nikonoel@localhostDocumentRoot /home/nikonoel/Vidéos
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
ErrorLog /var/log/apache2/error.log# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warnCustomLog /var/log/apache2/access.log combined
</VirtualHost>
Ainsi que mon fichier /etc/apache2/ports.conf :
NameVirtualHost *:80
Listen 80<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
</IfModule>NameVirtualHost *:8001
Listen 8001
En outre, j'ai un petit script bash dont voici le contenu pour donner les bons droits à Apache:
#!/bin/bash
sudo chown -R www-data:www-data /var/www
sudo chmod -R 770 /var/www
sudo chown -Rf nikonoel:www-data /home/nikonoel/Vidéos
sudo chmod -R 770 /home/nikonoel/Vidéos
Bien entendu j'ai redémarré plusieurs fois /etc/init.d/apache2, mais j'obtiens en tous les cas une jolie erreur 403 sur le port 8001 de ma machine (You don't have permission to access / on this server.).
Est-ce qu'une âme charitable pourrait m'aider à résoudre mon problème ?
Merci !
Mon serveur: http://nikonoel.dyndns.org
Jabber : nikonoel@jabber.fr
Clef pgp : http://nikonoel.dyndns.org/pgp.asc
Hors ligne
#2 Le 30/06/2010, à 08:23
- Nikonoel
Re : [Apache]Deux sites sur deux ports différents // Erreur 403
Salut, merci pour ta réponse
Je viens d'activer le mode userdir de la manière que tu m'as indiquée. Puis j'ai redémarré apache... mais j'ai toujours le même souci
Dernière modification par Nikonoel (Le 30/06/2010, à 08:24)
Mon serveur: http://nikonoel.dyndns.org
Jabber : nikonoel@jabber.fr
Clef pgp : http://nikonoel.dyndns.org/pgp.asc
Hors ligne
#3 Le 30/06/2010, à 12:20
- Nikonoel
Re : [Apache]Deux sites sur deux ports différents // Erreur 403
Salut, j'ai fait comme tu me l'as indiqué, j'ai redémarré apache... et ca ne fonctionne toujours pas
Mon serveur: http://nikonoel.dyndns.org
Jabber : nikonoel@jabber.fr
Clef pgp : http://nikonoel.dyndns.org/pgp.asc
Hors ligne
#4 Le 02/07/2010, à 09:55
- Nikonoel
Re : [Apache]Deux sites sur deux ports différents // Erreur 403
Bonjour,
Oui, je viens de le refaire... Ça ne fonctionne toujours pas
Mon serveur: http://nikonoel.dyndns.org
Jabber : nikonoel@jabber.fr
Clef pgp : http://nikonoel.dyndns.org/pgp.asc
Hors ligne
#5 Le 02/07/2010, à 11:49
- Nikonoel
Re : [Apache]Deux sites sur deux ports différents // Erreur 403
J'obtiens un message d'erreur 403 "you don't have the permission to access / on this server" en allant sur l'url http://localhost:8001. Je précise que j'ai modifié le virtualhost pour accéder à /home/nikonoel/public_html
Concernant le log d'erreur, j'obtiens la ligne suivante en tentant d'accéder à la bage en question :
[Fri Jul 02 11:43:40 2010] [error] [client 127.0.0.1] (13)Permission denied: access to / denied
Mon serveur: http://nikonoel.dyndns.org
Jabber : nikonoel@jabber.fr
Clef pgp : http://nikonoel.dyndns.org/pgp.asc
Hors ligne
#6 Le 02/07/2010, à 12:10
- Nikonoel
Re : [Apache]Deux sites sur deux ports différents // Erreur 403
http://localhost:8001/ me donne une erreur 403
http://localhost/ me donne le site que j'ai déjà d'installé sur mon port 80
http://localhost/~nikonoel:8001/ me donne une erreur 404
nikonoel@bronstein:~$ ls -lRa /home/$USER/public_html
/home/nikonoel/public_html:
total 12
drwxr-xr-x 2 nikonoel www-data 4096 2010-07-02 11:56 .
drwxrwx--- 51 nikonoel nikonoel 4096 2010-07-02 11:58 ..
-rw-r--r-- 1 nikonoel nikonoel 21 2010-07-02 11:55 index.php
L'index.php contient le code suivant :
<?php phpinfo();</p>
Les virtual hosts
nikonoel@bronstein:~$ cat /etc/apache2/sites-enabled/000-default
<VirtualHost *:80>
ServerAdmin nikonoel@localhostDocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warnCustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
Alias /webmail/ "var/lib/roundcube/"</VirtualHost>
<VirtualHost *:8001>
ServerAdmin nikonoel@localhostDocumentRoot /home/nikonoel/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
ErrorLog /var/log/apache2/error.log# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warnCustomLog /var/log/apache2/access.log combined
</VirtualHost>
et enfin, mon fichier ports.conf n'a pas été modifié
Mon serveur: http://nikonoel.dyndns.org
Jabber : nikonoel@jabber.fr
Clef pgp : http://nikonoel.dyndns.org/pgp.asc
Hors ligne
#7 Le 02/07/2010, à 15:49
- Nikonoel
Re : [Apache]Deux sites sur deux ports différents // Erreur 403
J'ai fait cela et ça me donne toujours un 403... Les fichiers error.log et access.log sont tout à fait normaux... juste des 404 et 403
Mon serveur: http://nikonoel.dyndns.org
Jabber : nikonoel@jabber.fr
Clef pgp : http://nikonoel.dyndns.org/pgp.asc
Hors ligne