The FreeBSD Diary |
(TM) | Providing practical examples since 1998If you buy from Amazon USA, please support us by using this link. |
403 Forbidden - You don't have permission to access / on this server.
23 December 1999
|
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
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: 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.<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> <Directory /opt/mystuff/webui> Options ExecCGI AllowOverride None DirectoryIndex login.cgi </Directory> |