2015-05-21 28 views
0

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

我已经安装了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> 

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

+0

error_log中的任何消息? – umka

+0

GET/examples HTTP/1.1“404 206 – MdC

+0

这看起来像一个access_log,而不是error_log。来自error_log的消息包含一个额外的描述是什么原因导致错误,它在哪里寻找不存在的文件等。 – umka

回答

1

解决。 问题是路径”/ example /“。我不得不使用正确的url:”/ exam PLE”。 然后,http_vhosts.conf在端口80上有2个虚拟主机,绝对无用。