8 Replies Latest reply on Mar 23, 2012 6:04 PM by ctomc

    How to using mod_jk, apache in front of JBoss AS 7

    damnh

      Hi,

       

      1.I have deployed my application (myapp.war) to standalone of JBoss AS 7. How do I configure with Apache and mod_jk to run this application on my website with domain www.example.com?

      2. Now this application with context root /myapp-web (for example: http://localhost:8080/myapp-web). How do I change this context root? I mean I want user only enters the URL www.example.com, not www.example.com/myapp-web.

      Thanks

        • 1. Re: How to using mod_jk, apache in front of JBoss AS 7
          ctomc

          Hi,

           

          add ajp connector in you web subsystem (example can be found in standalone-ha.xml)

           

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

           

          and socket binding

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

           

          context-root can be changed by puting jboss-web.xml inside of your WEB-INF/ where you can define context-root-

          if you do not want to define additional virutal host then just set

          configure default-host something like this:

           

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

                     <alias name="localhost"/>

                     <alias name="www.example.com"/>

                 </virtual-server>

           

          if you want your own virtual host then you create it in standalone.xml and refrence it in jboss-web.xml of your applicationo (virutal-host element)

           

          and it should work.

           

          --

          tomaz

          • 2. Re: How to using mod_jk, apache in front of JBoss AS 7
            damnh

            Thanks Tomaz for quick reply.

             

            I have one more question, if I have multiple war in standalone, I will edit file standalone.xml as following:

             

                 <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"/>

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

                            <alias name="localhost"/>

                            <alias name="example.com"/>

                        </virtual-server>

                     

                        <virtual-server name="myapp-host1" default-web-module="myapp1">

                            <alias name="example1.com"/>

                        </virtual-server>

                        <virtual-server name="myapp-host2" default-web-module="myapp2">

                            <alias name="example2.com"/>

                        </virtual-server>

             

                    </subsystem>

             

            Is that right? Thanks.

            • 3. Re: How to using mod_jk, apache in front of JBoss AS 7
              ctomc

              Hi,

               

              that would be also work (i seem to always forget about default-web-module thingy)

              just add the ajp connector next to http-one and you got yourself ajp that you can connect to from apache.

               

               

              --

              tomaz

              • 4. Re: How to using mod_jk, apache in front of JBoss AS 7
                damnh

                Thanks Tomaz

                • 5. Re: How to using mod_jk, apache in front of JBoss AS 7
                  vatsanm

                  If you rename the myapp.war to ROOT.war, then you wil lnot need to specific the app name in the URL (this doesnt need the jboss-web.xml).

                  • 6. Re: How to using mod_jk, apache in front of JBoss AS 7
                    vatsanm

                    I have a question on this with a twist.  I have the ajp working correctly when usign http.  But if I enable the secutity-constraint tag in web.xml and https in the standalone.xml, I am able to get the WSDL off the server, but when I use soapUI to execute a service, soapUI times out.  any idea how I can fix it?

                     

                    https://my.examplehttps://my.example.com:29990/etmservice/service/oas?wsdl.com:29990/etmservice/service/oas?wsdl     <-- gives WSDl back with port proper.

                     

                    ****** WSDL snippet ******

                    - <wsdl:service name="MyService">
                    - <wsdl:port binding="tns:MyServiceSoapBinding" name="OasServicePort">
                    </wsdl:port>
                    </wsdl:service>

                     

                    • 7. Re: How to using mod_jk, apache in front of JBoss AS 7
                      vatsanm

                      I forgot to add tha this was for Web services. and if I use http instead of https, it works perfectly.

                      • 8. Re: How to using mod_jk, apache in front of JBoss AS 7
                        ctomc

                        Hi,

                         

                        webservices handle this a bit different, can you create new post about this so we can have seperate discustion that helps when people later search for problems.

                         

                        --

                        tomaz