Use Nginx to replace apache for a high-performance Web Environment-Linux Enterprise Application-Linux server application information. The following is a detailed description. Use Nginx to replace apache for a high-performance Web Environment
Author: NetSeek welcome reprint, reprint please note the Source: http://bbs.linuxpk.com
Link: http://bbs.linuxpk.com/thread-11845-1-1.html
Nginx introduction:
Nginx is pronounced as [engine x] and is a project established by the Russian Igor Sysoev Based on the BSD license.
It is said that he was a member of F5, Home: http://nginx.net. Some of Russia's large websites have been using it for more than two years and have always performed well, I believe all of my friends who want to know about nginx have read the article about using nginx to achieve Server Load balancer (6 ).
Test environment: redocn provides an operating server environment.
About the red moving service environment:
Rednet China's early use of the apache environment, coupled with some optimization work, has been relatively heavy, but recently due to the development of the website, the access volume is growing, the number of online users often appear, the load is too high, the Performance drops sharply. With the consent of the webmasters of shuangmu, it is suggested that nginx can be used to replace apache. After a long period of observation, nginx is stable and the system will not talk about the current high load, memory usage is also very low, and the access rate is significantly improved from the user experience.
About China:
After nearly one year of rapid development, the redocn Forum currently has an average of over 1 million page views per day, ranking 1st in the global design Forum (Chinese, is one of the most influential design forums in China. At present, the Forum has nearly 0.2 million members, including the backbone of many leading figures in the design field, teachers and students of relevant art schools, and some design lovers.
Migration goal: To achieve static website forum, anti-leeching, download concurrency and speed limit, to achieve all the functions of apache on the original site, and migrate all the sites in the original apache environment to Nginx
I. PHP (Fastcgi) Compilation and Installation
[Root @ att php-5.2.4] # cat in. sh
CODE:./configure \ "-- Prefix =/usr/local/php-fcgi "\ "-- Enable-fastcgi "\ "-- Enable-discard-path "\ "-- Enable-force-cgi-redirect "\ "-- With-config-file-path =/usr/local/php-fcgi/etc "\ "-- Enable-zend-multibyte "\ "-- With-mysql =/usr/local/mysql "\ "-- With-libxml-dir =/usr/local/libxml2 "\ "-- With-gd =/usr/local/gd2 "\ "-- With-jpeg-dir "\ "-- With-png-dir "\ -- With-bz2 "\ "-- With-freetype-dir "\ "-- With-iconv-dir "\ "-- With-zlib-dir "\ "-- With-openssl =/usr/local/openssl "\ "-- With-mcrypt =/usr/local/libmcrypt "\ "-- Enable-sysvsem "\ "-- Enable-inline-optimization "\ "-- Enable-soap "\ "-- Enable-gd-native-ttf "\ "-- Enable-ftp "\ "-- Enable-mbstring "\ "-- Enable-exif "\ "-- Disable-debug "\ -- Disable-ipv6" Make Make install Cp php. ini-dist/usr/local/php-fcgi/etc/php. ini |