3 Replies Latest reply on Apr 19, 2004 1:04 PM by jlemm

    Isapi and virtual hosts with JBoss/Jetty

    jlemm

      Ok - I'm pulling my hair out with this one ... I'd appreciate any suggestions or help.

      I have IIS running on the frontend (not my decision) with isapi_redirector2.dll (JK2) forwarding to JBoss/Jetty. This works great with 1 application.

      Now I need to add more sites. These are actually assigned another ip address, although I don't believe that is a problem. BTW - I'm testing on an internal net to start with, so don't let the ip addresses throw you.

      www.eq.test assigned to 192.168.0.94
      www.on.test assigned to 192.168.0.94

      Below are my configurations for workers2.properties, my directory structure under default/deploy, my application.xml, my jboss-web.xml, and the virtual directories under the jakarta virtual web in IIS Manager.


      WORKERS2.PROPERTIES:
      [shm:]
      info=Shared memory file. Required for multiprocess servers
      file=D:\jboss-3.2.1\server\default\deploy\jbossweb-jetty.sar\META-INF\jk2.shm
      size=1000000

      [channel.socket:localhost:8009]
      port=8009
      host=127.0.0.1

      # define the worker
      [ajp13:localhost:8009]
      channel=channel.socket:localhost:8009

      [uri:/*.jsp]
      context=/*

      [uri:www.eq.test/*.jsp]
      context=/equity.war
      worker=ajp13:localhost:8009

      [uri:www.on.test/*.jsp]
      worker=ajp13:localhost:8009


      DIRECTORIES UNDER default/deploy pertinent to configuration of sites
      on.ear (contains listener.war)
      equity.war


      APPLICATION.XML

      <web-uri>listener.war</web-uri>
      <context-root>/</context-root>



      JBOSS-WEB.XML
      <jboss-web>
      <virtual-host>www.eq.test</virtual-host>
      <context-root>equity/*</context-root>
      </jboss-web>


      IISMANAGER VIRTUAL DIRECTORIES
      Jakarata (points to the isapi dll)
      equity.war ( local path = D:\jboss-3.2.1\server\default\deploy\equity.war)

        • 1. Re: Isapi and virtual hosts with JBoss/Jetty
          jlemm

          Did I post this in the correct forum?

          • 2. How did you get it to work in the first place?
            mshaikh

            I'm struggling with this one as well. However, I don't even know how to set it up so that IIS 6 could talk to Jboss-Tomcat 3.2.3. Where did you find the binaries and stuff?

            Munzoor
            mshaikh@omeda.com
            (847) 564-8900 x269

            • 3. Re: Isapi and virtual hosts with JBoss/Jetty
              jlemm

              Ok -- I figured this out a while ago & thought that I'd pass it along...
              (Don't you just hate it when people don't do that?)

              PART 1: Setting up the ISAPI. There are several good sites that give you step by step instructions on how to set up the apache jk connector (isapi_redirector2.dll) between IIS and Tomcat. Do a few google searches and you will find them. The trick with IIS6 is to remember to enable the filter in the Web Services Extension tab. IIS6 comes totally locked down.

              PART 2: In the workers2.properties file (seriously simplified example since I redirect everything in this example)

              [uriMap:]
              info=Maps the requests. Options: debug
              debug=1
              
              [shm:]
              info=Shared memory file. Required for multiprocess servers
              file=D:\tmpShare\jk2.shm
              size=1048576
              
              
              # Example socket channel
              [channel.socket:localhost:8009]
              tomcatId=localhost:8009
              
              # define the worker
              [ajp13:localhost:8009]
              channel=channel.socket:localhost:8009
              
              [uri:/*]
              context=/*
              alias=localhost
              
              # define the worker
              [status:status]
              
              # Uri mapping
              [uri:/jkstatus/*]
              worker=status:status



              PART 3: Defining the virtual hosts in jboss-service.xml

              I will be showing only the "Config" tag in this file.


              <attribute name="Config">
               <Server>
               <Service name="JBoss-Tomcat">
               <Engine name="MainEngine" defaultHost="localhost">
               <Logger className="org.jboss.web.tomcat.Log4jLogger"
               verbosityLevel="debug" category="org.jboss.web.localhost.Engine"/>
               <DefaultContext cookies="true" crossContext="true" override="true"/>
              
               <!-- This host is deployed in an ear & I've assigned the root directory to it -->
               <Host name="localhost" appBase="/" autoDeploy="true">
               <Logger className="org.jboss.web.tomcat.Log4jLogger"
               verbosityLevel="debug" category="org.jboss.web.Host=localhost"/>
               <Valve className="org.apache.catalina.valves.AccessLogValve"
               prefix="localhost_access" suffix=".log"
               pattern="common" directory="${jboss.server.home.dir}/log"/>
               </Host>
              
               <!-- This host is deployed as a war -->
               <Host name="www.eq.test" appBase="/equity/" autoDeploy="true">
               <Logger className="org.jboss.web.tomcat.Log4jLogger"
               verbosityLevel="debug" category="org.jboss.web.Host=localhost"/>
               <Valve className="org.apache.catalina.valves.AccessLogValve"
               prefix="localhost_access" suffix=".log"
               pattern="common" directory="${jboss.server.home.dir}/log"/>
               </Host>
              
               <!-- This host is deployed as a war -->
               <Host name="www.on.test" appBase="/eqweb/" autoDeploy="true">
               <Logger className="org.jboss.web.tomcat.Log4jLogger"
               verbosityLevel="debug" category="org.jboss.web.Host=localhost"/>
               <Valve className="org.apache.catalina.valves.AccessLogValve"
               prefix="localhost_access" suffix=".log"
               pattern="common" directory="${jboss.server.home.dir}/log"/>
               </Host>
               </Engine>
              
               <!-- A HTTP/1.1 Connector on port 8080 -->
               <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               address="${jboss.bind.address}" port="8080" minProcessors="5" maxProcessors="100"
               enableLookups="true" acceptCount="10" debug="0"
               connectionTimeout="30000" useURIValidationHack="false"/>
              
               <!-- A AJP 1.3 Connector on port 8009 -->
               <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               address="${jboss.bind.address}" port="8009" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="30000"
               useURIValidationHack="false"
               protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
              
               </Service>
               </Server>
               </attribute>






              PART 4 - Directories

              Under the <JBoss_Home>/server/default/deploy
              1) Host 1 - I drop in the ear file
              2) Host 2 - I created an equity.war directory & dropped in the files under that
              3) Host 3 - I deployed a war file

              PART 5 - jboss-web.xml

              For each host deployed, you must define a joss-web.xml file. In this file, you define the virtual host and context root. The file must be placed in the WEB-INF directory:


              <jboss-web>
               <virtual-host>www.eq.test</virtual-host>
               <context-root>/</context-root>
              </jboss-web>


              Hope this is helpful to someone.
              JoAnn