Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

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

share|improve this answer

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.

share|improve this answer

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

share|improve this answer
    
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 '13 at 11:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.