1 2 Previous Next 20 Replies Latest reply on Mar 2, 2016 10:29 AM by jrgahan

    how to integrate apache web server and jboss 7

    aupres

      I'm trying to integrate apache web server to jboss 7.0.1.Final.

       

      First, I made mod_jk.conf , uriworkermap.properties and workers.properties files in <APACHE_HOME>/conf folder. File contents are like below,

       

      mod_jk.conf :

       

      LoadModule jk_module modules/mod_jk.so

      JkWorkersFile conf/workers.properties

      JKLogFile logs/mod_jk.log

      JkLogLevel debug

      JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

      JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories

      JkRequestLogFormat "%w %V %T"

      JkMountFile conf/uriworkermap.properties

      JkShmFile run/jk.shm

       

      uriworkermap.properties :

       

      /jmx-console/*=loadbalancer
      /jmx-console=loadbalancer

      /web-console/*=loadbalancer
      /web-console=loadbalancer

       

      workers.properties :

       

      worker.list=loadbalancer

      worker.node1.host=localhost
      worker.node1.port=8009
      worker.node1.type=ajp13
      worker.node1.lbfactor=1

      worker.loadbalancer.type=lb
      worker.loadbalancer.balance_workers=node1

       

      And I dowloaded tomcat connector mod_jk.so from apache homepage to <APACHE_HOME>/modules folder.

      Also I inserted a line in <APACHE_HOME>/conf/httpd.conf file like this

      ...

      Include conf/mod_jk.conf

      ....

       

      In Jboss 7 I typed a few lines in standalone.xml like below

      ....

      </extensions> 

       

      <system-properties>

         <property name="jvmRoute" value="node1"/>

         <property name="UseJK" value="true"/>

      </system-properties>

      ...

      <connector name="ajp13" protocol="AJP/1.3" socket-binding="ajp"/>

      ...

      <socket-binding name="ajp" port="8009">

      .....

       

      Apache web server and JBoss 7 throw no exception during the execution.But integration is failed.

      I have no idea what is wrong in this configuration. Pls, kindly inform me of your advice. Thanks in advanced.

       

      Best Regards!

        • 1. Re: how to integrate apache web server and jboss 7
          rhusar

          Joseph,

           

          I recommend you try out mod_cluster which heavily simplifies the configuration plus provides multiple advantages over mod_jk plus its bundled in AS7 as well, ceck out the doc: https://docs.jboss.org/author/display/AS7/mod_cluster+in+AS7

           

          Rado

          1 of 1 people found this helpful
          • 2. Re: how to integrate apache web server and jboss 7
            aupres

            Thanks for your reply ,Ragdo I will check integration with mod_cluster.

            And also I want to know how to integerate with 'jvmRoute' and 'UseJK' element as well.

            Pls, kindly inform me. Thanks.

             

            Joseph

            • 3. Re: how to integrate apache web server and jboss 7
              greco

              In a single instance configuration mod_cluster is overkill and too time consuming to configure. The simplicity of mod_jk is that you tell your container which port to listen to for AJP traffic and apache will handle serving the traffic. It's frustrating that a platform as evolved as JBoss still hasn't mastered a simple integration that has been around for close to a decade. Reason's like this make me wonder if leaving Glassfish for JBoss was a good move.

               

              UPDATE: I added the changes to the standalone.xml file as per https://docs.jboss.org/author/display/AS7/AJP+Connectors and everything is working.

              Back to feeling good about JBoss.

              • 4. Re: how to integrate apache web server and jboss 7
                rhusar

                Greco, mod_cluster was designed to simplify configuration by having it autoconfigure. I agree that adding modules to HTTPd can be a little pain, but no less than adding mod_jk (unless its pulled in via GNU/Linux software mgmt tools). Please share your experience if you think different.

                • 5. Re: how to integrate apache web server and jboss 7
                  greco

                  Awesome!

                   

                  I guess I kind of overreacted on the whole thing, not being able to find any solution online until I stumbled onto the doc, should have searched for it in the begining.

                   

                  Radoslav, my point was that mod_cluster was an overkill solution for a single instance install, and that simply adding 2 lines in the standalone configuration was exactly what I was looking for.

                  • 6. Re: how to integrate apache web server and jboss 7
                    aupres

                    Hello again, greco!

                    Would you attach your standalone.xml of jboss 7 on this reply, please? I failed

                     

                    Best regards!

                    • 7. Re: how to integrate apache web server and jboss 7
                      greco

                      Changes made to standalone.xml are in bold.

                       

                       

                              <subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">

                                  <connector name="http" protocol="HTTP/1.1" socket-binding="http" scheme="http"/>

                                  <connector name="ajp" protocol="AJP/1.3" socket-binding="ajp" enabled="true"/>

                                  <virtual-server name="default-host" enable-welcome-root="true">

                                      <alias name="localhost"/>

                                      <alias name="example.com"/>

                                  </virtual-server>

                              </subsystem>

                              <subsystem xmlns="urn:jboss:domain:weld:1.0"/>

                          </profile>

                          <interfaces>

                              <interface name="management">

                                  <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>

                              </interface>

                              <interface name="public">

                                  <inet-address value="${jboss.bind.address:127.0.0.1}"/>

                              </interface>

                          </interfaces>

                          <socket-binding-group name="standard-sockets" default-interface="public">

                              <socket-binding name="ajp" port="8009"/>

                              <socket-binding name="http" port="8080"/>

                              <socket-binding name="https" port="8443"/>

                              <socket-binding name="jmx-connector-registry" port="1090" interface="management"/>

                              <socket-binding name="jmx-connector-server" port="1091" interface="management"/>

                              <socket-binding name="jndi" port="1099"/>

                              <socket-binding name="osgi-http" port="8090" interface="management"/>

                              <socket-binding name="remoting" port="4447"/>

                              <socket-binding name="txn-recovery-environment" port="4712"/>

                              <socket-binding name="txn-status-manager" port="4713"/>

                          </socket-binding-group>

                       

                      • 8. Re: how to integrate apache web server and jboss 7
                        shasho

                        Hello

                         

                        in AS 7.1.1 you need to add "scheme="ajp"

                        the corrent line is

                        <connector name="ajp" protocol="AJP/1.3" socket-binding="ajp" enabled="true" scheme="ajp" />

                         

                        Amir

                        • 9. Re: how to integrate apache web server and jboss 7
                          erasmomarciano

                          I think

                           

                          <connector name="ajp" protocol="AJP/1.3" socket-binding="ajp" enabled="true" scheme="http" />

                           


                           

                          Amir Shay ha scritto:

                           

                          Hello

                           

                          in AS 7.1.1 you need to add "scheme="ajp"

                          the corrent line is

                          <connector name="ajp" protocol="AJP/1.3" socket-binding="ajp" enabled="true" scheme="ajp" />

                           

                          Amir

                           

                          Now it works?

                          • 10. Re: how to integrate apache web server and jboss 7
                            shasho

                            It worked but with some bugs. So I moved to mod_proxy http://www.rosehosting.com/blog/how-to-install-and-configure-jboss-as-with-java-and-apache2-as-a-reverse-proxy/

                            I am still testing the proxy configuration

                            • 11. Re: how to integrate apache web server and jboss 7
                              erasmomarciano

                              Remember

                               

                              You can configure the mod_proxy  of Apache usig three different protocol

                               

                              http

                               

                              https

                               

                              ajp

                              • 12. Re: how to integrate apache web server and jboss 7
                                ouapdouap

                                Hi there,

                                Sorry to bring that up, but did exactly what you did, the exact same configuration, but I can manage to make it work.

                                I'm using Apache 2.2.22 and JBoss 7.1.1-final, under Windows 7 64 bits.

                                 

                                I can't have http://localhost to display JBoss's welcome page, which is displayed using http://localhost:8080.

                                Any help would be appreciated.

                                Sebastien

                                • 13. Re: how to integrate apache web server and jboss 7
                                  aupres

                                  Greco's reply above is correct when you type in standalone.xml of JBoss 7.1.1. In apache web server side your work is the same as that in prevous jboss 5.1 things.

                                  If there is no JBoss welcome page on http://localhost, it is not incorrect. In my case I could not, either.

                                  I coded some JSP file, for example http://localhost:8080/example.jsp. Then I erased port number 8080 http://localhost/example.jsp , I checked the configuration with this url.

                                   

                                  I hope this is helpful.

                                   

                                  Joseph

                                  • 14. Re: how to integrate apache web server and jboss 7
                                    ouapdouap

                                    Maybe I'm wrong, but isn't URI mappings defined into the uriworkermap.properties file supposed to "redirect" these requests to JBoss ?

                                    I have a war deployed in JBoss, which has a "myApplication" context.

                                    I added the following in the uriworkermap.properties file:

                                     

                                    /myApplication/*=loadbalancer

                                    /myApplication=loadbalancer

                                     

                                     

                                    http://localhost:8080/myApplication gives me access to the welcome page of my application while http://localhost/myApplication just gives me a 404.

                                     

                                    Maybe I'm missing something.

                                    1 2 Previous Next