2

I have two files stored in /var/www/

pi@babaloo /var/www/test $ ls -l total 8 -rwxrwxrwx 1 pi pi 123 Nov 8 00:23 refresh.php -rwxrwxrwx 1 pi pi 989 Nov 5 17:41 share.php 

when i try to open refresh.php from my browser, I get a 500 response from refresh.php on share.php everything is ok.

dont know why, whats the reason and how to solve it ???

Whats the meaning of the "8" and "5" ?? may that cause the error?

EDIT: I just noticed, that all new files I create have the same problem. Old files are ok. I dont know what happend - any ideas what could be the reason and what can I do to fix this ?

1
  • 2
    8 and 5 are Nov8 and Nov5 =) Commented Nov 8, 2013 at 0:16

2 Answers 2

2

After uninstalling lighttpd and installing it again the problem has been solved.

But I still don't know why!?

2
  • Did you log in as another user? maybe lighhtpd changed users for some reason. The permission look ok there but to whom do they belong? That is usually the problem relating to who created the files. ls -l filename Commented Nov 8, 2013 at 11:14
  • @ppumkin 3rd and 4th column show user and group. Both are pi for both files, so that isn't it. Commented Nov 8, 2013 at 20:38
1

You also need to check the permissions of the directory /var/www/test to see if that is accessible for everyone:

ls -l /var/www 

If test is owned by pi or root, the server won't be able to access the files inside it.

By default lighthttpd runs as user www-data, and can't access pi's files. You could use this command to change everything in /var/www to be owned by www-data:

sudo chown www-data:www-data -R /var/www 

Then lighthttpd should be able to serve those files.

1
  • 1
    This isn't advised. This would provide a way of attacking a server, as you might be able to upload a file to the server and run it. Just make sure the directory is both readable (r) and executable (x) by all users. sudo chmod o+xr /var/www should do that. Commented Nov 8, 2013 at 20:42

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.