2 Replies Latest reply on Aug 16, 2002 2:07 PM by Erik Sliman

    virtual hosting with JBoss 3.0 and Tomcat 4.0.2 (Catalina)

    Peter Marklund Newbie

      Hi all!
      I am trying to setup virtual hosting using JBoss 3.0 and Jakarta Tomcat 4.0.2.
      More specifically, what we are trying to achieve is to have a domain, say
      companyportals.com pointing to the web root and have other domains, say company1.com
      and company2.com, pointing to subdirectories thereof (companyportals.com/company1,
      companyportals.com/company2). I tried feeding Tomcat configuration xml
      to the EmbeddedCatalinaServiceSX mbean in the jboss-service.xml config file,
      something along the lines of:


      &catalina.home;
      1974



      <!-- Note : To disable connection timeouts, set connectionTimeout value
      to -1 -->

      <!-- Define an AJP 1.3 Connector on port 8009 -->






























      However, I was not able to affect the server behavior with this approach. When
      browsing throught the source code of org.jboss.web.catalina.EmbeddedCatalinaServiceSX.java and
      org.jboss.web.catalina.ConfigHandler.java I found this method

      /** This method is invoked to import an arbitrary XML configuration tree.
      Subclasses should override this method if they support such a configuration
      capability. This implementation does nothing.
      */
      public void setConfig(Element config)
      {
      this.extendedConfig = config;
      }

      It seems like the Catalina ConfigHandler currently does not support virtual hosting,
      am I wrong? If I am right about this, is there an alternative approach that I
      can use to achieve my objective? Would it be a workable solution to dispatch
      requests based on their domain name in some master servlet or filter?
      Any suggestions on this are most welcome!

      Thanks!