设为首页
收藏本站
最近更新

文章搜索
本类热门

首页 >> 网络编程 >> ASP.NET >> ASP.NET教程 >> 新闻正文 [字体: ] [打印文档]
Win2003完美配置Apache+IIS+Tomcat多站点

文章作者:
责任编辑:rosan 录入时间:2006-12-1 22:50:17 来源:
频道声明:本频道的文章除部分特别声明禁止转载的专稿外,可以自由转载.但请务必注明出出处和原始作者 文章版权归本频道与文章作者所有.对于被频道转载文章的个人和网站,我们表示深深的谢意.

百特科技[http://www.PCbyte.cn]专业的空间、主机提供商,域名注册绝对优惠!

  本来以为上一次的配置就搞定了,结果本地测试好好的,到了服务器上调试就完蛋了,本地只测试了一个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

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

推荐好友 | 频道收藏 | 打印文档 | 报告错误  
相关连接
·ASP.NET入门数据篇[1]
·ASP.NET 2.0发送电子邮件中存在的问题
·ASP.NET2.0与VS2005利器大评析之优点篇
·ASP.NET2.0高级数据处理之使用参数
·Win2003完美配置Apache+IIS+Tomcat多站点
·ASP.NET底层架构探索之IE6的革新
·ASP.NET 配置文件层次结构和继承
·ASP.NET 2.0 Membership原理及应用
同一专题
·无相关专题
发表评论 版权声明:除部分特别声明不要转载,或者授权我站独家播发的文章外,大家可以自由转载我站点的原创文章,但原作者和来自我站的链接必须保留(非我站原创的,按照原来自一节,自行链接)。文章版权归我站和作者共有
转载
要求转载之图片、文件,链接请不要盗链到本站,且不准打上各自站点的水印,亦不能抹去我站点水印。
共有评论查看评论
姓名: