apache与iis是目前最流行,集合较强功能与扩展,拥有较高稳定性的两大服务器软件,但是两者分别支持php和asp程序,
之前研究了在iis6下建立全能主机的方法,,当然目前的iis 通过安装dll扩展能够支持php,但其执行效率没有apache高.
现在再尝试在iis6下安装apache,让两者共同工作.
因为在xp下安装iis,则不能支持多个虚拟主机绑定多个域名,因此,今天我们来探讨apache反向代理iis来支持asp,以及这种情况下的多个虚拟主机绑定域名的方法,以及在iis需要使用rewrite时该如何分别设置apache及iis的rewrite规则。
一、首先安装好apache及iis,设置apache端口80,iis端口81(这里只要别和apache冲突就行了)
二、找到apache的配置文件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
这样你的apache就可以以80端口做代理服务器啦
Include conf/httpd-vhosts.conf
# http://www.PHPnow.org # filename: httpd-vhosts.conf #<Directory ../vhosts> # AllowOverride All # Order allow,deny # Allow from all #</Directory> NameVirtualHost * #<VirtualHost *> # DocumentRoot ../htdocs # ServerName default:80 # ErrorLog logs/default-error_log #</VirtualHost> # #<VirtualHost *:80> # ServerName home.scfujitec.com # ProxyPass / http://10.150.1.13:88/ # ProxyPassReverse / http://10.150.1.13:88/ #</VirtualHost> # # #<VirtualHost *:80> # ServerName erp.scfujitec.com # ProxyPass / http://10.150.1.13:89/ # ProxyPassReverse / http://10.150.1.13:89/ #</VirtualHost> # #<VirtualHost *:80> # ServerName pc.scfujitec.com # ProxyPass / http://10.150.1.13:82/ # ProxyPassReverse / http://10.150.1.13:82/ #</VirtualHost> <VirtualHost *:81> ServerName test.scfujitec.com ProxyPass / http://192.168.253.10/ ProxyPassReverse / http://192.168.253.10/ </VirtualHost> #<VirtualHost *:80> # ServerName bug.scfujitec.com # ProxyPass / http://10.150.1.13:81/ # ProxyPassReverse / http://10.150.1.13:81/ #</VirtualHost> # # # # # #<VirtualHost *> # <Directory "../vhosts/zhidao.scfujitec.com"> # Options -Indexes FollowSymLinks # </Directory> # ServerAdmin admin@zhidao.scfujitec.com # DocumentRoot "../vhosts/zhidao.scfujitec.com" # ServerName zhidao.scfujitec.com:80 ##ServerAlias *.zhidao.scfujitec.com # ErrorLog logs/zhidao.scfujitec.com-error_log # php_admin_value open_basedir "D:\WEB_SERVER\vhosts\zhidao.scfujitec.com;C:\WINDOWS\Temp;" #</VirtualHost> #<VirtualHost *> # <Directory "../vhosts/weibo.scfujitec.com"> # Options -Indexes FollowSymLinks # </Directory> # ServerAdmin admin@weibo.scfujitec.com # DocumentRoot "../vhosts/weibo.scfujitec.com" # ServerName weibo.scfujitec.com:80 ##ServerAlias *.weibo.scfujitec.com # ErrorLog logs/weibo.scfujitec.com-error_log # php_admin_value open_basedir "D:\WEB_SERVER\vhosts\weibo.scfujitec.com;C:\WINDOWS\Temp;" #</VirtualHost> # #<VirtualHost *> # <Directory "../vhosts/plugin.scfujitec.com"> # Options -Indexes FollowSymLinks # </Directory> # ServerAdmin admin@plugin.scfujitec.com # DocumentRoot "../vhosts/plugin.scfujitec.com" # ServerName plugin.scfujitec.com:80 # ServerAlias plugin.scfujitec.com # ErrorLog logs/plugin.scfujitec.com-error_log # php_admin_value open_basedir "D:\WEB_SERVER\vhosts\plugin.scfujitec.com;C:\WINDOWS\Temp;" #</VirtualHost>