zz775520666 发表于 2015-12-23 13:53:40

Apache+php-fpm 配置

yum install apr-devel apr-util-devel -y
tar zxf httpd-2.2.19.tar.gz
cd httpd-2.2.19
./configure --prefix=/usr/local/lnmp/apache2 --enable-modules=so --enable-rewrite --enable-deflate --enable-ssl --with-apr=/usr/bin/apr-1-config--with-apr-util=/usr/bin/apu-1-config --with-mpm=worker
make && make install


tar zxf mod_fastcgi-2.4.6.tar.gz
cd mod_fastcgi-2.4.6
cp Makefile.AP2 Makefile

vim Makefile
top_dir      = /usr/local/lnmp/apache2
make && make install


mkdir /usr/local/lnmp/apache2/fcgi-bin/
ln -s /usr/local/lnmp/php/sbin/php-fpm /usr/local/lnmp/apache2/fcgi-bin/


vim /usr/local/lnmp/apache2/conf/httpd.conf
LoadModule fastcgi_module modules/mod_fastcgi.so


ScriptAlias /fcgi-bin/ "/usr/local/lnmp/apache2/fcgi-bin/"
FastCgiExternalServer /usr/local/lnmp/apache2/fcgi-bin/php-fpm -host 127.0.0.1:9000



    order allow,deny
    allow from all



ln -s /usr/local/lnmp/apache2/bin/apachectl /usr/bin/
apachectl start


netstat -antlp
tcp      0      0 :::80                     :::*                        LISTEN      35000/httpd
页: [1]
查看完整版本: Apache+php-fpm 配置