1

我的服务器中有 apache 和 Tomcat,我使用 mod_proxy 从 Apache 重定向到 Tomcat ... apache 在端口 80 上运行,tomcat 在端口 8080 上运行,这是我的虚拟主机:

<VirtualHost *:80>
   ServerName www.example.ir
   ServerAlias example.ir
   ProxyRequests Off
   ProxyPreserveHost On

   <Proxy *>
      Order deny,allow
      Allow from all
   </Proxy>

   ProxyPass / http://localhost:8080/example
   ProxyPassReverse / http://localhost:8080/example

   <Location "/">
      Order allow,deny
      Allow from all
   </Location>
</VirtualHost>

但问题是当我尝试 www.example.com 时出现以下错误:

HTTP 状态 404 - /exampleexample/

那么我的配置有什么问题?感谢并为我糟糕的英语感到抱歉

4

1 回答 1

0

是否要执行 Tomcat 的示例 webapp?如果是这种情况,请尝试以下配置:

ProxyPass / http://localhost:8080/examples/
ProxyPassReverse / http://localhost:8080/examples/

重新启动 Apache 后,导航到http://yourhost/.

希望这可以帮助。

于 2013-07-13T05:27:10.990 回答