Tomcat7 服务器在我的机器上托管一个网站,我想使用 Apache2 作为代理通过我的浏览器查看它:http://localhost:8080/examples作为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”。
最佳答案
已解决。 问题是路径“/example/”。我必须使用正确的 url:“/example”。 然后,http_vhosts.conf 在端口 80 上有 2 个 vhost,完全没用。
关于apache - 使用 Apache2 作为 Tomcat7 的代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30378214/