apache和nginx互切同时都支持fastcgi
apache是模块化结构,本身不自带支持FASTCGI的模块,要让php-fastcg支持APACHE ,必须借助于第三方模块mod_fastcgi;
关于LAMP和LEMP的安装:参照 [url]http://bbs.linuxtone.org/forum-22-1.html[/url]
下载
wget [url]http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz[/url]
wget [url]http://www.cpan.org/modules/by-module/FCGI/FCGI-0.67.tar.gz[/url]

安装两种方法:
1、
tar zxvf FCGI-0.67.tar.gz
perl Makefile.PL
make && make install
cd ..

tar zxvf mod_fastcgi-2.4.6.tar.gz
cd mod_fastcgi-2.4.6
cp Makefile.AP2 Makefile
make
make install
(如果MAKE报错:
vi Makefile
修改top_dir后面apache安装的真实的路径;
例如:top_dir      = /usr/local/apache
修改:httpd.conf 添加
LoadModule fastcgi_module modules/mod_fastcgi.so

       AllowOverride None
       Options +ExecCGI -Includes
       AddHandler fastcgi-script .fcg .fcgi
       Order allow,deny
       Allow from all
 
2、
手动dso安装:
             # tar zxf mod_fastcgi-2.4.6.tar.gz
             # cd od_fastcgi-2.4.6
             # apxs -o mod_fastcgi.so -c *.c
             # apxs -i -a -n fastcgi .libs/mod_fastcgi.so
             在虚拟主机上(virturalhost)添加
                        Alias /fcgi/ /usr/local/apache/htdoc
                      
                        AllowOverride None
                        Options +ExecCGI -Includes
                        AddHandler fastcgi-script .fcg .fcgi
                        Order allow,deny
                        Allow from all
                      

安装完毕,改下apache的端口立即就可以同时启动apache和nginx,apache与nginx相互切换就OK了