Yum install mysql-Server
Yum install mysql-y
Wget http://nginx.org/download/nginx-1.5.1.tar.gz
Tar-xzf nginx-1.5.1.tar.gz
CD nginx-1.5.1
Um-y install PCRE-devel zlib-devel md5-devel OpenSSL
./Configure; Make; make install;
Yum-y install PHP
Yum-y install PHP-MySQL
Yum-y install PHP-Gd
Yum-y install memcached
Yum install-y PHP-FPM
Chkconfig PHP-FPM on
Chkconfig memcached on
Service memcached start
VI/etc/init. d/nginx
#! /Bin/bash. /etc/rc. d/init. d/functions # source networking configuration .. /etc/sysconfig/Network # Check that networking is up. ["$ networking" = "no"] & Exit 0 nginx = "/usr/local/nginx/sbin/nginx" prog =$ (basename $ nginx) nginx_conf_file = "/usr/local/nginx/CONF/nginx. conf "[-F/etc/sysconfig/nginx] &. /etc/sysconfig/nginxlockfile =/var/lock/subsys/nginxstart () {[-x $ nginx] | Exit 5 [-F $ nginx_conf _ File] | exit 6 echo-N $ "Starting $ prog:" daemon $ nginx-C $ nginx_conf_file retval =$? Echo [$ retval-EQ 0] & touch $ lockfile return $ retval} STOP () {echo-N $ "Stopping $ prog:" killproc $ prog-Quit retval =$? Echo [$ retval-EQ 0] & Rm-F $ lockfile return $ retval} restart () {configtest | return $? Stop sleep 1 start} reload () {configtest | return $? Echo-N $ "reloading $ prog:" killproc $ nginx-hup retval =$? Echo} force_reload () {restart} configtest () {$ nginx-T-C $ nginx_conf_file} rh_status () {Status $ prog} rh_status_q () {rh_status>/dev/null 2> & 1} case "$1" in START) rh_status_q & Exit 0 $1; stop) rh_status_q | exit 0 $1 ;; restart | configtest) $1; RELOAD) rh_status_q | exit 7 $1; force-Reload) force_reload; Status) rh_status; condrestart | try-Restart) rh_status_q | exit 0; *) echo $ "Usage: $0 {START | stop | status | restart | condrestart | try-Restart | reload | force-Reload | configtest} "Exit 2 esac
Chmod A + x/etc/init. d/nginx
VI/usr/local/nginx/CONF/nginx. conf
Location ~ \. Php $ {root/opt/WWW; fastcgi_pass 127.0.0.1: 9000; fastcgi_index index. php; fastcgi_param script_filename/opt/WWW $ fastcgi_script_name; Include fastcgi_params ;}
Gzip on;
Gzip_types text/plain application/X-JavaScript text/CSS text/JavaScript Application/X-httpd-PHP image/JPEG image/GIF image/PNG application/X-Shockwave-flash;
Chkconfig nginx on
Service mysqld start
Service nginx restart
Service PHP-FPM start