我在Ubuntu 14.04系统上安装了Apache和Wildfly。 现在我想让Apache( http://webserver/wildfly )访问Wildfly(本地http://localhost:8080 )。 我该怎么做呢?
Sofar,我已经启用了两个mod: proxy和proxy_http 。 我在文档/etc/apache2/apache2.conf的最后添加了:
ProxyRequests off ProxyPass /wildfly/ http://localhost:8080/ ProxyPassReverse /wildfly/ http://localhost:8080/
编辑:
现在有一半是有效的,但是path不是正确的。 运行在Wildfly上的一个应用程序的path是:
http://webserver/wildfly/testproj/Index.xhtml
但其网页上的所有链接都是这样处理的:
http://webserver/testproj/Page1.xhtml http://webserver/testproj/Page2.xhtml http://webserver/testproj/Page3.xhtml
而不是这个:
http://webserver/wildfly/testproj/Page1.xhtml http://webserver/wildfly/testproj/Page2.xhtml http://webserver/wildfly/testproj/Page3.xhtml
如果我在本地运行Wild,,一切正常。 这让我相信Apache反向代理configuration中一定有错误。 是对的吗? 我必须做些什么才能让Apacheparsing正确的地址/链接?