Apache + PHP-FPM + mod_fastcgi
3/22/2012 05:14:00 PM
Posted by johnhomer
OS: ALAMI 2011.09
- Install pre-req
yum -y install make libtool httpd-devel apr-devel apr
- Install Apache and PHP-FPM
yum -y install httpd php-fpm php-cli
- Install mod_fastcgi
mkdir /root/files ; cd /root/files wget http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz tar -zxvf mod_fastcgi-current.tar.gz cd mod_fastcgi-2.4.6/ cp Makefile.AP2 Makefile make top_dir=/usr/lib/httpd make install top_dir=/usr/lib/httpd
- Setup fastcgi folder
mkdir /var/www/fcgi-bin cp $(which php-cgi) /var/www/fcgi-bin/ chown -R apache: /var/www/fcgi-bin chmod -R 755 /var/www/fcgi-bin
- Load the module and setup php handler in /etc/httpd/conf.d/php-fpm.conf
LoadModule fastcgi_module modules/mod_fastcgi.so LoadModule actions_module modules/mod_actions.so <IfModule mod_fastcgi.c> ScriptAlias /fcgi-bin/ "/var/www/fcgi-bin/" FastCGIExternalServer /var/www/fcgi-bin/php-cgi -host 127.0.0.1:9000 -pass-header Authorization AddHandler php-fastcgi .php Action php-fastcgi /fcgi-bin/php-cgi </IfModule>
- Start the servers
chkconfig php-fpm on chkconfig httpd on service php-fpm start service httpd start
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
apache,
cloud,
linux
. Follow any responses to this post through RSS. You can leave a response, or trackback from your own site.
Subscribe to:
Post Comments (Atom)
Post a Comment