403 forbidden you don’t have permission to access / on this server

Solution for the error 403 Forbidden you don’t have permission to access / on this server. This specific HTTP 403 error will only appear on an Apache server.

First thing to check is the permissions on the specified directory. It needs to be at least 644 or even better 755 which you can set via FTP using your FTP client. Then also check with your hosting provider if Apache mod_security is on and if it could be filtering POST/GET data or the URL itself. If neither of that is the case, continue on…

You can just execute the following command via command line to ensure that the directory is readable by your Apache server.

chmod +x /home/domain/public_html

…where the “/home/domain/public_html” part should be replaced by the specific, absolute path with which you are experiencing the 403 forbidden error mentioned above.

If the permissions on the specified directory is fine and you still experience the problem then it could be because of your Apache DirectoryIndex which is incorrectly configured. The DirectoryIndex of Apache tells the Apache server which file represents the index when a directory is directly access and additionally it can also support multiple indexes in a prioritized list. Here is a very useful article on You don’t have permission to access / on this server.

Open up your terminal and make a connection to your server. I prefer SSH for this.

Locate your httpd.conf file on your server…

locate httpd.conf

It will show you all files with file names containing “httpd.conf” in it. So you can easily find your Apache configuration file. In my case it is /usr/local/apache/conf/httpd.conf. Lets open up the Apache config file…

vi /usr/local/apache/conf/httpd.conf

Find “DirectoryIndex”. It could be empty or it will most likely have the value “index.html”. So if you’re using a PHP application and there is no “index.html” file but rather a “index.php” file that could be the reason why you are getting the 403 forbidden error. Change the DirectoryIndex line to something like this…

DirectoryIndex index.html index.php index.sh default.jsp

You’re all done and you can now restart Apache. Your path to apachectl may differ so just check. You can restart it like this…

/usr/local/apache/bin/apachectl restart

Check now, it should be working just fine! Feel free to comment if you are still stuck. Below are some more links to useful resources on the same topic if you are still stuck…

  • Andy

    Hi Antonie,

    I have directory listing disabled on my CakePhp server by using “Options -Indexes” in the conf file. On trying to open a directory, say, http://mysite.com/img/, I get the following error (403) from Apache

    Forbidden
    You don’t have permission to access /app/webroot/img/ on this server.

    The problem is that this 403 error displayed the virtual path in the output (/app/webroot/img/). Is there any way of disabling this path in the output?

    Thanks!

  • http://catreloaded.net Maher Saif

    Thanks Antonie.

    @Andy, you can put empty index.html file in that location(/app/webroot/img/), and nothing will appear.

  • Jason

    Hi, I just installed CodeIgniter in /var/www/html, ensured sufficient permissions and httpd.conf setup. I still get the 403 error when accessing it via the web. This is odd because I’ve been writing PHP code, storing it in this directory and subdirectories off of it, and accessing it via the web for a while. Seems like there’s a problem when I don’t literally “md” the directory. It shouldn’t make a difference, but I chowned the directory to be the same as the others. Still no dice. Any ideas? Thanks!

    Jason

  • vincent

    i just finished installing and configuring a coldfusion application on my server.right now i cannot access the application from other work stations.

    each time i try to access the application the response will be:’ Forbidden you don’t have permission to access / on this server.

    what can i do to solve this problem?

    i will be most greatfull if youn can help me solve this.

    kind regards

    vincent

  • http://www.znapp.net Tobbs

    Permissions 755! Noticed this is true for the entire path! Thanks!

  • http://vinodarya90@gmail.com vinod

    Hi, I just installed CodeIgniter in /var/www/html, ensured sufficient permissions and httpd.conf setup. I still get the 403 error when accessing it via the web. This is odd because I’ve been writing PHP code, storing it in this directory and subdirectories off of it, and accessing it via the web for a while. Seems like there’s a problem when I don’t literally “md” the directory. It shouldn’t make a difference, but I chowned the directory to be the same as the others. Still no dice. Any ideas? Thanks!

  • JC

    Hi there.. I’m going through the same issue I tried chmoding to 755 all the directories I checked one by one…
    I have:
    /var/www/html/websites/mypage1 and all the subdirectories like image, scripts, etc.. are 755

    Which I just don’t understand is why if the configuration file is set up to show the content in listing mode (before changing permission to 755) allows me to see all the content; why if I turn off indexing I get the 403 forbidden message…

    Pleas give me a hint… first time I tried Apache was in Windows 7 (laptop) and it worked like a charm the test website I created was live for a couple of days so I decided to get my old desktop and turn it into Fedora 14 web server… now the site is forbidden. any other ideas???

  • http://graficosmalukets.com Ipimin

    I’m trying to access this domain: http://colegioetapa.com.br/wrdb/uploads/. but when I come to appear: Forbidden

    You do not have permission to access / wrdb / uploads / on this server.

    Apache/2.2.3 (CentOS) Server at Port 80 colegioetapa.com.br
    would solve?
    sorry a mistake, I’m from Brazil and used the Google translator …
    Thanks in advance!

  • Pankaj

    Amazon EC2 Cloud Installation.
    setup instance, elastic IP configuration, cloud instant accessing from local computer using Putty and FTP connection.

    http://onlinewebapplication.com/2011/09/amazon-ec2-cloud-installation-setup.html

  • HML

    Hi, Thx a lot !

  • Ben

    Just to add some trick as newbie.

    If you still get the 403 Forbidden error, try to remove the .htaccess file (off course you have to back it up first.

    go to the folder where you cannot access

    # cd /destination_folder

    backup .htaccess file then remove it

    # cp .htaccess .htaccess.BAK
    # rm -f .htaccess

    then re-set the permission

    # chmod -R 755 destination_folder

    Hope this help… cheers

  • http://www.bahassi.com musti

    Hi, I ‘ve just come accross this useful post that deals with the 403 error. The solutions provided here seem logical and effective, but I could not really find a solution to my current problem. I have a website built upon WordPress 3.2.1 Everything works fine, I can add new posts and pages, modify them and delete them successfully , but the problem I have is when I try to update my custom menu I always get the following error:

    Forbidden
    You don’t have permission to access /wp-admin/nav-menus.php on this server.

    I tried many solutions but in vain. I tried to delete the .htaccess file, remove the plugins and even do a fresh wordpress install and still I could not find out what is the problem.

    I would be so thankful to anyone who could help me out with this issue.

  • http://forbidden bismillah

    hello i want to download yahoo there is coming error forbidden how i can solf this problems

  • Ganga

    Hi,

    The default DocumentRoot path only works fine. If i change the DocumentRoot directory from “/var/www/html” to my own path “/home/test/workspace/”. Then its not working. SELinux is disabled. My folder has the enough permission. I tried in many ways. But no use. Please some one help me in this.

    I am using the default apache that came with the RHEL 5.3 OS.

    Thanks in advance,
    Ganga.

  • http://bdtrickz.asia/ PhpDev

    What about a windows machine. I have followed some method and localhost is running fine but localhost/phpmyadmin/ is not working

  • Pingback: 【已解决】wordpress网站搬家期间,访问临时主页地址出现错误:403 Permission Denied,You do not have permission for this request | 在

  • Diana Powell

    This has become a regular problem on Yahoo…

    I don’t know how to fix it.

  • http://tribulant.com/ Antonie Potgieter

    If the instructions in the post above don’t work, best would be to ask Yahoo! specifically. Give them the URL where the problem occurs as well. It may be due to security.