I originally thought that the last configuration was done, but it turned out that the local test was fine, but when it was debugged on the server, it was over. Only one asp station and one jsp station were tested locally, but the actual situation was multiple asp stations and my jsp station. I tried it two more times but it still didn't work. I finally got it after the third try. I wrote it down as a souvenir.
First try using:
<VirtualHost *:80>
ServerAdmin [email protected]
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 [email protected]
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>
I thought that setting up multiple sites in this way would be enough, but I found that only the first site was recognized, and other sites accessed were the content of this site. I spent the whole morning without success.
Second try using:
<VirtualHost *:80>
#Added this attribute************
ProxyPreserveHostOn
ServerAdmin [email protected]
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:tomcat5.0.28confworkers.properties"
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.openria.cn
DirectoryIndex index.html index.htm index.jsp
JkMount /* ajp13
JkAutoAlias "D:tomcat-5.0.28webappsria"
<Directory "D:tomcat-5.0.28webappsria">
Options Indexes FollowSymLinks
allow from all
</Directory>
</VirtualHost>
This time after checking the official information, I found an attribute called ProxyPreserveHost On. I tried it and found that it can be used to implement multiple virtual asp sites. However, it conflicts with my tomcat site definition and cannot access the jsp site. It didn’t work, so I had to look for it again.
Third try using:
NameVirtualHost *:80
<VirtualHost *:80>
ProxyPreserveHostOn
ServerAdmin [email protected]
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:tomcat5.0.28confworkers.properties"
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.openria.cn
DirectoryIndex index.html index.htm index.jsp
JkMount /* ajp13
JkAutoAlias "D:tomcat-5.0.28webappsria"
<Directory "D:tomcat-5.0.28webappsria">
Options Indexes FollowSymLinks
allow from all
</Directory>
</VirtualHost>
After repeatedly reading the document, I finally figured it out this time. It turns out that there is no "Use name-based virtual hosting.", open it, and just remove the # number in front of NameVirtualHost *:80. It's really confusing.
Finally succeeded. It seems that if there is a problem, you need to check the official information. The information of netizens is still incomplete. Through my own efforts, I found new clues:
ProxyPreserveHost On
NameVirtualHost *:80
This is also my own gain. I hope these experiences can help people who need him.
Let’s celebrate again, our website is finally open. Welcome to visit: www.openria.cn