WIN2003上Apache2+IIS6+Tomcat5之多站點(diǎn)完美配置篇
更新時(shí)間:2006年06月22日 00:00:00 作者:
本來(lái)以為上一次的配置就搞定了,結(jié)果本地測(cè)試好好的,到了服務(wù)器上調(diào)試就完蛋了,本地只測(cè)試了一個(gè)asp站和一個(gè)jsp站,而實(shí)際情況是多個(gè)asp站和我的jsp站,又試了兩次還是不行,終于在第三次嘗試后搞定了,寫(xiě)下來(lái)做個(gè)紀(jì)念。
第一次嘗試使用:
<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>
本以為這樣設(shè)置多站點(diǎn)就搞定了,結(jié)果發(fā)現(xiàn)只識(shí)別第一個(gè)站點(diǎn),訪問(wèn)別的站點(diǎn)都是這個(gè)站的內(nèi)容,折騰了一上午,沒(méi)成功。
第二次嘗試使用:
<VirtualHost *:80>
#添加了這個(gè)屬性**********
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>
這回經(jīng)過(guò)查官方資料,發(fā)現(xiàn)了一個(gè)屬性,叫ProxyPreserveHost On,試了一下,是可以用實(shí)現(xiàn)多個(gè)虛擬的asp站點(diǎn)了,但是和我的tomcat站點(diǎn)定義沖突,訪問(wèn)不了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>
經(jīng)過(guò)反復(fù)看文檔,這回終于搞定了,原來(lái)是沒(méi)有吧"Use name-based virtual hosting."打開(kāi),去掉NameVirtualHost *:80前面的#號(hào)就可以了,真是暈啊。
總算成功了,看來(lái)有問(wèn)題還需要看官方資料啊,網(wǎng)友的資料還是不完整啊,通過(guò)自己的努力,發(fā)現(xiàn)新的線索:
ProxyPreserveHost On
NameVirtualHost *:80
這也是自己的收獲啊,希望這些經(jīng)歷能幫助需要他的人。
第一次嘗試使用:
<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>
本以為這樣設(shè)置多站點(diǎn)就搞定了,結(jié)果發(fā)現(xiàn)只識(shí)別第一個(gè)站點(diǎn),訪問(wèn)別的站點(diǎn)都是這個(gè)站的內(nèi)容,折騰了一上午,沒(méi)成功。
第二次嘗試使用:
<VirtualHost *:80>
#添加了這個(gè)屬性**********
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>
這回經(jīng)過(guò)查官方資料,發(fā)現(xiàn)了一個(gè)屬性,叫ProxyPreserveHost On,試了一下,是可以用實(shí)現(xiàn)多個(gè)虛擬的asp站點(diǎn)了,但是和我的tomcat站點(diǎn)定義沖突,訪問(wèn)不了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>
經(jīng)過(guò)反復(fù)看文檔,這回終于搞定了,原來(lái)是沒(méi)有吧"Use name-based virtual hosting."打開(kāi),去掉NameVirtualHost *:80前面的#號(hào)就可以了,真是暈啊。
總算成功了,看來(lái)有問(wèn)題還需要看官方資料啊,網(wǎng)友的資料還是不完整啊,通過(guò)自己的努力,發(fā)現(xiàn)新的線索:
ProxyPreserveHost On
NameVirtualHost *:80
這也是自己的收獲啊,希望這些經(jīng)歷能幫助需要他的人。
您可能感興趣的文章:
- IIS和tomcat5多站點(diǎn)配置流程
- win2000server IIS和tomcat5多站點(diǎn)配置
- Tomcat 發(fā)布程序使用cmd查看端口占用、相應(yīng)進(jìn)程、殺死進(jìn)程等的命令
- Tomcat日志文件定時(shí)清理備份的腳本
- Tomcat 實(shí)現(xiàn)WebSocket詳細(xì)介紹
- 詳解Ngigx+Tomcat配置動(dòng)靜分離,負(fù)載均衡
- 詳解CentOS安裝tomcat并且部署Java Web項(xiàng)目
- linux下實(shí)時(shí)查看tomcat運(yùn)行日志的方法
- 在同一臺(tái)服務(wù)器上配置多個(gè)Tomcat的方法
- Docker 自動(dòng)部署tomcat詳解
- Shell腳本切割tomcat的日志文件
- Tomcat 多站點(diǎn)配置詳解及實(shí)現(xiàn)方法
相關(guān)文章
WIN2003上Apache2+IIS6+Tomcat5之多站點(diǎn)完美配置篇
WIN2003上Apache2+IIS6+Tomcat5之多站點(diǎn)完美配置篇...2006-06-06

