首页 | 站长技术 专题 | 下载频道 | 网页模板 | 图片素材 | 虚拟主机 | 项目市场 | 源码市场 | 本站产品 | 广告服务 | 建站论坛
文档首页
建站指南
网站编程
网站设计
图像动画
网络安全
服务器技术
数据库技术
技术专题
技术问答
您的位置:中国建站 > 站长技术 > 服务器技术 > Web服务器 > WIN2003上Apache2+IIS6+Tomcat5之多站点完美配置篇

WIN2003上Apache2+IIS6+Tomcat5之多站点完美配置篇

加入时间:2006-12-13

本来以为上一次的配置就搞定了,结果本地测试好好的,到了服务器上调试就完蛋了,本地只测试了一个asp站和一个jsp站,而实际情况是多个asp站和我的jsp站,又试了两次还是不行,终于在第三次尝试后搞定了,写下来做个纪念。

第一次尝试使用:

<VirtualHost *:80>
   ServerAdmin feifei0658@sina.com
  ServerName www.5hope.com
   DcumentRoot "G:\5hope
   DirectoryIndex index.html index.htm index.asp  
  ProxyPass / http://www.5hope.com:88/
  ProxyPassReverse / www.5hope.com:88/
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin feifei0658@sina.com
  ServerName www.shundabanjia.com  
  DocumentRoot "G:\wuyubing\www"
  DirectoryIndex index.html index.htm index.asp 
  ProxyPass / http://www.shundabanjia.com:88/
  ProxyPassReverse / http://www.shundabanjia.com:88/
</VirtualHost>

本以为这样设置多站点就搞定了,结果发现只识别第一个站点,访问别的站点都是这个站的内容,折腾了一上午,没成功。

第二次尝试使用:

<VirtualHost *:80>
 #添加了这个属性**********
 ProxyPreserveHost On
ServerAdmin feifei0658@sina.com  
  ServerName www.shundabanjia.com  
  DocumentRoot "G:\wuyubing\www"
  DirectoryIndex index.html index.htm index.asp 
  ProxyPass / http://www.shundabanjia.com:88/
  ProxyPassReverse / http://www.shundabanjia.com:88/
</VirtualHost>

LoadModule jk_module modules/mod_jk.so 
JkWorkersFile "D:\tomcat5.0.28\conf\workers.properties"
<VirtualHost *:80>
    ServerAdmin feifei0658@sina.com   
    ServerName www.openria.cn
    DirectoryIndex index.html index.htm index.jsp
    JkMount /* ajp13   
    JkAutoAlias "D:\tomcat-5.0.28\webapps\ria"  
    <Directory "D:\tomcat-5.0.28\webapps\ria">
       Options Indexes FollowSymLinks
       allow from all
    </Directory>
</VirtualHost>

这回经过查官方资料,发现了一个属性,叫ProxyPreserveHost On,试了一下,是可以用实现多个虚拟的asp站点了,但是和我的tomcat站点定义冲突,访问不了jsp站,又不行,只好再找。

第三次尝试使用:

NameVirtualHost *:80

<VirtualHost *:80>
  ProxyPreserveHost On
  ServerAdmin feifei0658@sina.com
  ServerName www.shundabanjia.com  
  DocumentRoot "G:\wuyubing\www"
  DirectoryIndex index.html index.htm index.asp 
  ProxyPass / http://www.shundabanjia.com:88/
  ProxyPassReverse / http://www.shundabanjia.com:88/
</VirtualHost>

LoadModule jk_module modules/mod_jk.so 
JkWorkersFile "D:\tomcat5.0.28\conf\workers.properties"
<VirtualHost *:80>
    ServerAdmin feifei0658@sina.com   
    ServerName www.openria.cn
    DirectoryIndex index.html index.htm index.jsp
    JkMount /* ajp13   
    JkAutoAlias "D:\tomcat-5.0.28\webapps\ria"  
    <Directory "D:\tomcat-5.0.28\webapps\ria">
       Options Indexes FollowSymLinks
       allow from all
    </Directory>
</VirtualHost>

经过反复看文档,这回终于搞定了,原来是没有吧"Use name-based virtual hosting."打开,去掉NameVirtualHost *:80前面的#号就可以了,真是晕啊。

总算成功了,看来有问题还需要看官方资料啊,网友的资料还是不完整啊,通过自己的努力,发现新的线索:

  • ProxyPreserveHost On
  • NameVirtualHost *:80

这也是自己的收获啊,希望这些经历能帮助需要他的人。

上一篇文章:Web站点崩溃的原因总结
下一篇文章:Web Services是何物?
返回上页】 
 

本站在线服务QQ  程序定制:70632246 广告受理/投搞/投诉:7606208 技术客服:3828351
网站简介 广告服务 成功案例 联系方式 办公电话:0580-3825369
Copyright © 2001-2007 JZ173.COM,All rights reserved  浙ICP备05023962号 感谢【中国商务网】提供服务器