Forbidden Access

August 16, 2018 3.4k views
Apache Ubuntu 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!

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,
Jarland

Yes! This worked. Thank you.

Have another answer? Share your knowledge.