I was running localhost (Apache 2.4.6) but only the index.php
was openable in the web browser. The subdirectories were returning 403 Forbidden error.
Now, I added the permissions according to this answer. For reference, these were the permissions:
sudo adduser <username> www-data
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rw /var/www
Accordingly, the folder in which I placed all the content of the website became owned by www-data
group. And although I've added myself to the group, I cannot open the folder!
(But the subdirectories have become accessible from the web browser.)
First are you sure your user is added to www-data group? The proper way to add your user to this group is:
Then do:
After that, you should change permissions to 755, it is not recommend changing permissions to 777 for security reasons