|
登录后查才能浏览下载更多咨询,有问题联系QQ:3283999
您需要 登录 才可以下载或查看,没有账号?入住遨海湾
×
为调试程序,本机安装iis与apache,无法同时使用80端口,现给出解决方法:
" G3 |* q8 R2 t2 J9 s% u6 p方法一: 4 D; r+ u/ M0 i5 i( Q, `
IIS5,多IP下共存,IIS为192.168.0.1,apache为192.168.0.2 原文地址 % s( ]2 J$ V) h E: P6 M( a
http://www.ad0.cn/netfetch/images/code.gif 程序代码
( D0 u$ m- R6 K5 r- a: G7 yc:\Inetpub\Adminscripts cscript adsutil.vbs set w3svc/disablesocketpooling true/ A) J- {& x' z) A
% ]# U7 H# X) L; _, {
5 T$ @) [- Z- R- u5 `) ^. u5 S9 S$ }# v# E5 V
该命令反馈如下disablesocketpooling : (BOOLEAN) True
0 w4 l# K* k$ [0 y( q- W0 H! J" S4 G# h
! u% G1 P! ~# c, k3 e* B重启IIS ) |. e* i1 S1 N
- G$ K1 |' o5 z( R
http://www.ad0.cn/netfetch/images/code.gif 程序代码( K! Z0 S& I# R# m! m
Inetpub\AdminScripts>cscript adsutil.vbs set w3svc/disablesocketpooling true 6 C( V& {+ G$ y6 K" I
1 a; u, Q' l2 |- U* h; ]
+ o3 v# @" ~5 I V2 [" V4 q: P5 O/ W, R/ A6 f
由于 DisableSocketPooling 在 IIS 6.0 元数据库架构 (MBSchema.xml) 中被定义为有效属性,所以,您仍然可以使用 Adsutil.vbs 设置该属性,但这种设置不起作用。IIS 6.0 中的功能是新增的核心级别驱动程序 HTTP.sys 的一部分。要配置 HTTP.sys,您必须使用 Httpcfg.exe [nfScript]google_ad_client = "pub-4475724770859924";google_alternate_color = "FFBBE8";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel ="9379930647";google_color_border = "F0F0F0";google_color_bg = "FFFFFF";google_color_link = "FF6FCF";google_color_url = "38B63C";google_color_text = "B3B3B3";[/nfScript]& o7 U& E4 c- ^) ~
[nfScript=http://pagead2.googlesyndication.com/pagead/show_ads.js][/nfScript]
0 M5 m4 M8 v$ n4 w/ E6 r1 z# V: K& l
$ f7 M7 B# A/ H% b0 g$ M7 F方法二:
$ v M8 @0 _8 k. I7 s+ H IIS6,多IP下共存,IIS为192.168.0.1,apache为192.168.0.2 原文地址
- G1 }; y0 r$ m+ R) @, @0 R& @4 J5 M' Z# |9 Z& r6 w
到2003的CD下的 support/tools/Support.cab。解压出httpcfg.exe文件,COPY到windows/system32/目录下,用法自己看帮助 p& x5 T7 H$ F% H
, d. y0 Q' U {4 V1 v
命令行 绑定到某IP: httpcfg set iplisten -i 192.168.0.1 即命令使用IIS的只监听指定的IP及端口 查看绑定: httpcfg query iplisten 删除绑定: httpcfg delete iplisten -i 192.168.0.1 6 g) Y6 M) h1 W8 G; t! K
; {' ` ^& {# c8 c: z9 n( a3 W
命令行 http://www.ad0.cn/netfetch/images/code.gif 程序代码3 d, S5 P+ C; m/ Z
net stop Apache2 net stop iisadmin /y net START Apache2 net START w3svc
& V. X" k/ [$ B5 Y Q( |4 d- x \, |3 o, U9 P3 N
/ ~2 S. ^& \( p1 ]. i8 s
6 @( q" @' ^* Q$ y& X6 f5 \
保证iis下的ip设置为全局默认,Apache中httpconf设置listen 192.168.0.2:80,就应该可以两个服务同时运行,相互不冲突了。
+ [1 z, F, G0 c0 S' l7 b
' K6 E3 Y. p% s' a8 NIIS的访问地址为http://192.168.0.1,Apache访问地址为http://192.168.0.2
2 k, Z2 f/ }, L# s" C) A6 I" h5 I5 v4 W1 s! g' X) O4 E
方法三:
5 o6 r. T8 Q9 D" D. z 网上常用的单IP共用80端口方法,不过不推荐,只是使用Apache的代理,速度有影响将apache设为使用80端口,IIS使用其它端口,比如81,然后将apache作为IIS的代理。 5 G0 F: B- ^: }# h$ ^9 p2 r
: f3 x- f A" ~4 b; o H" E
在httpd.conf里面,取消下面四行的注释: 7 | |9 y' g$ `, |2 I0 d& L, ^
http://www.ad0.cn/netfetch/images/code.gif 程序代码
5 V. o, J( B( TLoadModule 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
5 f* `8 s$ d8 r3 n5 L! E/ [% L/ y
. _, l$ E2 K# c
: L7 n3 Q( x! g! V8 X然后建立一个虚拟主机,将该域名的所有访问转向81端口。
. w* G i* s% X8 _5 Z4 V- I% `http://www.ad0.cn/netfetch/images/code.gif 程序代码- T/ Q# z8 ^) {$ ~
ServerName www.ad0.cn ProxyPass / http://localhost:81/ ProxyPassReverse / http://localhost:81/5 }- R+ Q! G$ f- m% e& F
: h7 v* `$ ^2 a' ^3 ]+ e; a& [3 N, V* H/ B
6 Z6 C6 \7 G! P5 _这样,对外就可以只需要一个端口,即可同时使用apache和IIS的功能了 [nfScript]google_ad_client = "pub-4475724770859924";google_alternate_color = "FFBBE8";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel ="9379930647";google_color_border = "F0F0F0";google_color_bg = "FFFFFF";google_color_link = "FF6FCF";google_color_url = "38B63C";google_color_text = "B3B3B3";[/nfScript]
5 q* X, c2 l2 i1 j: V[nfScript=http://pagead2.googlesyndication.com/pagead/show_ads.js][/nfScript]. `& l4 v9 L( H( I& D1 h& B
% l3 h1 o# d- t4 P6 k. ^ 类推,使用第二种方法,你可以在IIS上配置PHP4,Apache2中配置PHP5,只需要IIS中安装PHP4,把php.ini复制到\ windows目录即可,这个就不用说了吧,Apache2中,只要把PHP5的php.ini放在PHP5安装目录里面就行了 5 M; E+ a* R$ F1 H; r, J0 I$ _
/ {( Y* K8 S/ Z8 u
配置Apache以支持PHP5: `% z. F4 |7 T2 H
http://www.ad0.cn/netfetch/images/code.gif 程序代码8 \, F% s/ l- R1 d
LoadModule php5_module "D:/PHPServer/PHP5/php5apache2.dll" AddType application/x-httpd-php .php DirectoryIndex index.html index.php PHPIniDir "D:/PHPServer/PHP5"' X1 l% i/ V3 y" S0 p" ?9 o
6 C( p* R" `+ x8 Z) A/ u' w
5 g& P4 v1 V$ i* J/ D
3 O: B7 y" j! {% E! H 其中最重要的一条就是 PHPIniDir,用来指明php.ini文件所在位置,即PHP5的安装目录,注意所有目录的应该改为D: /PHPServer/PHP5这种格式,而非D:\PHPServer\PHP5,IIS的访问地址为http://192.168.0.1, Apache访问地址为http://192.168.0.2 |
|