I’m part the team that administrates a Apache 2.4.9 web server running on Debian 7.8. We’re having an issue with one of our users website:
www.example.com/~user
When we try to access this URL, a page loads with the following content:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.Please contact the server administrator, webmaster@localhost 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.22 (Debian) Server at www.cpdee.ufmg.br Port 80
And in /var/log/apache2/error.log
I find this:
[Fri Apr 03 11:36:36 2015] [alert] [client 179.214.195.80] /home/web/user/.htaccess: Options not allowed here
If I then look the content of the /home/web/user/.htacces file, there’s just this configuration line:
Options -Indexes
After a quick research, it seemed to me that this issue has to do with Apache’s virtual host configuration. Specifically, this tutorial says that this problem can be fixed by adding “Options” in the “AllowOverride” list of the /etc/apache2/sites-enabled/000-default, like this:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo Options
Order allow,deny
allow from all
</Directory>
This file is just a link to the /etc/apache2/sites-available/default
file and, in my case, this file looks a little bit messy:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride Options
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride Options
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 ${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
</VirtualHost>
As suggested, I added Options
to the AllowOverried
list (for each <Directory> ... </Directory>
"tag" I found there). Then I enabled the changes and reloaded Apache with this set of commands:
a2ensite default
/etc/init.d/apache2 reload
Even with these changes, I still kept having the same issue and I don’t really know what’s wrong. Could someone please help me with that?
Best Answer
Check if more specific configuration in
userdir.conf
overrides settings you specify in<Directory />
. In/etc/apache2/mods-enabled/userdir.conf
is specifiedDirectory
directive for userdir, default is:So you should add
Options
to theAllowOverride
directive here.(Probably your directory is
<Directory /home/web/*/>
instead.)