Bonjour à tous,
J’essaie en vain d’activer un fichier .htaccess pour un de mes sites héberge sur Apache2.
J’ai placé le .htaccess dans le dossier racine du site “/var/www/site/.htaccess”
J’ai configurer la VHost avec la fonctionnalité “AllowOverride All” pour le répertoire “/var/www/site”.
Cependant ce fichier ne s’active pas.
J’ai effectuer quelques test, il semblerait que la configuration par défaut empêche le bon fonctionnement du .htaccess. Ma VHost “Default” est configuré avec “AllowOverride None” pour les repertoires “/” et “/var/www/”.
Lorsque la fonction “AllowOverride” est à “All” pour le repertoire “/var/www/” alors le htaccess de mon site fonctionne.
N’est-il pas possible de configurer Apache de sorte que seul un seul site puisse avoir la fonction AllowOverride All ?
Je n’ai peut-être pas été très clair voici un résumé :
Ca marche :
Fichier /etc/apache2/sites-available/default
[code]<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
====> AllowOverride All
Order allow,deny
allow from all
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 ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
[/code]
Fichier /etc/apache2/sites-available/site :
[code]<VirtualHost *:80>
DocumentRoot /var/www/site
<Directory "/var/www/site/">
Options Indexes FollowSymLinks MultiViews
====> AllowOverride All
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
[/code]
Ca marche pô :
Fichier /etc/apache2/sites-available/default
[code]<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
====> AllowOverride None
Order allow,deny
allow from all
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 ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
[/code]
Fichier /etc/apache2/sites-available/site :
[code]<VirtualHost *:80>
DocumentRoot /var/www/site
<Directory "/var/www/site/">
Options Indexes FollowSymLinks MultiViews
====> AllowOverride All
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
[/code]