如何让IIS与Apache共用80端口方法
时间:2022-12-29 12:22:20
为调试程序,本机安装iis与apache,无法同时使用80端口,现给出解决方法: 方法一: IIS5,多IP下共存,IIS为192.168.0.1,apache为192.168.0.2 原文地址 c:\Inetpub\Adminscripts
为调试程序,本机安装iis与apache,无法同时使用80端口,现给出解决方法:
方法一:
IIS5,多IP下共存,IIS为192.168.0.1,apache为192.168.0.2 原文地址
c:\Inetpub\Adminscripts
cscript adsutil.vbs set w3svc/disablesocketpooling true
该命令反馈如下disablesocketpooling : (BOOLEAN) True
重启IIS
Inetpub\AdminScripts>cscript adsutil.vbs set w3svc/disablesocketpooling true
由于 DisableSocketPooling 在 IIS 6.0 元数据库架构 (MBSchema.xml) 中被定义为有效属性,所以,您仍然可以使用 Adsutil.vbs 设置该属性,但这种设置不起作用。IIS 6.0 中的功能是新增的核心级别驱动程序 HTTP.sys 的一部分。要配置 HTTP.sys,您必须使用 Httpcfg.exe
方法二:
IIS6,多IP下共存,IIS为192.168.0.1,apache为192.168.0.2 原文地址
到2003的CD下的 support/tools/Support.cab。解压出httpcfg.exe文件,COPY到windows/system32/目录下,用法自己看帮助
命令行
绑定到某IP: httpcfg set iplisten -i 192.168.0.1
即命令使用IIS的只****指定的IP及端口
查看绑定: httpcfg query iplisten
删除绑定: httpcfg delete iplisten -i 192.168.0.1
命令行
net stop Apache2
net stop iisadmin /y
net START Apache2
net START w3svc
保证iis下的ip设置为全局默认,Apache中httpconf设置listen 192.168.0.2:80,就应该可以两个服务同时运行,相互不冲突了。
IIS的访问地址为http://192.168.0.1,Apache访问地址为http://192.168.0.2
方法三:
网上常用的单IP共用80端口方法,不过不推荐,只是使用Apache的代理,速度有影响将apache设为使用80端口,IIS使用其它端口,比如81,然后将apache作为IIS的代理。
在httpd.conf里面,取消下面四行的注释:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
然后建立一个虚拟主机,将该域名的所有访问转向81端口。
ServerName iloves.vicp.net
ProxyPass / http://localhost:81/
ProxyPassReverse / http://localhost:81/
这样,对外就可以只需要一个端口,即可同时使用apache和IIS的功能了
类推,使用第二种方法,你可以在IIS上配置PHP4,Apache2中配置PHP5,只需要IIS中安装PHP4,把php.ini复制到\windows目录即可,这个就不用说了吧,Apache2中,只要把PHP5的php.ini放在PHP5安装目录里面就行了
配置Apache以支持PHP5:
LoadModule php5_module "D:/PHPServer/PHP5/php5apache2.dll"
AddType application/x-httpd-php .php
DirectoryIndex index.html index.php
PHPIniDir "D:/PHPServer/PHP5"
其中最重要的一条就是 PHPIniDir,用来指明php.ini文件所在位置,即PHP5的安装目录,注意所有目录的应该改为D:/PHPServer/PHP5这种格式,而非D:\PHPServer\PHP5,IIS的访问地址为http://192.168.0.1,Apache访问地址为http://192.168.0.2
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Excel表格重复打印标题方法动画教程
![](https://img.aspxhome.com/file/2023/3/39253_0s.gif)
neoCopy.exe - neoCopy是什么进程 有什么用
Wps如何显示/关闭表格行号列标?Wps显示/关闭表格行号列标方法
![](https://img.aspxhome.com/file/2023/1/a182351_0s.gif)
Win10玩绝地求生闪退?Win10玩绝地求生闪退解决方法
![](https://img.aspxhome.com/file/2023/1/a279133_0s.png)
Excel打印预览时不能改变纸张方向大小该怎办?
![](https://img.aspxhome.com/file/2023/3/41893_0s.jpg)
如何实现在Word中对英文字母进行大小写转换
![](https://img.aspxhome.com/file/2023/3/34013_0s.jpg)
win10更新在哪里_win10更新打开教程
![](https://img.aspxhome.com/file/2023/2/a287596_0s.jpg)
Win7系统移动中心红叉提示联机查找防病毒程序的处理方法
![](https://img.aspxhome.com/file/2023/28/a242361_0s.jpg)
Word 2007多种样式页码的插入
![](https://img.aspxhome.com/file/2023/1/20581_0s.jpg)
Windows11玩游戏卡吗?Windows11玩游戏是否卡顿详细介绍
![](https://img.aspxhome.com/file/2023/27/a238247_0s.jpg)
Win10不能升级10041的解决方法
![](https://img.aspxhome.com/file/2023/26/a226861_0s.jpg)
excel 如何设置工作表整体或局部保护?
![](https://img.aspxhome.com/file/2023/1/a156871_0s.jpg)
dms文件怎么打开
![](https://img.aspxhome.com/file/2023/9/a343137_0s.png)
WPS轻松办公_WPS如何轻松打出生僻字
![](https://img.aspxhome.com/file/2023/1/a185251_0s.png)
如何使用手机控制wps演示播放
excel2010怎么样?excel2010界面介绍
![](https://img.aspxhome.com/file/2023/4/a143584_0s.jpg)
WPS技巧_PPT转PDF
![](https://img.aspxhome.com/file/2023/3/a186213_0s.png)
WPS word如何设置表格的指定框线的格式
![](https://img.aspxhome.com/file/2023/9/a185229_0s.png)
如何使用Microsoft Authenticator免密码安全登录
![](https://img.aspxhome.com/file/2023/29/a262180_0s.jpg)
使用U盘如何自己重装Win7系统?u盘重装win7系统图文步骤
![](https://img.aspxhome.com/file/2023/26/a227835_0s.png)