3

I have both Apache and Wildfly installed on a Ubuntu 14.04 system. Now I'd like to make Wildfly (locally http://localhost:8080) accessible from Apache (http://webserver/wildfly). How would I have to do that?

Sofar, I've enabled the two mods: proxy and proxy_http. And I've added at the end of the document /etc/apache2/apache2.conf:

ProxyRequests off
ProxyPass /wildfly/ http://localhost:8080/
ProxyPassReverse /wildfly/ http://localhost:8080/

EDIT:

Now half of it works, but the paths are not transformed right. The path to one of my apps running on Wildfly is:

http://webserver/wildfly/testproj/Index.xhtml

But all links on its page are processed like this:

http://webserver/testproj/Page1.xhtml
http://webserver/testproj/Page2.xhtml
http://webserver/testproj/Page3.xhtml

rather than this:

http://webserver/wildfly/testproj/Page1.xhtml
http://webserver/wildfly/testproj/Page2.xhtml
http://webserver/wildfly/testproj/Page3.xhtml

If I run Wildfly locally, everything works fine. This lets me believe that there must be an error in the Apache Reverse Proxy configuration. Is that right? What must I do to have Apache parse the right addresses / links?

Socrates
  • 241
  • 4
  • 13

1 Answers1

0

I hope that you solved your problem, but in case that there is someone else who my need an answer for this question here is the solution,

For web applications that are deployed outside an EAR file (WAR deployment)

In the web-inf folder

MyApp/src/main/webapp/WEB-INF/

add a jboss-web.xml file with this content where / is the root deployment if you would like to deploy it as a root for your case just change the "/" whit "testproj".

<jboss-web>
      <context-root>/</context-root>
</jboss-web>

EAR file

From the official documentation (please check the reference) you can find that inside the EAR file, the context root is defined in the application.xml file. in the following example the context root of the web-client.war is bank, so the application is set to /bank which mean that the URL will be www.domaine.com/bank

 <module>
    <ejb>bank-ejb.jar</ejb>
</module>
<module>
    <web>
        <web-uri>web-client.war</web-uri>
        <context-root>bank</context-root>
    </web>
</module>

reference : Jboss Doc - Chapter 6. Setting the context root of a web application

Barttttt
  • 123
  • 9