When setting up an Apache virtual host, I'll occasionally get the following error when attempting to access the site.
Forbidden
You don't have permission to access / on this server.
Is there any method to (or tool that will) tell me why Apache is denying access? (local rule in httpd.conf
, file permissions, etc.
I'm not looking for help with a specific configuration, instead I'm looking for a way to have the computer tell me what's wrong with my system and/or configuration.
Apache should be generating a log file that will help you with troubleshooting. On Debian systems, it's located in the '/var/log/apache2' directory. Your configuration file will have the location of the log file in it. In Debian, this is located in '/etc/apache2/sites-available/default'.
Depending on your environment, your exact paths and naming may vary, but you should be getting logs that tell you what you're looking for.
In my environment, for example, I have /var/log/httpd/ssl_error_log. This log contains entries like:
I went ahead and tried to access a higher level directory from the browser, which results in the typical "Forbidden" error. This is what showed up in the log:
The output of your logs will help you identify your problem. Let's say your content is in /var/www/mystuff/blah/, but your error log says that your attempt to access a URL you expected to work was actually looking for /var/www/mycrap/meh, you might be able to deduce you've got an alias error in a conf file.
Trying to access a server that is configured to deliver its contents via https:// instead of plain http:// can also cause this.
So a page request using just http:// will be rejected as Forbidden.
Usually the webmaster would put a redirect in the configuration to divert all http calls to https (relieving the visitor of thinking about this).
set the options to : Options Indexes FollowSymLinks Includes ExecCGI in httpd.conf .