Dec 231999
 

403 Forbidden – You don’t have permission to access / on this server.

This article shows you how to fix the above error.

The Error

If you browse to a site and get the following error:
Forbidden

You don't have permission to access / on this server.

Apache/1.3.9 Server at freebsddiary.unixathome.org Port 80

This error indicates that a default document could not be found at the specified URL and that directory listings are not permitted.

The solution

The solution is quite simple.  Edit /usr/local/etc/apache/httpd.conf and look for the following line:
DirectoryIndex index.html  

This line indicates that if a URL does not contain an explicit filename, then the files specified on this line will be used by default.  So if you are using index.htm, or default.htm as your default page, add them to this line.  For example:

DirectoryIndex index.html index.htm default.htm

Then you should restart apache:

/usr/local/sbin/apachectl restart

And you should also check the logs for any errors:

# tail /var/log/httpd-error.log
[Thu Dec 23 21:56:12 1999] [notice] SIGHUP received.  Attempting to 
                                                              restart
[Thu Dec 23 21:56:16 1999] [notice] Apache/1.3.9 (Unix) 
         FrontPage/4.0.4.3 
         mod_ssl/2.4.8 OpenSSL/0.9.4 configured -- resuming normal 
                                                     operations

Another situation (added on 3 May 2002)

I found another situation which can cause this problem. I had a virtual host (yes, on a Solaris box) which contained this:
<VirtualHost 10.0.1.249>
        DocumentRoot    /opt/mystuff/webui
        ErrorLog        /var/adm/webui-error.log
        CustomLog       /var/adm/webui-access.log common
        <Location />
                Options ExecCGI
                AllowOverride None
                DirectoryIndex login.cgi
        </Location>
</VirtualHost>
I also had http://10.0.1.249/~dlangille/ as my website. But index.html would not load. I’d get the Forbidden message indicated above. But I could browse to http://10.0.1.249/~dlangille/index.html and the file would load. By changing the Location directive as shown below, my index.html would display.
        <Directory /opt/mystuff/webui>
                Options ExecCGI
                AllowOverride None
                DirectoryIndex login.cgi
        </Directory>

  5 Responses to “403 Forbidden – You don’t have permission to access / on this server.”

  1. I have encountered this problem while using a RedHat 6.2. After having installed Apache with php support and after having tried to use it, I have encountered the above error. I would like to point to the fact that it is an Apache 1.3.12. This Apache has only one configuration file, namely httpd.conf. The access.conf file is empty. In httph.conf, line 857, appears default on "Deny from all". It must be changed with "Allow from all". I hope it helps.

    Antonio SLav

    • >directory listings are not permitted<

      One frequent question I see (which would be good to address as a follow-up to the article) is how to turn on directory listings for a particular subdirectory.

      For example, if I have:

      http://www.foo.com/
      http://www.bar.com/

      And want to enable directory lists for just:
      http://www.foo.com/abc/

      Just something that I see people ask!

    • I had the same problem – "You don’t have permission to access / on this server" on max os x server (10.2.7)

      It turned out to be a permissions thing – I ran a fix using diskedit and is now all ok.

    • I had the same problem:
      Forbidden
      You don’t have permission to access /index.html on this server.
      ——————————————————————————–

      Apache/1.3.27 Server at creattech.com.cn Port 80

      but I find the reason is that the index.html file’s properties is 0,
      then I modify it with 744(read,write ,execute ) .the problem is solved

      thank you.antonio slav wrote:

    • Thanks for this post. I did a search for the error, found your post and added the following line and am up and running again!

      DirectoryIndex index.cfm index.html index.htm default.htm

      FC