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

    virtual hosting with JBoss 3.0 and Tomcat 4.0.2 (Catalina)

    peter_marklund

      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!

        • 1. Re: virtual hosting with JBoss 3.0 and Tomcat 4.0.2 (Catalin
          bpowell

          yeh, not supported.
          there is a patch on sourceforge, or alternatively save yourself a lot of trouble and use jetty, and configure your v host in web-jetty.xml.
          see the api for registerHost().

          • 2. Re: virtual hosting with JBoss 3.0 and Tomcat 4.0.2 (Catalin
            erik777

            Has this patch been integrated with the main source? If so, as of what version?

            I really don't want to switch to Jetty as I have a fully working application running (OpenStandards.net) with Tomcat. I simply need backward compatibility, or at least a way to use Tomcat's full functionality. I don't think JBoss should be stripping functionality from Tomcat.

            In this case, if I run Tomcat standalone, it reads Server.xml and everything works great, except I can't access my EJBs, of course.