<?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>OurApache &#187; iis</title>
	<atom:link href="http://ourapache.com/archives/tag/iis/feed" rel="self" type="application/rss+xml" />
	<link>http://ourapache.com</link>
	<description>我们致力于一个Apache知识的分享网站</description>
	<lastBuildDate>Tue, 13 Apr 2010 05:18:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Apache和IIS共享80端口的四个方法</title>
		<link>http://ourapache.com/archives/273</link>
		<comments>http://ourapache.com/archives/273#comments</comments>
		<pubDate>Thu, 13 Aug 2009 09:33:08 +0000</pubDate>
		<dc:creator>OurApache</dc:creator>
				<category><![CDATA[Apache初级应用]]></category>
		<category><![CDATA[iis]]></category>

		<guid isPermaLink="false">http://www.ourapache.com/?p=273</guid>
		<description><![CDATA[Apache和IIS共享80端口的四个方法]]></description>
			<content:encoded><![CDATA[<div class="mypost">
<p><strong>方法一：</strong></p>
<p><a href="http://ourapache.com/archives/tag/iis" class="st_tag internal_tag" rel="tag" title="标签 iis 下的日志">IIS</a>5，多IP下共存，IIS为192.168.0.1，apache为192.168.0.2</p>
<blockquote><p>c:\Inetpub\Adminscripts<br />
cscript adsutil.vbs set w3svc/disablesocketpooling true</p></blockquote>
<p>该命令反馈如下disablesocketpooling : (BOOLEAN) True</p>
<p>重启IIS</p>
<blockquote><p>Inetpub\AdminScripts&gt;cscript adsutil.vbs set w3svc/disablesocketpooling true</p></blockquote>
<p>由于 DisableSocketPooling 在 IIS 6.0 元数据库架构 (MBSchema.xml) 中被定义为有效属性，所以，您仍然可以使用 Adsutil.vbs 设置该属性，但这种设置不起作用。IIS 6.0 中的功能是新增的核心级别驱动程序 HTTP.sys 的一部分。要配置 HTTP.sys，您必须使用 Httpcfg.exe</p>
<p><strong>方法二：</strong></p>
<p>IIS6，多IP下共存，IIS为192.168.0.1，apache为192.168.0.2</p>
<p>到2003的CD下的 support/tools/Support.cab。解压出httpcfg.exe文件，COPY到windows/system32/目录下，用法自己看帮助</p>
<p>命令行绑定到某IP：</p>
<blockquote><p>httpcfg set iplisten -i 192.168.0.1</p></blockquote>
<p>即命令使用IIS的只监听指定的IP及端口</p>
<blockquote><p>查看绑定： httpcfg query iplisten<br />
删除绑定： httpcfg delete iplisten -i 192.168.0.1</p></blockquote>
<p>命令行</p>
<blockquote><p>net stop Apache2<br />
net stop iisadmin /y<br />
net START Apache2<br />
net START w3svc</p></blockquote>
<p>保证iis下的ip设置为全局默认，Apache中httpconf设置listen 192.168.0.2:80，就应该可以两个服务同时运行，相互不冲突了。</p>
<p>IIS的访问地址为http://192.168.0.1，Apache访问地址为<a href="http://192.168.0.2">http://192.168.0.2</a></p>
<p><span style="COLOR: red">提醒：IIS要指定为IP地址192.168.0.1 <a href="http://ourapache.com/archives/tag/%e7%ab%af%e5%8f%a3" class="st_tag internal_tag" rel="tag" title="标签 端口 下的日志">端口</a>80；Apache 设置listen 192.168.0.2:80。关键是IIS用httpcfg命令绑定后，要重启系统，仅仅重启服务是不行的。</span></p>
<p><strong>方法三：</strong></p>
<p>将apache设为使用80端口，IIS使用其它端口，比如81，然后将apache作为IIS的代理。</p>
<p>在httpd.conf里面，取消下面四行的注释：</p>
<blockquote><p>LoadModule proxy_module modules/mod_proxy.so<br />
LoadModule proxy_connect_module modules/mod_proxy_connect.so<br />
LoadModule proxy_http_module modules/mod_proxy_http.so<br />
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so</p></blockquote>
<p>然后建立一个虚拟主机，将该域名的所有访问转向81端口。</p>
<blockquote><p>ServerName iloves.vicp.net<br />
ProxyPass / http://localhost:81/<br />
ProxyPassReverse / <a href="http://localhost:81/">http://localhost:81/</a></p></blockquote>
<p>这样，对外就可以只需要一个端口，即可同时使用apache和IIS的功能了</p>
<p><strong>方法四：</strong></p>
<p>网上常用的单IP共用80端口方法，不过不推荐，只是使用Apache的代理，速度有影响将apache设为使用80端口，IIS使用其它端口，比如81，然后将apache作为IIS的代理。</p>
<p>在httpd.conf里面，取消下面四行的注释：</p>
<blockquote><p>LoadModule proxy_module modules/mod_proxy.so<br />
LoadModule proxy_connect_module modules/mod_proxy_connect.so<br />
LoadModule proxy_http_module modules/mod_proxy_http.so<br />
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so</p></blockquote>
<p>然后建立一个虚拟主机，将该域名的所有访问转向81端口。</p>
<blockquote><p>ServerName iloves.vicp.net<br />
ProxyPass / http://localhost:81/<br />
ProxyPassReverse / <a href="http://localhost:81/">http://localhost:81/</a></p></blockquote>
<p>这样，对外就可以只需要一个端口，即可同时使用apache和IIS的功能了</p>
<p>类推，使用第二种方法，你可以在IIS上配置PHP4，Apache2中配置PHP5，只需要IIS中安装PHP4，把php.ini复制到\windows目录即可，这个就不用说了吧，Apache2中，只要把PHP5的php.ini放在PHP5安装目录里面就行了</p>
<p>配置Apache以支持PHP5：</p>
<blockquote><p>LoadModule php5_module “D:/PHPServer/PHP5/php5apache2.dll”<br />
AddType application/x-httpd-php .php<br />
DirectoryIndex index.html index.php<br />
PHPIniDir “D:/PHPServer/PHP5″</p></blockquote>
<p>其中最重要的一条就是 PHPIniDir，用来指明php.ini文件所在位置，即PHP5的安装目录，注意所有目录的应该改为D:/PHPServer/PHP5这种格式， 而非D:\PHPServer\PHP5，IIS的访问地址为http://192.168.0.1，Apache访问地址为http: //192.168.0.2</p></div>
<h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009年02月10号 -- <a href="http://ourapache.com/archives/104" title="Apache和IIS共享80端口的四个方法">Apache和IIS共享80端口的四个方法</a></li></ul>
	标签：<a href="http://ourapache.com/archives/category/primary" title="Apache初级应用" rel="tag">Apache初级应用</a>, <a href="http://ourapache.com/archives/tag/iis" title="iis" rel="tag">iis</a><br />
]]></content:encoded>
			<wfw:commentRss>http://ourapache.com/archives/273/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache和IIS共享80端口的四个方法</title>
		<link>http://ourapache.com/archives/104</link>
		<comments>http://ourapache.com/archives/104#comments</comments>
		<pubDate>Tue, 10 Feb 2009 06:30:24 +0000</pubDate>
		<dc:creator>OurApache</dc:creator>
				<category><![CDATA[Apache初级应用]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[端口]]></category>

		<guid isPermaLink="false">http://www.ourapache.com/?p=104</guid>
		<description><![CDATA[Apache和IIS共享80端口的四个方法]]></description>
			<content:encoded><![CDATA[<p><strong>方法一：</strong><br />
<a href="http://ourapache.com/archives/tag/iis" class="st_tag internal_tag" rel="tag" title="标签 iis 下的日志">IIS</a>5，多IP下共存，IIS为192.168.0.1，apache为192.168.0.2<br />
c:\Inetpub\Adminscripts<br />
cscript adsutil.vbs set w3svc/disablesocketpooling true<br />
该命令反馈如下disablesocketpooling : (BOOLEAN) True<br />
重启IIS<br />
Inetpub\AdminScripts&gt;cscript adsutil.vbs set w3svc/disablesocketpooling true<br />
由于 DisableSocketPooling 在 IIS 6.0 元数据库架构 (MBSchema.xml) 中被定义为有效属性，所以，您仍然可以使用 Adsutil.vbs 设置该属性，但这种设置不起作用。IIS 6.0 中的功能是新增的核心级别驱动程序 HTTP.sys 的一部分。要配置 HTTP.sys，您必须使用 Httpcfg.exe</p>
<p><strong>方法二：</strong><br />
IIS6，多IP下共存，IIS为192.168.0.1，apache为192.168.0.2<br />
到2003的CD下的 support/tools/Support.cab。解压出httpcfg.exe文件，COPY到windows/system32/目录下，用法自己看帮助<br />
命令行<br />
绑定到某IP： httpcfg set iplisten -i 192.168.0.1<br />
即命令使用IIS的只监听指定的IP及端口<br />
查看绑定： httpcfg query iplisten<br />
删除绑定： httpcfg delete iplisten -i 192.168.0.1<br />
命令行<br />
net stop Apache2<br />
net stop iisadmin /y<br />
net START Apache2<br />
net START w3svc<br />
保证iis下的ip设置为全局默认，Apache中httpconf设置listen 192.168.0.2:80，就应该可以两个服务同时运行，相互不冲突了。<br />
IIS的访问地址为http://192.168.0.1，Apache访问地址为http://192.168.0.2<br />
<span style="color: red;">提醒：IIS要指定为IP地址192.168.0.1 <a href="http://ourapache.com/archives/tag/%e7%ab%af%e5%8f%a3" class="st_tag internal_tag" rel="tag" title="标签 端口 下的日志">端口</a>80；Apache 设置listen 192.168.0.2:80。关键是IIS用httpcfg命令绑定后，要重启系统，仅仅重启服务是不行的。</span></p>
<p><strong>方法三：</strong><br />
将apache设为使用80端口，IIS使用其它端口，比如81，然后将apache作为IIS的代理。<br />
在httpd.conf里面，取消下面四行的注释：<br />
LoadModule proxy_module modules/mod_proxy.so<br />
LoadModule proxy_connect_module modules/mod_proxy_connect.so<br />
LoadModule proxy_http_module modules/mod_proxy_http.so<br />
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so</p>
<p>然后建立一个虚拟主机，将该域名的所有访问转向81端口。</p>
<p>ServerName iloves.vicp.net<br />
ProxyPass / http://localhost:81/<br />
ProxyPassReverse / http://localhost:81/</p>
<p>这样，对外就可以只需要一个端口，即可同时使用apache和IIS的功能了</p>
<p><strong>方法四：</strong><br />
网上常用的单IP共用80端口方法，不过不推荐，只是使用Apache的代理，速度有影响将apache设为使用80端口，IIS使用其它端口，比如81，然后将apache作为IIS的代理。<br />
在httpd.conf里面，取消下面四行的注释：<br />
LoadModule proxy_module modules/mod_proxy.so<br />
LoadModule proxy_connect_module modules/mod_proxy_connect.so<br />
LoadModule proxy_http_module modules/mod_proxy_http.so<br />
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so<br />
然后建立一个虚拟主机，将该域名的所有访问转向81端口。<br />
ServerName iloves.vicp.net<br />
ProxyPass / http://localhost:81/<br />
ProxyPassReverse / http://localhost:81/<br />
这样，对外就可以只需要一个端口，即可同时使用apache和IIS的功能了<br />
类推，使用第二种方法，你可以在IIS上配置PHP4，Apache2中配置PHP5，只需要IIS中安装PHP4，把php.ini复制到\windows目录即可，这个就不用说了吧，Apache2中，只要把PHP5的php.ini放在PHP5安装目录里面就行了<br />
配置Apache以支持PHP5：<br />
LoadModule php5_module “D:/PHPServer/PHP5/php5apache2.dll”<br />
AddType application/x-httpd-php .php<br />
DirectoryIndex index.html index.php<br />
PHPIniDir “D:/PHPServer/PHP5″<br />
其中最重要的一条就是 PHPIniDir，用来指明php.ini文件所在位置，即PHP5的安装目录，注意所有目录的应该改为D:/PHPServer/PHP5这种格式，而非D:\PHPServer\PHP5，IIS的访问地址为http://192.168.0.1，Apache访问地址为http://192.168.0.2</p>
<h3  class="related_post_title">相关文章</h3><ul class="related_post"><li>2009年08月13号 -- <a href="http://ourapache.com/archives/273" title="Apache和IIS共享80端口的四个方法">Apache和IIS共享80端口的四个方法</a></li></ul>
	标签：<a href="http://ourapache.com/archives/category/primary" title="Apache初级应用" rel="tag">Apache初级应用</a>, <a href="http://ourapache.com/archives/tag/iis" title="iis" rel="tag">iis</a>, <a href="http://ourapache.com/archives/tag/%e7%ab%af%e5%8f%a3" title="端口" rel="tag">端口</a><br />
]]></content:encoded>
			<wfw:commentRss>http://ourapache.com/archives/104/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

