0

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.

4 Answers 4

1

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'.

1

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:

[Tue Oct 22 18:04:45 2013] [error] [client x.x.x.x] user bob: authentication failure for "/twiki/bin/view": Password Mismatch

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:

[Wed Oct 23 20:47:11 2013] [error] [client x.x.x.x] attempt to invoke directory as script: /var/www/twiki/bin/

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.

0

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).

-1

set the options to : Options Indexes FollowSymLinks Includes ExecCGI in httpd.conf .

1
  • That is absolutely no help at all. You don't even know if that is set already or not. Allowing random options without knowing the actual cause of the problem is unprofessional.
    – Jenny D
    Oct 24, 2013 at 11:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .