1. 進入lighttpd要放置的文件夾cd /usr/local2. 安裝lighttpdwget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.37.tar.gztar -zxvf lighttpd-1.4.37./configure --prefix /usr/local/lighttpdmake & make install3. 創建啓動項cd lighttpd-1.4.37cp doc/initscripts/rc.lighttpd.redhat /etc/init.d/lighttpdvi /etc/init.d/lighttpdlighttpd="/usr/local/lighttpd/sbin/lighttpd"chmod a+rx /etc/init.d/lighttpd4. 複製配置文件到/etc/lighttpdmkdir /etc/lighttpdcp -R doc/config/conf.d/ /etc/lighttpd/conf.d/cp -R doc/config/vhosts.d/ /etc/lighttpd/vhosts.d/cp doc/config/*.conf /etc/lighttpd/5. 根據lighttpd.conf的設定,可自定義,創建lighttpd賬戶和組useradd lighttpd 命令省略6. 修改modules.confserver.modules = ("mod_access","mod_fastcgi","mod_rewrite","mod_accesslog",)server.document-root = "/srv/www/htdocs"server.pid-file = "/opt/test/lighttpd.pid"7. 修改conf.d/fastcgifastcgi.server = ( ".py" => (( "socket" => "/tmp/fastcgi.python.socket", "bin-path" => "/srv/www/htdocs/test.py", "max-procs" => 1, "bin-environment" => ( "REAL_SCRIPT_NAME" => "" ), "check-local" => "disable" )),)