Lighttpd Web Server 是另外一套輕量級的 Web Server,更詳細的介紹可以參考 lighttpd – 維基百科,自由的百科全書 。
lighttpd Web Server 官方網站: http://www.lighttpd.net/
[@more@]
在 CentOS 6.x 下安裝
# yum install lighttpd lighttpd-fastcgi lighttpd-mod_mysql_vhost –enablerepo=epel
lighttpd Web Server 設定檔
設定檔在 /etc/lighttpd
網頁根目錄 在 /var/www/lighttpd
# rpm -qc lighttpd
/etc/lighttpd/conf.d/access_log.conf
/etc/lighttpd/conf.d/auth.conf
/etc/lighttpd/conf.d/cgi.conf
/etc/lighttpd/conf.d/cml.conf
/etc/lighttpd/conf.d/compress.conf
/etc/lighttpd/conf.d/debug.conf
/etc/lighttpd/conf.d/dirlisting.conf
/etc/lighttpd/conf.d/evhost.conf
/etc/lighttpd/conf.d/expire.conf
/etc/lighttpd/conf.d/fastcgi.conf
/etc/lighttpd/conf.d/geoip.conf
/etc/lighttpd/conf.d/magnet.conf
/etc/lighttpd/conf.d/mime.conf
/etc/lighttpd/conf.d/mod.template
/etc/lighttpd/conf.d/mysql_vhost.conf
/etc/lighttpd/conf.d/proxy.conf
/etc/lighttpd/conf.d/rrdtool.conf
/etc/lighttpd/conf.d/scgi.conf
/etc/lighttpd/conf.d/secdownload.conf
/etc/lighttpd/conf.d/simple_vhost.conf
/etc/lighttpd/conf.d/ssi.conf
/etc/lighttpd/conf.d/status.conf
/etc/lighttpd/conf.d/trigger_b4_dl.conf
/etc/lighttpd/conf.d/userdir.conf
/etc/lighttpd/conf.d/webdav.conf
/etc/lighttpd/lighttpd.conf
/etc/lighttpd/modules.conf
/etc/lighttpd/vhosts.d/vhosts.template
/etc/logrotate.d/lighttpd
/var/www/lighttpd/index.html
修改設定檔
開啟模組
# vim /etc/lighttpd/modules.conf
##
## mod_userdir
##
include “conf.d/userdir.conf”
##
## FastCGI (mod_fastcgi)
##
include “conf.d/fastcgi.conf”
開啟 PHP 功能
# vim /etc/lighttpd/conf.d/fastcgi.conf
fastcgi.server = ( “.php” =>
( “php-local” =>
(
“socket” => “/var/run/lighttpd/php-fastcgi.socket”
“bin-path” => “/usr/bin/php-cgi”,
“max-procs” => 1,
“broken-scriptfilename” => “enable”,
)
)
)
# ),
# ( “php-tcp” =>
# (
# “host” => “127.0.0.1”,
# “port” => 9999,
# “check-local” => “disable”,
# “broken-scriptfilename” => “enable”,
# )
# ),
#
# ( “php-num-procs” =>
# (
# “socket” => socket_dir + “/php-fastcgi-2.socket”,
# “bin-path” => server_root + “/cgi-bin/php5”,
# “bin-environment” => (
# “PHP_FCGI_CHILDREN” => “16”,
# “PHP_FCGI_MAX_REQUESTS” => “10000”,
# ),
# “max-procs” => 5,
# “broken-scriptfilename” => “enable”,
# )
# ),
# )
設定網頁預設編碼
# vim /etc/lighttpd/conf.d/mime.conf
“.css” => “text/css; charset=utf-8”,
“.html” => “text/html; charset=utf-8”,
“.htm” => “text/html; charset=utf-8”,
“.js” => “text/javascript; charset=utf-8”,
安裝 php-cli 套件
# yum install php-cli
啟動 lighttpd Web Server
# service lighttpd start