Forbidden Access

Posted August 16, 2018 5.8k views
ApacheUbuntu 16.04

Can’t bring up website. I receive the following error Forbidden “You don’t have permission to access / on this server.
Server unable to read htaccess file, denying access to be safe”

I have a LAMP droplet install with Ubuntu 16.04. I was having trouble transferring files using SFTP thru a client and SSH in and changed the sudo user permission to 766. Now after transferring files I get the forbidden access error.

I tried to find the apache error log file under /var/log but couldn’t see one
I ran the following command in the var/www/html# ls -la and the output shows

drwxrw-rw- 3 [sudouser] [sudouser] 4096 Aug 15 23:47 .
drwxrwxr-x 3 [sudouser] [sudouser] 4096 Jan 15 2018 ..
-rwxrw-rw- 1 [sudouser] [sudouser] 1324 Jan 15 2018 index.html
-rwxrw-rw- 1 [sudouser] [sudouser] 20 Jan 15 2018 info.php
drwxrwxr-x 8 [sudouser] [sudouser] 4096 Aug 15 23:48 wais

Do I need to change the permissions again? Not sure what command to execute. Help!

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
3 answers

Hello friend!

Try this:
chown -R www-data. /var/www

Apache will run as the www-data user by default, which will not have permission to access the files from the user that you have created.

Kind Regards,

Yes! This worked. Thank you.