0

So, I set up a LAMP server on my raspberry. It was working perfectly and then the next day when I came to edit the index.html file it would not save properly. I tried visiting the webpage but then it just kept giving me this 403 error that says:

Forbidden

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

I have no idea what to do and this is for a competition. I have also confirmed that I have chmodded the file 644 but I do not know if I have to chmod the folders. But it was working properly the first day then all of a sudden it stopped working properly. I don't even know why it's saying / and not the file location /var/www/html/index.html.

Also, it was working when I installed Apache and tested it then when I edited the index.html, so then I went ahead and install MySQL and PHP 5 and something else that was in the guide that was like an Apache library, then went right to sleep. I think the problem occurred when I installed MySQL and PHP 5.

The commands that the guide had were these:

Apache2 part of the guide

sudo apt-get install apache2 php5 libapache2-mod-php5

MySQL

sudo apt-get install mysql-server mysql-client php5-mysql

and the rest are at this link http://www.instructables.com/id/Turning-your-Raspberry-Pi-into-a-personal-web-serv

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
Nico
  • 13
  • 1
  • 5

1 Answers1

0

Try to reset the file permissions (I assume the DocumentRoot is set to /var/www):

sudo chown -R www-data:www-data /var/www
chmod -R go-rwx /var/www
chmod go+x /var/www
chgrp -R www-data /var/www
chmod -R g+rwx /var/www

sudo service apache2 restart
Mateusz Kleinert
  • 1,316
  • 11
  • 20