发布时间:2012-12-01 00:29:34作者:知识屋
1.在nginx.conf里把每个虚拟主机站点请求端口给区别开
server {
listen 80;
server_name www.hx95.com;
index index.html index.htm index.php;
root /var/www/test;#limit_conn crawler 20;
location ~ .*.(php|php5)?$ {
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
}
server {
listen 80;
server_name www.nginx.org;
index index.html index.htm index.php;
root /var/www/test1;
#limit_conn crawler 20;
location ~ .*.(php|php5)?$ {
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
include fcgi.conf;
}
}
#cp /usr/local/php/etc/php-fpm.conf /usr/local/php/etc/www.key0.cn.conf
#cp /usr/local/php/etc/php-fpm.conf /usr/local/php/etc/www.nginx.org.conf
www.key0.cn
在/usr/local/php/etc/www.key0.cn.conf找到php_defines,添加
<value name=”open_basedir”>/var/www/test:/tmp:/var/tmp</value>
www.nginx.org
在/usr/local/php/etc/nginx.org.conf找到php_defines,添加
<value name=”open_basedir”>/var/www/test1:/tmp:/var/tmp</value>
修改为<value name=”listen_address”>127.0.0.1:9001</value> 注意这里的端口号
$php_fpm_BIN –fpm –fpm-config /usr/local/php/etc/www.key0.cn.conf
$php_fpm_BIN –fpm –fpm-config /usr/local/php/etc/www.nginx.org.conf
#/usr/local/php/sbin/php-fpm start#/usr/local/nginx/sbin/nginx
#netstat -tlnp
当然,启动之前记得conf里面的max_children,开启php-cgi子进程数,相应要减少一些,以免造成内存不足
补充:
spawn-fcgi -a 127.0.0.1 -p 9000 -C 9 -u www -f “/usr/local/php/bin/php-cgi -d open_basedir=/var/www/test:/tmp/”
2011-06-17
电脑开机时出现lass.exe进程是病毒吗?
自拍须谨慎!教你如何通过照片定位查看拍摄地点
电脑病毒最基础知识
黑客学员必须了解的C语言技术
精典详细内网渗透专题文章
教你破解Tp-Link的无线路由密码
解决SecureCRT中文显示乱码
QQ电脑管家和360哪个好?横评实测对比
攻防实战:无线网络路由入侵过程