[APACHE2].htaccess et erreur 500

Bonjour,

Sur un LAMP dédié tourne apache2 avec plusieurs vhost. Je souhaite protéger un répertoire (nommé pass) par mot de passe dans le répertoire voulu je crée un fichier .htaccess
[codebox]
AuthName "Identifiez-vous"
AuthUserFile /IMG/acces/.htpasswd
AuthGroupFile /dev/null
AuthType Basic

require valid-user [/codebox]

Le dossier /IMG/acces contient également un fichier .htaccess :
[codebox]deny from all[/codebox]

Et un fichier .htpasswd créé avec la commande :
[codebox]htpasswd -c .htpasswd essai
[/codebox]

J’édite ensuite le fichier /etc/apache2/sites-available et modifie les lignes telles que :
[codebox]
<Directory /var/www/suger>
Options Indexes FollowSymLinks MultiViews
AllowOverride none
Order allow,deny
allow from all
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml

[/codebox]

Je ne touche ni au fichier /etc/apache2/apache2.conf ni aux autres directives du vhost (/ /cgi-bin
Je relance apache2 (/etc/init.d/apache2 restart) et là c’est le drame :

[codebox]Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, xxx@xxx.xxx and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.2.3 (Debian) PHP/5.2.0-8+etch11 Server at www.xxx.xx Port 80
[/codebox]

Remède tentés :
chmod 777 sur les répertoires acces et pass.
chmod -R www-data:www-data acces/ pass/

Dans les logs d’apache2 j’ai ça :

[codebox][Fri May 30 17:33:03 2008] [alert] [client 217.132.38.55] /var/www/suger/.htaccess: RewriteEngine not allowed here
[/codebox]

J’ai donc tenté d’activer le mod_rewrite :
[codebox]ns23303:
/etc/apache2/mods-enabled# ln -s /etc/apache2/mods-available/rewrite.load rewrite.load
/etc/apache2/mods-enabled# ll
/etc/apache2/mods-enabled# 2007-02-09 18:01 actions.load -> /etc/apache2/mods-available/actions.load
957243 lrwxrwxrwx 1 root root 28 2007-04-16 22:07 alias.load -> …/mods-available/alias.load
957252 lrwxrwxrwx 1 root root 33 2007-04-16 22:07 auth_basic.load -> …/mods-available/auth_basic.load
957256 lrwxrwxrwx 1 root root 33 2007-04-16 22:07 authn_file.load -> …/mods-available/authn_file.load
957253 lrwxrwxrwx 1 root root 36 2007-04-16 22:07 authz_default.load -> …/mods-available/authz_default.load
957255 lrwxrwxrwx 1 root root 38 2007-04-16 22:07 authz_groupfile.load -> …/mods-available/authz_groupfile.load
957257 lrwxrwxrwx 1 root root 33 2007-04-16 22:07 authz_host.load -> …/mods-available/authz_host.load
957254 lrwxrwxrwx 1 root root 33 2007-04-16 22:07 authz_user.load -> …/mods-available/authz_user.load
957244 lrwxrwxrwx 1 root root 32 2007-04-16 22:07 autoindex.load -> …/mods-available/autoindex.load
957229 lrwxrwxrwx 1 root root 36 2006-12-27 11:49 cgi.load -> /etc/apache2/mods-available/cgi.load
957245 lrwxrwxrwx 1 root root 26 2007-04-16 22:07 dir.conf -> …/mods-available/dir.conf
957246 lrwxrwxrwx 1 root root 26 2007-04-16 22:07 dir.load -> …/mods-available/dir.load
957247 lrwxrwxrwx 1 root root 26 2007-04-16 22:07 env.load -> …/mods-available/env.load
957248 lrwxrwxrwx 1 root root 27 2007-04-16 22:07 mime.load -> …/mods-available/mime.load
957249 lrwxrwxrwx 1 root root 34 2007-04-16 22:07 negotiation.load -> …/mods-available/negotiation.load
957230 lrwxrwxrwx 1 root root 27 2008-05-18 10:38 php5.conf -> …/mods-available/php5.conf
957236 lrwxrwxrwx 1 root root 27 2008-05-18 10:38 php5.load -> …/mods-available/php5.load
957260 lrwxrwxrwx 1 root root 40 2008-05-30 17:30 rewrite.load -> /etc/apache2/mods-available/rewrite.load
957250 lrwxrwxrwx 1 root root 31 2007-04-16 22:07 setenvif.load -> …/mods-available/setenvif.load
957251 lrwxrwxrwx 1 root root 29 2007-04-16 22:07 status.load -> …/mods-available/status.load
957227 lrwxrwxrwx 1 root root 40 2006-12-27 11:29 userdir.conf -> /etc/apache2/mods-available/userdir.conf
957228 lrwxrwxrwx 1 root root 40 2006-12-27 11:29 userdir.load -> /etc/apache2/mods-available/userdir.load
ns23303:/etc/apache2/mods-enabled# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)… waiting .
ns23303:/etc/apache2/mods-enabled#[/codebox]

J’ai essayé aussi :
[codebox]ns23303:/etc/apache2/sites-enabled# a2enmod rewrite
This module is already enabled!
[/codebox]
Il semble donc que le module soit bien activé.

Par contre le log disant “RewriteEngine not allowed here” y a-t-il une manipulation spéciale à faire pour l’activer sur ce vhost ?

Merci parceque là je suis à cours d’idées.

RewriteEngine On

Bonjour,
il me semble que tu doives activer AllowOverride pour que le .htaccess soit pris en compte.

Le AllowOverride est activé en all (contrairement à mon bout de code (désolé)).
Avec le RewriteEngine On dans le .htaccess ça le fait jusqu’au moment d’entrer le mot de passe, l’identification est OK mais juste après re-erreur 500.
Je continue à chercher.