一,    安装lighttpdlighttpd-fastcgispawn-fcgiRPM包,版本要相同。源码编译在PHP上出现麻烦。但是lighttpd可以源码编译,要支持rewrite还要安装pcre
 
二,  编译PHP的时候要加上--enable-fastcgi --enable-force-cgi-redirect选项,然后提示在php.ini里添加:cgi.fix_pathinfo = 1,这里用fastcgi代替PHP
              #### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
 
三,  lighttpd.conf配置文件很关键,它的灵活度很大,而且提示不按常理,比如说,403通常是访问权限的问题,404则访问的文件不存在,知道访问test.php提示403是什么意思吗?是还没有搭建PHP环境。
 
四,  PHP的话,记得改这个:
#### proxy module
## read proxy.txt for more info
proxy.server               = ( ".php" =>
                               ( "localhost" =>
                                 (
                                   "host" => "192.168.0.101",
                                   "port" => 80
                                 )
                              )
                             )
同时他用host=>来指定多个PHP服务器或接口,达到负载目的
 
FastCGI的话,则改这个:
fastcgi.server = (
   ".php" => (
      ( "host" => "127.0.0.1",   "port" => 9000, "check-local" => "disable", "docroot" => "/var/www/html" )
 #    ( "host" => "192.168.0.94", "port" => 9000, "check-local" => "disable", "docroot" => "/var/www/html" )负载
#    ( "host" => "192.168.0.4",  "port" => 9000, "check-local" => "disable", "docroot" => "/var/www/lighttpd" )
   )
蓝色的是本机跑fastchi时候的配置。
 
五,   还有模块,日志位置,网站根目录位置等设定。
 
六,  PHP上图:
     lighttpd+fastcgi+spawn-fcgi_休闲
七,  还有缓存,视频,防盗链,压缩等模块功能需要探索,这只是第一步.^_^