Redirection/Port forwarding from Apache to JBoss


Performance and scalability: Redirection/Port forwarding from Apache to JBoss

  1. Hi,

    I wasnt sure in which section to post this query of mine. So, please bear with me if this is a wrong section to post this particular query.

    I have a Non-browser based client which sends XML requests to a servlet residing in a JBoss App server. The JBoss listens on port 80 and the servlet handles the request.

    HTTP authentication that gives a pop up to the client prompting for username and password, was insisted for this application . After reading plethora of information on the internet, I could not successfully implement HTTP authentication in JBoss.

    However, I have achieved this by making use of Apache 2.0.53 HTTP server by modifying the httpd.conf file and the pop-up authnetication is successful.

    Now, I dont have clue as to how I would get the requests redirected to Jboss from Apache. This needs to be done as the servlets are present in JBoss. Apache is listening on port 80 and JBoss should be made to listen on port 8080 by modifying the xml file.

    I dont seem to have any idea about this. Any suggestion in this would be really helpful.

    Thanks in advance.

  2. Doesn't Jboss actually use an embedded Tomcat for listening to HTTP requests? If so, you can use Apache plugin mod_jk to delegate requests from Apache to Tomcat. If its using Jetty, I'm not sure this is supported by Apache, so perhaps you can switch to Tomcat.
  3. I would give jboss another chance for doing http authentication.
    I'll tell you what files you should modify:

    * web.xml: say wich resources should be secured and how

    <display-name>acceso seguro</display-name>

    You should modify this to do http authentication.


    * jboss-web.xml (located in the same directory as web.xml

          <security-domain>java:/jaas/mySecurityDomain</security-domain> </jboss-web>

    * login-config.xml (in your application jboss conf directory)

    <application-policy name="mySecurityDomain">
    <module-option name="dsJndiName">java:/genesisDS</module-option>
    <module-option name="principalsQuery">select password from Usuario where userid=?</module-option>
    <module-option name="rolesQuery">select rolId, 'Roles' from Usuario_Rol where userId=?</module-option>
    <module-option name="hashAlgorithm">SHA</module-option>
    <module-option name="hashEncoding">base64</module-option>
    <module-option name="hashCharset">UTF-8</module-option>

    If you set those files correctly you should get the http login window, managed directly by jboss (tomcat running inside jboss actually).

    Hope you understand my poor english.
    Good luck!