Nginx source package: http://www.nginx.org/download/nginx-0.7.65.tar.gz
PHP source package: http://cn.php.net/distributions/php-5.2.11.tar.gz
Php-FPM Patch: http://php-fpm.org/downloads/php-5.2.11-fpm-0.5.13.diff.gz
I. Preparations
Use the wget command to download the preceding Software Package
Wget http://www.nginx.org/download/nginx-0.7.65.tar.gz
Wget http://cn.php.net/distributions/php-5.2.11.tar.gz
Wget http://php-fpm.org/downloads/php-5.2.11-fpm-0.5.13.diff.gz
Install necessary system software packages
Yum install gcc
Yum Install patch
Yum install pcre-devel.i386
Yum install openssl-devel.i386
Yum install libxml2-devel.i386
Yum install libjpeg-devel.i386
Yum install libpng-devel.i386
Yum install mysql-devel.i386
Ii. Install nginx
Decompress nginx
Tar zxvf nginx-0.7.65.tar.gz
Go to the nginx source code directory
CD nginx-0.7.65
Configure the nginx compilation File
./Configure -- prefix =/usr/local/nginx
Compile and install nginx
Make & make install
The nginx installation directory is set to =/usr/local/nginx.
Run nginx
/Usr/local/nginx/sbin/nginx
Nginx installation is complete. You can access the welcome page by using an IP address.
3. Patch PHP-FMP and install PHP
Decompress the PHP-FPM and PHP source code packages.
Gunzip php-5.2.11-fpm-0.5.13.diff.gz
Tar zxvf php-5.2.11.tar.gz
Patch
Patch-D php-5.2.11-P1 <php-5.2.11-fpm-0.5.13.diff
Go to the PHP source file directory
CD php-5.2.11
Configure PHP compilation files
./Configure -- prefix =/usr/local/PHP -- enable-FastCGI -- enable-FPM -- enable-magic-
Quotes -- enable-libxml -- enable-FTP -- With-Gd -- With-JPEG-Dir =/usr/lib -- With-PNG
-Dir =/usr/lib -- With-zlib-Dir =/usr/lib -- With-mysql -- enable-zip -- enable-Zend-
Multibyte
Compile and install PHP
Make & make install
PHP is installed in/usr/local/PHP
Copy the php. ini configuration file to the PHP etc directory:
Cp php. ini-Dist/usr/local/PHP/lib/PHP. ini
Change/usr/local/PHP/etc/php-fpm.conf, modify 62 ~ 66 rows
UNIX user of processes
<Value name = "user"> nobody </value>
UNIX group of processes
<Value name = "group"> nobody </value>
Modify 79 rows
<Value name = "max_children"> 5 </value>
If you are running CMS for generating static files such as Dede, the default parameter is enough. If you are running discuz, we recommend that you enable it on burst #1.
About 40.
Run php-CGI
/Usr/local/PHP/sbin/PHP-FPM start
Iv. Integrate nginx and PHP-CGI
Edit/usr/local/nginx/CONF/nginx. conf
1. Find the server segment
Server {
......
}
2. Change the SERVER_NAME parameter to your own domain name.
SERVER_NAME www.elepin.com;
3. Change root to the directory you want to bind. index indicates which files are used as the homepage.
Location /{
Root/usr/WWW;
Index index.html index.htm index. php;
}
The following is the PHP-CGI connection configuration. Root is the same as above. fastcgi_pass, fastcgi_index, and include are all
Yes. fastcgi_param is to be modified. refer to the following
Location ~ \. Php $ {
Root/usr/WWW;
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
Fastcgi_param script_filename $ document_root/$ fastcgi_script_name;
Include fastcgi_params;
}
Restart nginx
Killall nginx
/Usr/local/nginx/sbin/nginx
5. Add Zend to PhP
Tar-zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
Music ZendOptimizer-3.3.9-linux-glibc23-i386/usr/local/Zend
CP/usr/local/Zend/data/5_2_x_comp/zendoptimizer. So/usr/local/Zend/(because PHP is
5.2)
Add the following content to the last line of VIM/usr/local/PHP/etc/PHP. ini:
Zend_optimizer.optimization_level = 15
Zend_extension =/usr/local/Zend/zendoptimizer. So
Restart PHP-CGI
/Usr/local/PHP/sbin/PHP-FPM restart
6. Install myql
1. Install
Yum install mysql-Server
2. Start
/Etc/init. d/mysqld start
The password is blank. Remember to change the MySQL password.