jer*_*luc 7 apache configuration webserver tomcat
以前,我已正确设置Apache HTTP以将端口80上的传入HTTP请求转发到在端口8080上运行的Tomcat实例.但是,现在我处于这样的情况,我需要能够将端口80上的传入请求代理到Tomcat @ 8080或不同的进程@ 9000,具体取决于主机名.下面是我尝试设置Apache配置来处理这种情况的片段:
<VirtualHost *:80>
  ServerName hostname1
  ProxyPreserveHost On
  ProxyPass / http://hostname1:8080/
  ProxyPassReverse / http://hostname1:8080/
</VirtualHost>
<VirtualHost *:80>
  ServerName hostname2
  ProxyPreserveHost On
  ProxyPass / http://hostname2:9000/
  ProxyPassReverse / http://hostname2:9000/
</VirtualHost>
现在,当从hostname1或hostname2请求时,由于mod_proxy没有找到任何匹配规则来代理请求,我得到一个瞬间500:
[Fri Feb 08 06:41:01 2013] [warn] proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
请注意,Tomcat未接收传入请求,因此没有日志输出
对于理智的缘故,我检查,我确实可以单独在各自的港口访问这两种资源,即我可以访问主机名1使用主机名1:8080,主机名2 9000:使用主机名2.
这里有什么东西可以帮助我正确配置吗?
另外,有没有更好的方法来管理这个可能更合理的方式?
感谢您的任何帮助!
答案似乎是有关单独模块(即 mod_proxy_http)的错误配置。我得到以下 serverfault 答案对我有帮助,正如 Apache HTTP 错误日志中的“代理:没有协议处理程序对 URL 有效”消息所提示的那样:https://serverfault.com/questions/242650/setting-up -a-basic-mod-代理虚拟主机
| 归档时间: | 
 | 
| 查看次数: | 7938 次 | 
| 最近记录: |