我在 CentOS 5.5 64 位上安装了 lighttpd。一切似乎都运行正常,只是我无法通过 HTML 和 PHP 页面上的 403 错误。我使用了 CHMOD 和 CHOWN,更改了配置文件中的所有权,做了所有可能的事情,但还是卡了 2 天。非常感谢任何帮助,希望这只是我的一个愚蠢错误。
以下是启用了调试选项的日志文件:
2011-02-21 11:23:13: (request.c.304) fd: 7 request-len: 408
GET /index.html HTTP/1.1
Host: 10.0.1.8
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cache-Control: max-age=0
2011-02-21 11:23:13: (response.c.241) run condition
2011-02-21 11:23:13: (response.c.300) -- splitting Request-URI
2011-02-21 11:23:13: (response.c.301) Request-URI : /index.html
2011-02-21 11:23:13: (response.c.302) URI-scheme : http
2011-02-21 11:23:13: (response.c.303) URI-authority: 10.0.1.8
2011-02-21 11:23:13: (response.c.304) URI-path : /index.html
2011-02-21 11:23:13: (response.c.305) URI-query :
2011-02-21 11:23:13: (response.c.349) -- sanatising URI
2011-02-21 11:23:13: (response.c.350) URI-path : /index.html
2011-02-21 11:23:13: (response.c.470) -- before doc_root
2011-02-21 11:23:13: (response.c.471) Doc-Root : /srv/www/lighttpd
2011-02-21 11:23:13: (response.c.472) Rel-Path : /index.html
2011-02-21 11:23:13: (response.c.473) Path :
2011-02-21 11:23:13: (response.c.521) -- after doc_root
2011-02-21 11:23:13: (response.c.522) Doc-Root : /srv/www/lighttpd
2011-02-21 11:23:13: (response.c.523) Rel-Path : /index.html
2011-02-21 11:23:13: (response.c.524) Path : /srv/www/lighttpd/index.html
2011-02-21 11:23:13: (response.c.541) -- logical -> physical
2011-02-21 11:23:13: (response.c.542) Doc-Root : /srv/www/lighttpd
2011-02-21 11:23:13: (response.c.543) Rel-Path : /index.html
2011-02-21 11:23:13: (response.c.544) Path : /srv/www/lighttpd/index.html
2011-02-21 11:23:13: (response.c.561) -- handling physical path
2011-02-21 11:23:13: (response.c.562) Path : /srv/www/lighttpd/index.html
2011-02-21 11:23:13: (response.c.608) -- access denied
2011-02-21 11:23:13: (response.c.609) Path : /srv/www/lighttpd/index.html
2011-02-21 11:23:13: (response.c.128) Response-Header:
HTTP/1.1 403 Forbidden
Content-Type: text/html
Content-Length: 345
Date: Mon, 21 Feb 2011 16:23:13 GMT
Server: lighttpd/1.4.28
以下是目录列表。我使用 CHOWN 将其设置为 lighttpd:lighttpd
[root@localhost lighttpd]# ls -al
total 40
drwxrwxrwx 2 lighttpd lighttpd 4096 Feb 21 10:48 .
drwxrwxrwx 3 lighttpd lighttpd 4096 Feb 21 10:57 ..
-rwxrwxrwx 1 lighttpd lighttpd 10 Feb 20 08:32 index.html
-rwxrwxrwx 1 lighttpd lighttpd 20 Feb 21 10:48 index.php
-rwxrwxrwx 1 lighttpd lighttpd 20 Feb 21 10:39 info.php
[root@localhost lighttpd]#
请求的命令:
[root@localhost lighttpd]# ls -ld / /srv /srv/www
drwxr-xr-x 22 root root 4096 Feb 21 04:39 /
drwxrwxrwx 3 lighttpd lighttpd 4096 Feb 20 07:38 /srv
drwxrwxrwx 3 lighttpd lighttpd 4096 Feb 21 10:57 /srv/www
[root@localhost lighttpd]# ps auxZ | grep lighttpd
root:system_r:httpd_t lighttpd 3842 0.0 0.2 48368 896 ? S 12:24 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
root:system_r:unconfined_t:SystemLow-SystemHigh root 3845 0.0 0.2 61152 764 pts/0 R+ 12:24 0:00 grep lighttpd