Nginx's high efficiency is a good name. Recently I want to use it to replace Apache on Ubuntu8.10 server, so I did a test on the local machine. The following steps are recorded! Step 1, install mysqlsudoapt-getinstallmysql-server step 2, install sudoapt-getinstallphp5-cliphp5-cgiphp5-mysqlphp5-gdphp such as php-cgi and gd library
Nginx's high efficiency is out of the name. Recently I want to use it to replace Apache on the Ubuntu 8.10 server, so I did a test on the local machine.
The following steps are recorded!
Step 1: Install mysql
Sudo apt-get install mysql-server
Step 2: install php-cgi and the gd library required
Sudo apt-get install php5-cli php5-cgi php5-mysql php5-gd
Step 3: Install nginx
Sudo apt-get install nginx
Step 4: get spawn-fcgi from lighttpd
Apt-get install lighttpd
Cp/usr/bin/spawn-fcgi ./
Apt-get remove lighttpd
Cp spawn-fcgi/usr/bin/
Sudo vi/usr/bin/php-fastcgi
#! /Bin/sh
/Usr/bin/spawn-fcgi-a 127.0.0.1-p 9000-C 10-u www-data-g www-data-f/u sr/bin/php-cgi
# Note-C 10 indicates that 10 php-cgi processes are enabled!
Sudo chmod 755/usr/bin/php-fastcg
Sudo vi/etc/init. d/init-fastcgi
C ++ code
#! /Bin/bash
PHP_SCRIPT =/usr/bin/php-fastcgi
RETVAL = 0
Case "$1" in
Start)
$ PHP_SCRIPT
RETVAL =$?
;;
Stop)
Killall-9 php5-cgi
RETVAL =$?
;;
Restart)
Killall-9 php5-cgi
$ PHP_SCRIPT
RETVAL =$?
;;
*)
Echo "Usage: php-fastcgi {start | stop | restart }"
Exit 1
;;
Esac
Exit $ RETVAL
Chmod 755/etc/init. d/php-fastcgi
Enable spawn-fcgi
/Etc/init. d/php-fastcgi start
Write boot start!
Update-rc.d php-fastcgi defaults
View the php-cgi process
Ps ax | grep php5-cgi