I am trying to host multiple webapps under tomcat 6 behind apache2 via mod_jk.

I am at my wits end with this. the problem i am facing that both domains seems to point to a single tomcat 'domain'.

my server.xml looks like this:

<Service name="Catalina">
    <Connector port="8080" protocol="HTTP/1.1" 
               redirectPort="8443" />

    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    <Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Catalina" defaultHost="example.com">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

      <Host name="example.com"  appBase="webapps-example"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

      <Host name="example.com"  appBase="webapps-example.com"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

my workers.properties looks like this:




finally my apache vhosts look like this:

    ServerName example.com
    DocumentRoot /srv/www/example.com/public_html/
    ErrorLog /srv/www/example.com/logs/error.log
    CustomLog /srv/www/example.com/logs/access.log combined

    JkMount  /* example


    ServerName example2.com
    DocumentRoot /srv/www/example.com/public_html/
    ErrorLog /srv/www/example.com/logs/error.log
    CustomLog /srv/www/example.com/logs/access.log combined

    JkMount  /* example2

when i log into manager webapp on both example.com and example2.com, i can deploy to a context path on example, and that same contextpath will appear on example2 - so i know for a fact that this is the same tomcat domain.

edit: just found this in my mod_jk log

[Sun Feb 20 21:15:43 2011] [28546:3075521168] [warn] map_uri_to_worker_ext::jk_uri_worker_map.c (962): Uri * is invalid. Uri must start with /
[Sun Feb 20 21:16:44 2011] [28548:3075521168] [info] ajp_send_request::jk_ajp_common.c (1496): (example) all endpoints are disconnected, detected by connect check (1), cping (0), send (0)

but not sure why example wouldnt respond

please help a brother out


i was being an idiot. i ended up shutting down apache and connecting to 8080 on both domains. the problem persisted, so i knew it was not a mod_jk or apache issue.

the problem was that i was accessing both domains as www.domain but i didnt alias those subdomains in tomcat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.