Before introducing Nginx, we first appreciate a technology:
FastCGI is a dynamic, open and secure network server interface technology. is upgraded by the CGI (Common Gateway Interface) technology.
CGI is the graphical application process that is loaded repeatedly to complete the response, while fastcgi starts multiple CGI and keeps the process resident, making fastcgi more efficient than CGI.
Support for FASTCGI Web servers are: Nginx,apache (need to join MOD_FASTCGI module, and only support single process so the effect is general), LIGHTTPD, IIS, etc.
Here we build: centos+nginx+mysql+php
Nginx Profile: It is the Russian Igor Sysoev (Igor). Saisoyev) writes a high-performance HTTP and reverse proxy server. Nginx should be a dark horse in Web server software, and it has been an extraordinary performance since birth.
CentOS Install Php,openbsd install Nginx to achieve distributed installation.
Pcre Downloads: http;//pcre.org (enables Nginx to support regular expression rewrite rules)
Nginx Download: http://www.nginx.net
To install the Pcre library first:
Tar ZXVF pcre-8.21.tar.gz
cd/pcre-8.21
./configure
Make && make install
Install Nginx:
Tar ZXVF nginx-1.2.0.tar.gz
cd/nginx-1.2.0
./configure–prefix=/usr/local/nginx (Specify installation directory)
Make && make install
Note: Can be performed during installation./configure–help describes the detailed installation options
Nginx configuration file:/usr/local/nginx/conf/nginx.conf
Start Nginx:cd/usr/local/nginx/sbin
./nginx
Ps–aux|grep nginx View Process
Visit: HTTP://IP
Close Nginx:cd/usr/local/nginx/logs
Cat Nginx.pid
Kill–quit Process Number
Reboot Nginx:kill–hup Process Number Of course we can also use the following command to restart Nginx
Kill-hup ' Cat/usr/local/nginx/sbin/nginx.pid '
Install PHP:
PHP Download Address: http://www.php.net/
PHP-FPM Download Address: http://php-fpm.org/(is a patch for PHP, better support Nginx)
Install PHP:
Tar php-5.2.17.tar.gz
GZIP–CD php-5,2,17-fpm-0.5.14.diff.gz| Patch–d php-5.2.17–p1 the patch into PHP
Cd php-25.2.17
./configure–prefix=/opt/php-5.2.17–enable-fastcgi–enable-fpm
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/web/