403 forbidden in Apache2 when edited index.php

November 21, 2014 2k views

Hello, Im newbie in this droplets thing and everything, I followed up the Initial server setup tutorial from here and the LAMPP stack installation from here, also the Firewall tutorial from here, everything worked fine, I was able to see the default index.php from apache so I decided use SFTP using FIleZilla to acces my files in /var/www/html/ but everytime I uploaded a file or something the server deleted them, so I unlocked the root acces and I logged up as root in FileZilla, I was able to modify and add some files to that directory but, now I get the following error:


You don't have permission to access / on this server.
Apache/2.4.7 (Ubuntu) Server at Port 80

How can I restore the settings?

1 comment
  • Make sure the file permissions are as follows:

    -rw-r--r--  1 root  root      10 Dec 17  2013 index.php

    It's possible you do not have the file "readable" by users that aren't root (apache2 runs as the "apache" user). Check this out for more info.

1 Answer

and how can I do that? I also tried with sudo chmod but not working

  • Try to change the permissions by accessing the server via ssh

  • managed to solve it, the error wasn´t in the permission, I didn´t configured properly the virtual hosts in apache, now it works fine, thanks for all the help

Have another answer? Share your knowledge.