"Forbidden - You don't have permission to access / on this server" Error

Posted January 7, 2017 284.5k views
ApacheUbuntu 16.04

I followed the virtual hosts tutorial and set up apache for my domain name The website was loading perfectly but now I am suddenly getting this error.

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

I don’t understand why!

Here is the

<VirtualHost *:80>
DocumentRoot /var/www/html/sites/
ErrorLog /error.log
CustomLog /access.log combined

The permission for public_html is set to 750 and the owner:group is jogi:www-data

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
5 answers


You need to use chmod 755 instead of 750 on directories. Using 750 equates to users having read, write, and execute, groups having read and execute, and finally, world (i.e your visitors) having absolutely zero access, thus they will be forbidden from accessing and/or viewing the contents.

  • Can’t believe I didn’t think of that :P. Thanks a lot man. It worked! Do you think it’s safe to let the rest of the world ‘execute’ on my server?

    • its a good practice to have folders with 755 and files with 644 permission

      and sensitive files should be 700

      • Done man. Thanks a lot.

        • @joginayak
          i think i made a mistake there, sensitive files which are related with security should be with chmod 600

          apology for my mistake

          • @joginayak

            When it comes to sensitive files, they shouldn’t be in the web root to begin with :-).

            Having a CHMOD of 755 on directories and 644 on files is preferred. If files are too sensitive too risk public access (i.e. session data files, for example), they shouldn’t be in an area that can be accessed by the public at all.

            For example, when it comes to application setup, I’ll often use a structure such as:


            All public files go in public, private (class files, for example) in private and everything else in the storage directory (when appropriate).

@srjcooldude @kasidkhan

if you were using a wordpress site, it could have quite possibly been caused by a corrupt .htaccess file. the simple fix is to resave permalinks twice in order to regenerate .htaccess.

you might be seeing the below error messages:

  1. “The REST API encountered an unexpected result” in site health
  2. “Publishing failed and invalid JSON response” upon updating or publishing posts or pages
  3. “Forbidden You don’t have permission to access this resource. Apache/2.4.41 (Ubuntu) Server at Port 80” when viewing posts or pages


i deploy Centos;
try command in terminal chown -R apache:apache /var/www/html/*
it works;
or if you using WINscp or FTP try CHMOD directory to 0775 and check Recrusively, files will automatic 0644, but i know it takes long time and wasted your time.

Hi All,

I am facing the same issue.

DocumentRoot /var/www/html/

The code was deployed by third party and the site was working for sometime but after some days I see error as below when I try to access

You don’t have permission to access / on this server.
Apache Server at Port 80”

Steps followed to fix the issue.
cd usr/var/www/html/ ( And saw just one file index.html)
tried: chmod 755* ( nothing happened)
tried chmod 755 index.html (nothing happened)

Any help or insight on below two points will be appreciated.

  1. Why this happened after few days from initial deployment?
  2. How can I fix this?

** I am newbie to this. Any insight will be helpful.


One more thing that I could suggest in addition to what already has been mentioned is that you could also check the user that your Apache service is running as and change the owner of your files:

  • Check the user that Apache is running with:
ps aux | grep -i apache

In most cases, it would be www-data unless it was changed.

  • After that once you have the user run:
chown -R www-data: /var/www/html/

Make sure to change the www-data user if this is not the one that your Apache service is running as.