I have an index.php page but I continuing to get 404 not found if I digit Www.mywebsite.com/

This is the log:

... www.MYWEBSITE.com - [26/Apr/2011:09:56:33 +0200] "GET / HTTP/1.1" 404 0 "-" "Opera/9.80 (X11; Linux x86_64; U; it) Presto/2.8.131 Version/11.10

The page exists, but I get 404 not found.

What should I check?


I'd start checking the root directory for lighthttpd the default page sent (maybe is index.html and not index.php) and file permissions and the user running lighthttpd.

Then I'd check the php configuration (php.ini) and if php is actually processing the php pages.

  • I've checked... the problem are the permissions. – Damiano Apr 26 '11 at 8:30
  • for each vhosts i create user1:group1 user2:group2 etc etc. but lighttpd run with lighttpd:lighttpd... is not good this layout? – Damiano Apr 26 '11 at 8:31
  • That is good for splitting the security among the different vhosts, but the web server needs at least reading access to the files to actually serve them. – pconcepcion Apr 26 '11 at 8:38
  • yes, correct, but if I set these permissions 744, ALL the users of the server can read the website's files. I don't think it's really sure. How to set these permissions? – Damiano Apr 26 '11 at 8:41
  • @Damiano other option can be make the files from the vhosts owned by the group lighttpd, and give rwxr----- permissions to the files and rwxr-x--- to the directories, this way you will limit the reading access between vhosts to the members of lighttpd group. If you don't need to separate vhosts in groups for any other reason (like project separation or something like that) this can be a good solution for you. – pconcepcion Apr 26 '11 at 8:57

Check this in Debian/Ubuntu family distros:

cd /etc/lighttpd/conf-available &
lighttpd-enable-mod fastcgi-php &
service lighttpd restart &
apt-get install php-cgi &
service lighttpd restart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.