2 Replies Latest reply on Feb 13, 2014 10:47 AM by spolti

    accessing jboss servers with two instances in one machine unable to access by different domain names

    rajeshk378

      we are  using Jboss EAP 6.0 ,created two jboss server having same application.For both jboss server context path is /foo and we are also using ROOT.war file to redirect to /foo/ab.

       

      Our requirement is, if user type abc.com it should redirect to localhost:8080 and if it  is xyz.com  then it should redirect to localhost:8084.

       

      Both domain names are hitting to same public IP as the jboss servers with two instances are in one machine.

       

      We used following code to configure apache 2.0 but it always hitting only one instance . So please suggest me to solve this issue .

       

          

          <VirtualHost *:80>

                      ServerName  www.xyz.com

                       ServerAlias  xyz.com

                      ProxyPass  /  ajp://localhost:8010/   

                      ProxyPassReverse /app2 http://xyz.com/

                      RewriteEngine On   

                      RewriteRule ^/$ /app2/ [R]

                      ErrorLog logs/xyz-error_log

                      CustomLog logs/xyz-access_log combined

                       JkMount /foo/* foo

      </VirtualHost>




      <VirtualHost *:80>

                     ServerName www.abc.com

                     ServerAlias   abc.com

                     ProxyPass / ajp://localhost:8009/   

                      ProxyPassReverse /foo http://abc.com/foo

                    RewriteEngine On   

                    RewriteRule ^/$ /app/ [R]

                     ErrorLog logs/abc-error_log

                     CustomLog logs/abc access_log combined

                     JkMount /foo/* foo

      </VirtualHost>

        • 1. Re: accessing jboss servers with two instances in one machine unable to access by different domain names
          kuldeep11

          Enable Debugging for apache and then please share logs.

          • 2. Re: accessing jboss servers with two instances in one machine unable to access by different domain names
            spolti

            You ProxyPass ts wrong, try this conf:


            And, i don't know why you are using Rewrite Rule, remove this.....

             

            <VirtualHost *:80>
                            ServerName  www.xyz.com
                            ServerAlias  xyz.com
                            ProxyPass  /  ajp://localhost:8010/app2   
                            ProxyPassReverse / ajp://localhost:8010/app2
                            ErrorLog logs/xyz-error_log
                            CustomLog logs/xyz-access_log combined
                            JkMount /foo/* foo #this are correct?
            </VirtualHost>

             

            <VirtualHost *:80>
                           ServerName www.abc.com
                           ServerAlias   abc.com
                           ProxyPass / ajp://localhost:8009/foo
                           ProxyPassReverse / ajp://localhost:8009/foo
                           ErrorLog logs/abc-error_log
                           CustomLog logs/abc access_log combined
                           JkMount /foo/* foo #this are correct?
            </VirtualHost>

             

            PS: I prefer use http instead ajp, i already had preformance issues when using ajp protocol.

            In this case the context root is "/", you can now access your app through domain abc and xyz.

            Your domains must resolve the apache ip address to work.

             

            Rgz