0

So everything was working fine after I changed some permissions of a folder inside /var/www/html. It was just a random project. IIRC I just did chmod u+x, that's it.

This created the whole mess, I suppose, i.e. when I open the PHP files now, they are returning blank pages.

Troubleshooting I have done so far:

1) Uninstalled and reinstalled complete LAMP stack.

2) phpinfo() is working fine.

3) Tried most of the Google solutions regarding permissions, which I'm sure have messed up my /var or at least /var/www permissions. Tried every set of secure or insecure permission set I found, but no gain.

4) /var/log/apache2/error.log - http://pastebin.com/hfztqt0C

5) Tried changing location of Apache directory from /var/www/html to /home/username/Documents/abc, but getting 403 Forbidden error. Now this is another problem, as I did apply some quick suggested permissions as per Google's results:

chgrp -R www-data /home/username/Documents
chmod -R 2750 /home/username/Documents

But it didn't work.

Please help me out, reinstalling Ubuntu is of course the last option, but I'd love to solve it by tinkering as it'd surely make me learn new things. If the /var/www doesn't get solved, then I want to make the Apache dir change work.

Thanks

Grammargeek
  • 2,762

1 Answers1

0

According to your logfile there are several things wrong. It is important to tackle them one by one. There are a lot of messages concerning AH01630, meaning the client has no access. This has usually to do with a difference between Apache 2.2 and 2.4.
The directive of importance is Require:

In 2.2 configuration you should have:
Order allow,deny Allow from all
In 2.4 configuration you should have:
Require all granted.
Please make the correct change and check if these errormessages disappear from the log.

Take a look at for example line 130 of the logfile on your pastebin. It mentions it can't find index.php. Make sure the reference to that file is correct and also for files that are mentioned in similar entries too. Then please make a new dump of your logfile and we'll continue.

wie5Ooma
  • 1,789
  • so I made changes which I suppose were to done in 000-default.conf New error log -[http://pastebin.com/LfRL0rq5] – Sujay Kirti Jul 24 '15 at 08:01
  • I added '<Directory /var/www/> Require all granted '

    as my apache ver is 2.4 .

    New error log -[http://pastebin.com/LfRL0rq5]

    Couple of things from error log are confusing me:

    1. How come root can be denied access for anything ?

    2. One of the most repetitive error in error log is pointing to line 5 in index.php, which is just '$object = new class;' .

    I am a comeplte Linux newbie, relying on mighty Google and other experts, so please bear with me if I'm doing something wrong.

    Thanks again !!

    – Sujay Kirti Jul 24 '15 at 08:07
  • waiting for the update as I really need to solve this problem. – Sujay Kirti Jul 24 '15 at 19:05
  • I've edited the answer with new things to debug. BTW: both your new pastebins are somehow deleted so I can't view them right now. – wie5Ooma Jul 24 '15 at 22:20
  • The log is here. http://pastebin.com/v96KmKz9 . But I have absolutely no idea why it's saying that it cannot find index.php. The file is present. Everything started working after I did what I mentioned in the OP. – Sujay Kirti Jul 25 '15 at 10:13
  • Logfile is still flooded with AH01630 errors, so vonfiguration is still wrong. Please correct this first. – wie5Ooma Jul 25 '15 at 21:34
  • On second thoughts: this looks like a logfile of multiple runs. Please clear the logfile and make a dump of just one run otherwise I can't see the effects of your changes. – wie5Ooma Jul 25 '15 at 21:42