我有一个奇怪的情况,我通过aptitude安装了lighttpd和php5-fpm
我创build了一个vhost和fpm池。
这是main.conf(全局FPM)
[global] pid = /var/run/php-fpm.pid error_log = /home/lighttpd/log/php-fpm.log log_level = error emergency_restart_threshold = 5 emergency_restart_interval = 2 process_control_timeout = 2 daemonize = yes include=/home/lighttpd/vhosts/*/conf/php-fpm.conf
这是虚幻的池
[website.com] listen = 127.0.0.1:9000 listen.backlog = -1 user = website.com group = website.com pm = dynamic pm.max_requests = 0 pm.max_children = 2 pm.start_servers = 1 pm.min_spare_servers = 1 pm.max_spare_servers = 1 request_terminate_timeout = 2 request_slowlog_timeout = 1 slowlog = /home/lighttpd/vhosts/website.com/log/php-slow.log chroot = /home/lighttpd/vhosts/website.com/web ; Chdir to this directory at the start. This value must be an absolute path. ; Default Value: current directory or / when chroot ;chdir = / catch_workers_output = yes env[HOSTNAME] = $HOSTNAME env[PATH] = /usr/local/bin:/usr/bin:/bin env[TMP] = /tmp env[TMPDIR] = /tmp env[TEMP] = /tmp
我的lighttpdconfiguration是:
## Moduli da caricare server.modules = ( "mod_alias", "mod_compress", "mod_rewrite", "mod_redirect", "mod_accesslog" ) ## Document root server.document-root = "/home/lighttpd/vhosts/" ## File temporanei. server.upload-dirs = ("/home/lighttpd/tmp") ## LOG server.errorlog = "/home/lighttpd/log/error.log" accesslog.filename = "/home/lighttpd/log/access.log" ## File ricercati quando viene richiesta una directory index-file.names = ( "index.php", "index.html", "index.htm", "default.htm" ) ## Negare l'accesso al codice sorgente di questi file static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".conf" ) server.pid-file = "/var/run/lighttpd.pid" dir-listing.encoding = "utf-8" server.dir-listing = "disable" server.username = "lighttpd" server.groupname = "lighttpd" ## Compressione dei contenuti compress.cache-dir = "/home/lighttpd/cache/" compress.filetype = ( "text/plain", "text/html", "application/x-javascript", "text/css" ) ## Mapping dei mimetype include_shell "/usr/share/lighttpd/create-mime.assign.pl" include_shell "/usr/share/lighttpd/include-conf-enabled.pl" #Virtual Hosts include "/home/lighttpd/vhosts/vhosts.conf"
而虚拟主机是:
## WEBSITE.COM $HTTP["host"] =~ "(^|.)website\.com$" { server.document-root = "/home/lighttpd/vhosts/website.com/web" server.errorlog = "/home/lighttpd/vhosts/website.com/log/error.log" accesslog.filename = "/home/lighttpd/vhosts/website.com/log/access.log" fastcgi.server = ( ".php" => ( "localhost" => ( "host" => "127.0.0.1", "port" => "9000" ) ) ) }
如果我访问www.website.com/page.html它运作良好。
如果我访问www.website.com/page.php我总是得到404错误 。
我真的不知道如何解决这个问题。 我也检查进程列表,所有进程都开始了:
lighttpd 974 0.0 0.0 88812 2136 ? S 02:13 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf root 998 0.0 0.1 127268 4316 ? Ss 02:13 0:00 /usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf 1004 999 0.0 0.1 127812 4628 ? S 02:13 0:00 /usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf
也netstat -lnp确认它:
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 998/php5-fpm
有人可以帮我吗? 我不明白为什么PHP页面不处理…我也检查了.log,我没有看到错误。
我尝试了chroot /home/lighttpd/vhosts/website.com/ ,然后chdir /web (http文档),但没有任何结果。 我在/home/lighttpd/vhosts/website.com/conf/php-fpm.conf有php-fpm.conf(池)。
尝试摆脱在池configuration的chroot ,我认为networking服务器传递完整的文件path到FastCGI服务器和(当然)它将无法find该文件。