<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>月影鹏鹏 &#187; 安全</title>
	<atom:link href="http://jk.aiwaly.com/wp/tag/%e5%ae%89%e5%85%a8/feed" rel="self" type="application/rss+xml" />
	<link>http://jk.aiwaly.com</link>
	<description>不断探索,追求卓越,做快乐自己</description>
	<lastBuildDate>Wed, 28 Dec 2011 08:29:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Nginx虚拟主机防Webshell完美版(图)</title>
		<link>http://jk.aiwaly.com/wp/nginx%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e9%98%b2webshell%e5%ae%8c%e7%be%8e%e7%89%88%e5%9b%be.html</link>
		<comments>http://jk.aiwaly.com/wp/nginx%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e9%98%b2webshell%e5%ae%8c%e7%be%8e%e7%89%88%e5%9b%be.html#comments</comments>
		<pubDate>Wed, 23 Dec 2009 00:28:41 +0000</pubDate>
		<dc:creator>月影鹏鹏</dc:creator>
				<category><![CDATA[web应用]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[安全]]></category>

		<guid isPermaLink="false">http://jacky.scanmon.com/?p=1517</guid>
		<description><![CDATA[
我们先来看下nginx.conf
server
{
listen       80;
server_name  www.a.com;
index index.html index.htm index.php;
root  /data/htdocs/www.a.com/;
#limit_conn   crawler  20;
location ~ .*\.(php&#124;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.b.com;
index index.html index.htm index.php;
root  /data/htdocs/www.b.com/;
#limit_conn   crawler  20;
location ~ .*\.(php&#124;php5)?
{
#fastcgi_pass  unix:/tmp/php-cgi.sock;
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
}
nginx在80端口接受到访问请求后，会把请求转发给9000端口的php-cgi进行处理
而如果修改php.ini中open_basedir= ../../../../../ ，针对两个不同的网站，www.a.com , www.b.com都会把请求发送给9000处理，而如果先访问www.a.com那么../../../../../就会变成A网站的根目录地址，然后 这时候如果你访问www.b.com，那么open_basedir仍然是A网站的根目录，但是对于B来说，又是不允许访问的，所以就造成了，第二个站点 打开以后会出现no input files，那么有什么解决办法呢？
我们可以把不同的虚拟主机发送到不同的php-cgi端口进行处理，当然响应的php-fpm配置文件中的open_basedir也不同。。我们来看看怎么配置。。
首先,nginx.conf配置如下
server
{
listen       80;
server_name  www.a.com;
index index.html index.htm index.php;
root  /data/htdocs/www.a.com/;
#limit_conn   crawler  20;
location ~ .*\.(php&#124;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.b.com;
index index.html index.htm [...]]]></description>
		<wfw:commentRss>http://jk.aiwaly.com/wp/nginx%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e9%98%b2webshell%e5%ae%8c%e7%be%8e%e7%89%88%e5%9b%be.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

