安装mysql
apt-get install mysql-server
安装php
apt-get install php5-common php5-cgi php5-mysql php5-curl php5-gd php5-imagick php5-mcrypt php5-sqlite php-apc
安装Nginx
apt-get install nginx
安装spawn-fcgi
$wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz
$tar -xvf spawn-fcgi-1.6.3.tar.gz
$cd spawn-fcgi-1.6.3
$./configure –prefix=/usr
$make
$sudo make install
启动php5-cgi
$spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi
配置Nginx
1 2 3 4 5 6 7 8 9 10 11 12 |
修改/etc/nginx/sites-available/default<br /> # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000<br /> #<br /> location ~ .php$ {<br /> fastcgi_pass 127.0.0.1:9000;<br /> fastcgi_index index.php;<br /> fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;<br /> include fastcgi_params;<br /> }<br /> <br /> 重启nginx<br /> /etc/init.d/nginx restart<br /> |
原创文章,转载请注明: 转载自贝壳博客
nginx不需要重启哦……reload就可以了
/etc/init.d/nginx reload