This use spawn-fcgi to manage fastcgi in order to achieve the optimization of Apache PHP performance method compared to the alternative, we all right when a reference.
Method: The system platform is CentOS 5, the premise is that lamp has been configured well, running normally.
1. Wget-c http://www.21andy.com/centos/5/i386/spawn-fcgi-1.6.3-1.el5.i386.rpm (can also go to the official download source package compiled installation:/HTTP www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz)
2. RPM-IVH spawn-fcgi-1.6.3-1.el5.i386.rpm
3. Use spawn-fcgi to control the php-cgi fastcgi process:
/usr/bin/spawn-fcgi-a 127.0.0.1-p 9000-c 5-u apache-g apache-f/usr/bin/php-cgi
The parameters have the following meanings:
- f <fcgiapp> Specifies the execution program location of the process that calls fastcgi, depending on the PHP situation installed on the system.
-a <addr> bind to address addr.
-P <port> bind to ports port.
-S <path> path bound to the UNIX socket.
- C <childs> Specifies the number of processes generated by the fastcgi, which defaults to 5. (PHP only)
- p <path> Specifies the path of the PID file for the resulting process.
what identity is used by-u and-G fastcgi (-u user-G user group), the Apache user can be used under CentOS, and other configurations such as nobody, Www-data and so on.
4. Add this line of code to the bottom of the/etc/rc.local file so that the PHP fastcgi process can be started at the same time as the system starts.
Build a server with Apache + spawn-fcgi + fast-cgi