【问题标题】:Using Apache2 as proxy toward Tomcat7使用 Apache2 作为 Tomcat7 的代理
【发布时间】:2015-05-21 15:33:11
【问题描述】:

Tomcat7 服务器在我的机器上托管一个网站,我想使用 Apache2 作为代理通过我的浏览器查看它:http://localhost:8080/examples as http://localhost/examples

我已经安装了 Apache2 和 Tomcat7,它们都可以在我的电脑上运行。 我已经加载了 mod_proxy 和 mod_proxy_http 模块

在我的 http_vhosts.conf 文件中,我有:

<VirtualHost *:80>
  ProxyRequests off 
  SSLProxyEngine on
  ProxyPreserveHost on
  ServerName mathost.workstation.org
  ProxyPass /examples http://localhost:8080/examples
  ProxyPassReverse /examples http://localhost:8080/examples
  ProxyRequests Off
</VirtualHost>

在我的 proxy_http.conf 我有:

ProxyRequests Off
ProxyPreserveHost On
<Location "/examples/">
 ProxyPass /examples http://localhost:8080/examples
 ProxyPassReverse /examples http://localhost:8080/examples
 Order deny,allow
 Allow from all
</Location>

它不起作用,apache 日志说“GET /examples/ HTTP/1.1”404 207。

【问题讨论】:

  • error_log 中有任何消息吗?
  • GET /examples HTTP/1.1" 404 206
  • 这看起来像 access_log,而不是 error_log。来自 error_log 的消息包含导致错误的附加描述,它在哪里寻找不存在的文件等。
  • 啊好的。对。对不起。我没有关于错误日志的消息。反正我解决了这个问题。感谢您的帮助。

标签: apache tomcat proxy


【解决方案1】:

解决了。 问题是路径“/example/”。我必须使用正确的网址:“/example”。 然后http_vhosts.conf在80端口有2个vhost,完全没用。

【讨论】:

    猜你喜欢
    • 2013-02-06
    • 2021-04-23
    • 2014-10-26
    • 1970-01-01
    • 2010-12-08
    • 2015-11-26
    • 2014-05-21
    • 2013-10-31
    • 1970-01-01
    相关资源
    最近更新 更多