Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i have newly installed lighttpd in ubuntu 9.10 first it showed the detault page and i changed the permission of /var/www/ directory to 777 and now its saying 403 forbidden

my php-cgi -v

PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cgi-fcgi) (built: Jan  6 2010 22:34:28)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

php -v

PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: J
6) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

and i have added these line in lighttpd.conf file

fastcgi.server = ( ".php" => ((
                     "bin-path" => "/usr/bin/php-cgi",
                     "socket" => "/tmp/php.socket"
                 )))

still getting same error....

share|improve this question
    
Logs. Always check your logs, you'll probably find an answer in lighttpd error log. –  rvs Feb 6 '12 at 6:39
    
@rvs - lighttpd does not seem to log reasons for a 403, at least not out of the box. –  Hanno Fietz Jan 9 '13 at 17:37

2 Answers 2

A couple suggestions about what might be wrong:

Permissions on the directory /var/www are 777 (a bad practice, by the way) - but are the subdirectories all readable by the web server?

Check your php error log and your lighttpd error log. (They may be the same file, depending on your php configuration). Are there any errors in the log about permissions, or about anything else?

Is php-cgi running? Check to make sure that it has permission to write to the socket in /tmp, and that lighttpd does as well.

Check your lighttpd configuration. Do you have access rules that may be causing you to get a forbidden message?

share|improve this answer

Most probably the user you are running Lighttpd on doesn't have access to /var/

share|improve this answer
1  
Why does it need access to /var when the docroot is /var/www? –  Hanno Fietz Jan 9 '13 at 17:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.