1 Reply Latest reply on Jan 18, 2008 2:54 AM by frippe

    Several domains on the same JBoss using Apache as front

    frippe

      Hi,
      I am attempting to set up an environment where I deploy war applications for different domains -one war app / domain.
      I'm using mod_jk to handle the Apache - JBoss connection.

      My problems are the following:

      I can't seem to destinguish the different apps from different domains.
      A servlet filter won't work at all
      Do I really need to set up a JkMount /servletPathXXX* worker1 for each servlet path in the virtual host?


      I am using the following set-up:

      one war file / domain


      web.xml contains
      <filter>
       <filter-name>URLReplacer</filter-name>
       <filter-class>classpath.GenericFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>URLReplacer</filter-name>
       <url-pattern>*.shtml</url-pattern>
       </filter-mapping>
      


      jboss-web.xml contains
      <context-root>/appName</context-root>


      server.xml contains ajp set up and several hosts (1 host / domain)
      
      
       <!-- Define an AJP 1.3 Connector on port 8009-->
       <Connector port="8009" address="127.0.0.1" protocol="AJP/1.3"
       emptySessionPath="true" enableLookups="false" redirectPort="8443" />
      
      .
      .
      .
      
      <Host name="appName" autoDeploy="false" deployOnStartup="false" deployXML="false">
      
       <Valve className="org.apache.catalina.valves.AccessLogValve"
       prefix="things" suffix=".log" pattern="common"
       directory="${jboss.server.home.dir}/log"/>
      
       <DefaultContext cookies="true" crossContext="true" override="true"/>
       </Host>
      
       <Host ....


      workers.properties contains
      # Define 1 real worker using ajp13
      worker.list=worker1
      
      # Set properties for worker1 (ajp13)
      worker.worker1.type=ajp13
      worker.worker1.host=localhost
      worker.worker1.port=8009


      partial server.xml

      <VirtualHost *>
       ServerAdmin admin@domain.se
       DocumentRoot /home/hosts/domain/www
       ErrorLog /var/log/apache2/domain_error.log
       ServerName www.domain.se
      
       # Servlet URIs
       JkMount /servletPath1* worker1
       JkMount /servletPath1* worker1
      
       CustomLog "|/usr/sbin/rotatelogs /var/log/apache2/www.domain.se_access.log.%Y%m%d 8600" combined
      
      
      </VirtualHost>
      
      If you could enlighten me in one of these problems I would become a very happy guy :-)


        • 1. Re: Several domains on the same JBoss using Apache as front
          frippe

          I was able to solve some of the problems:

          I had some old stuff left in an apache config, it was hindering my filter to
          work.

          I had to add an tag in the host config to make it work - I also added a context, pointing out the exact WAR in the host config.

          I'm still not sure about the last thing - is there another way to do this - it seems cumbersome to have the same servlet paths both in Apache's virtual host config as well as in web.xml.