Similar to the installation of other software, the installation process is basically a fool-like
Install Nginx, execute the following command, and quickly complete
sudo apt-get install Nginx
Configuration file default installation location:
Conf:/etc/nginx/nginx.conf
Bin:/usr/sbin/nginx
Vhost:/etc/nginx/sites-enable/default
Cgi-params:/etc/nginx/fastcgi-params
Installing the PHP-CGI module
sudo apt-get install php5-cgi
Configuration file default installation location:
PHP-CGI:/usr/bin/php-cgi
PHP5-CGI:/usr/bin/php5-cgi
CGI config:/usr/bin/cgi/php.ini
Here is a point to note, be sure to modify the php.ini file Cgi.fix_pathinfo data is 1, the default is 0 cgi.fix_pathinfo=1; This allows the php-cgi to normally use the script_filename variable.
Install spawn-fcgi
If the system does not have the GCC compilation environment installed, you just need to install the Build-essential Toolkit before installing LIGHTTPD, and execute the following command:
sudo apt-get install build-essential
wget http://www.lighttpd.net/download/lighttpd-1.4.19.tar.gz
TAR-XVF lighttpd-1.4.19.tar.gz
CD lighttpd-1.4.19/
sudo apt-get install Libpcre3-dev
./configure–without-zlib–without-bzip2
Make
sudo cp src/spawn-fcgi/usr/local/bin/spawn-fcgi
Start fast_cgi:
Spawn-fcgi-a 127.0.0.1-p 9000-c 5-u www-data-g www-data-f
Start Nginx
Sudo/etc/init.d/nginx start