红联Linux门户
Linux帮助

Debian 下 Lighttpd + MySQL + PHP

发布时间:2008-03-21 00:20:22来源:红联作者:loife
新装了台服务器,准备将部份系统迁移过去,久闻 Lighttpd 做服务器性能优异且稳定(目前有台静态资源服务器用 nginx,但因为没什么流量,看不出效果来),这回且试一试。

1、装软件

apt-get install lighttpd mysql-server php5-cgi php5-mysql

2、改配置文件

在/etc/php5/cgi/php.ini末尾增加一行:

cgi.fix_pathinfo = 1

编辑/etc/lighttpd/lighttpd.conf,在server.modules字段增加mod_fastcgi,类似如下:

server.modules = (
“mod_access”,
“mod_alias”,
“mod_accesslog”,
“mod_fastcgi”,
“mod_rewrite”,
)

并在/etc/lighttpd/lighttpd.conf文件末尾增加:

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

运行 /etc/init.d/lighttpd restart 后看看 phpinfo 是否一切正常。

另外,当然还得改下 MySQL 密码:

mysqladmin -u root password MYPASSWORD

回头系统上线后,再观察一下系统压力吧,希望能发挥得好些。感谢 baoz 友情提供 lighttpd 的大量配置经验。
文章评论

共有 0 条评论