请原谅我对这个话题的无知。我读过、读过、查过、搜过、查过、查过、搜过、查过、搜过、查过、查过、搜过、查过、搜过、查
我正在尝试设置我的httpd.conf以允许一个域,使用两个目录来解析两个不同的tomcat实例。
www.example.com/first
<VirtualHost "ip address":80>
ServerName example/first
ErrorLog /var/log/httpd/first_error.log
CustomLog /var/log/httpd/first_access.log combined
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
</VirtualHost>
www.example.com/second
<VirtualHost "ip address":80>
ServerName example/second
ErrorLog /var/log/httpd/second_error.log
CustomLog /var/log/httpd/second_access.log combined
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
ProxyPass / ajp://localhost:8010/
ProxyPassReverse / ajp://localhost:8010/
</VirtualHost>
我知道这是错误的,我认为我应该使用<Directory>
,或者我应该在以下文件中指定tomcat实例:
ProxyPass /example1 ajp://localhost:8010/
ProxyPass /example2 ajp://localhost:8009/
请派人帮忙。供应/士气低落。
或者链接到例子..。谢谢你!!
发布于 2014-05-06 22:26:31
解决了。
<VirtualHost "ip address":80>
ServerName example.com
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/access.log combined
ProxyPass /first/ ajp://localhost:8009/first/
ProxyPass /second/ ajp://localhost:8010/second/
</VirtualHost>
发布于 2014-05-06 01:12:39
对于第一个拆分URI代理,我建议您避免使用<Location>
和<Directory>
。目录映射到实际的文件系统目录,而位置映射到URI路径。后者是您想要完成的,但是您实际上并不需要一个容器来完成这个任务。(它只会使配置变得更干净)
使用单个<VirtualHost>
,与ProxyPass /first ajp://localhost:8009
和ProxyPass /second ajp://localhost:8010
一起使用。我可以给你一个完整的配置,但我希望你再努力一点。如果你解决了上面的困惑,你就很接近完成这个任务了。
https://serverfault.com/questions/593282
复制相似问题