8 Replies Latest reply on May 7, 2017 1:50 PM by kpreeta12

    Remote EJB over Apache HTTPD?


      Hello all,


      is it possible to configure Apache HTTPD and Wildfly 8.2.0.Final in a way that it is possible that remote EJB clients can access EJBs deployed on Wildfly without having direct access to Wildfly but only over Apache HTTPD?


      Thanks in advance

      Michael Hauke

        • 1. Re: Remote EJB over Apache HTTPD?

          Well, I would like to say it is possible, but it is isn't.


          problem is in apache httpd that doesn't properly handle proxy + generic http upgrade.


          they did add http-upgrade support for web sockets in 2.4 http://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html

          but that is limited to only web sockets.


          I would recommend you go with something like nginx WebSocket proxying where their impl is bit more generic.


          Or maybe even try with mod_proxy_wstunnel but last time I tried it wasn't to successful with it.

          • 2. Re: Remote EJB over Apache HTTPD?

            Thanks for your reply, Tomaz. My shop won't run nginx so that's sadly not an option for me. I'll try to experiment with mod_proxy_wstunnel.

            • 3. Re: Remote EJB over Apache HTTPD?

              Does somebody have a hint how to configure Apache HTTPD with mod_proxy_wstunnel?


              With 'proxyPass "/" "ws://localhost:8080"' I can access a normal web application on my Wildfly, but remote EJB access does not work (org.xnio.http.UpgradeFailedException: Invalid response code 200). Looks like my client gets Wildfly's welcome page as response.

              • 4. Re: Remote EJB over Apache HTTPD?

                Another good option, if you can get away with it, is to put WildFly in front of HTTPD instead of behind it.  I haven't measured in many years but I would expect this arrangement to give you much better performance for your Java apps, and better proxy performance than you would have in your current situation (for me, HTTPD would sporadically produce errors on proxied requests under load no matter what I did with its configuration, but that was admittedly long ago).

                • 5. Re: Remote EJB over Apache HTTPD?

                  My shop mandates Java EE servers handling sensitive data not to be directly accessible by clients.

                  • 6. Re: Remote EJB over Apache HTTPD?

                    Good answer! and it works, I already fixed this issue a while ago exactly by patching mod_proxy_wstunnel in order to catch the "jboss-remoting" headers.


                    Here is the much needed patch: http://pastebin.com/45LDGGLt



                    Good luck!

                    • 7. Re: Remote EJB over Apache HTTPD?

                      Just wanted to post an update that in WildFly 11, we will start supporting "normal" HTTP-based EJB invocation again which will work more easily with traditional reverse proxies and load balancers.

                      • 8. Re: Remote EJB over Apache HTTPD?



                        I could not even compile the .c file that you have pasted. gcc -c mod_proxy_wstunnel.c giving many errors. Do you have a .so file that is created for mod_proxy_wstunnel.c that has the patch ?


                        I finally managed to get it all working with nginx as load balancer for Wildfly JMS cluster. The http-remoting:// is working fine now.