您现在的位置:计算机技术学习网 > 技术中心 > WEB编程 > JSP >

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

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 18:25 点击:

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

第一次尝试使用:

<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:wuyubingwww"
  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:wuyubingwww"
  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: omcat(一个很好用的JSP运行平台)5.0.28confworkers.properties"
<VirtualHost *:80>
    ServerAdmin feifei0658@sina.com   
    ServerName www.openria.cn
    DirectoryIndex index.html index.htm index.jsp(SUN企业级应用的首选)
    JkMount /* ajp13   
    JkAutoAlias "D: omcat(一个很好用的JSP运行平台)-5.0.28webappsia"  
    <Directory "D: omcat(一个很好用的JSP运行平台)-5.0.28webappsia">
       Options Indexes FollowSymLinks
       allow from all
    </Directory>
</VirtualHost>

这回经过查官方资料,发现了一个属性,叫ProxyPreserveHost On,试了一下,是可以用实现多个虚拟的asp站点了,但是和我的tomcat(一个很好用的JSP运行平台)站点定义冲突,访问不了jsp(SUN企业级应用的首选)站,又不行,只好再找。

第三次尝试使用:

NameVirtualHost *:80

<VirtualHost *:80>
  ProxyPreserveHost On
  ServerAdmin feifei0658@sina.com
  ServerName www.shundabanjia.com 
  DocumentRoot "G:wuyubingwww"
  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: omcat(一个很好用的JSP运行平台)5.0.28confworkers.properties"
<VirtualHost *:80>
    ServerAdmin feifei0658@sina.com   
    ServerName www.openria.cn
    DirectoryIndex index.html index.htm index.jsp(SUN企业级应用的首选)
    JkMount /* ajp13   
    JkAutoAlias "D: omcat(一个很好用的JSP运行平台)-5.0.28webappsia"  
    <Directory "D: omcat(一个很好用的JSP运行平台)-5.0.28webappsia">
       Options Indexes FollowSymLinks
  &

    相关新闻>>

      发表评论
      请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
      用户名: 验证码:点击我更换图片
      最新评论 更多>>

      推荐热点

      • JSP与Servlet
      • 自己动手写MiniBBS系列(基本篇)之用户登录
      • JSP取当前日期
      • JDBC 入门(一)
      • 打开一个jsp页面默认查询所有数据,调用action
      • 使用JSP标签库验证用户的输入(2)完
      • WIN98/2000下的jsp服务器
      • 自定义JSP标签(tag)浅议
      • Struts学习傻瓜式入门篇
      网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
      Copyright © 2008-2015 计算机技术学习交流网. 版权所有

      豫ICP备11007008号-1