You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Wynter <da...@roamware.co.uk> on 2003/08/21 14:55:43 UTC

2 VirtualHosts same IP address and port on Tomcat not working

Hi,.

I have read John Turner HowTo and the Galatea ones too. I have tried
multiple different combinations of these. I found John's assetion that
Tomcat does not generate multi VirtualHosts, but you can take the generated
one, insert at the bottom of the httpd.conf and modify it to work. I know
mod_jk works as I used it with a single host until I need it have to
domains.

I have tried the approach suggested by John but so far all I get is a
directory listing of the resolved directory. I am using Turbine as the
servlet processor, it uses .vm extension not .jsp. Here is my
workers.properties and bottom of my httpd.conf. Can anyone see what is
wrong. The server is up so try the URLs if you want to. I can put  in the
full servlet path eg. www.stpenable.com/se/servlet/se/templates/index.vm and
it works. But it does not resolve from www.stpenable.com as it should.

worker.properties----------------->

# BEGIN workers.properties
worker.list=ajp13, worker1

worker.ajp13.port=8009
# change this line to match apache ServerName and Host name in server.xml
worker.ajp13.host=www.stpenable.com
worker.ajp13.type=ajp13

worker.worker1.port=8009
# change this line to match apache ServerName and Host name in server.xml
worker.worker1.host=www.roamware.co.uk
worker.worker1.type=ajp13
# END workers.properties

excerpt from bottom of http.conf, and yes it does have mod_jk.so
loaded-------------->

NameVirtualHost *

JkWorkersFile "/usr/local/tomcat/conf/jk/workers.properties"
JkLogFile "/usr/local/tomcat/logs/mod_jk.log"

JkLogLevel debug

<VirtualHost *>
    ServerName www.stpenable.com

    #################### www.stpenable.com:/se ####################

    # Static files
    Alias /se "/usr/local/tomcat/webapp2/se"

    <Directory "/usr/local/tomcat/webapp2/se">
        Options Indexes FollowSymLinks
        DirectoryIndex index.html index.htm index.vm
    </Directory>


    # Deny direct access to WEB-INF and META-INF
    #
    <Location "/se/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>

    <Location "/se/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /se/*.shtml  ajp13
    JkMount /se/cgi-bin/*  ajp13
    JkMount /se/servlet/*  ajp13
    JkMount /se/*.vm  ajp13

    #################### www.stpenable.com:/rwtransform ####################

    # Static files
    Alias /rwtransform "/usr/local/tomcat/webapp2/rwtransform"

    <Directory "/usr/local/tomcat/webapp2/rwtransform">
        Options Indexes FollowSymLinks
        DirectoryIndex index.html index.htm index.vm
    </Directory>


    # Deny direct access to WEB-INF and META-INF
    #
    <Location "/rwtransform/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>

    <Location "/rwtransform/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /rwtransform/*.shtml  ajp13
    JkMount /rwtransform/cgi-bin/*  ajp13
    JkMount /rwtransform/servlet/*  ajp13
    JkMount /rwtransform/*.vm  ajp13

</VirtualHost>

<VirtualHost *>
    ServerName www.roamware.co.uk

    #################### www.roamware.co.uk:/rwsite ####################

    # Static files
    Alias /rwsite "/usr/local/tomcat/webapp1/rwsite"

    <Directory "/usr/local/tomcat/webapp1/rwsite">
        Options Indexes FollowSymLinks
        DirectoryIndex index.html index.htm index.vm
    </Directory>


    # Deny direct access to WEB-INF and META-INF
    #
    <Location "/rwsite/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>

    <Location "/rwsite/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /rwsite/servlet/*  worker1
    JkMount /rwsite/*.vm  worker1
</VirtualHost>

David Wynter

roamware Ltd.
(+44) (0) 208 922 7539 B.
(+44) (0) 7879 605 706 M.
www.roamware.co.uk


Re: 2 VirtualHosts working other stuff not

Posted by John Turner <to...@johnturner.com>.
David Wynter wrote:

> 
> So if I have a <Context path=""
> docBase="/usr/local/jakarata-tomcat-4.1.12/webapp2/se" /> DocumentRoot
> should be "/usr/local/jakarata-tomcat-4.1.12/webapp2/se". If this case then
> what about the other webapp in
> "/usr/local/jakarata-tomcat-4.1.12/webapp2/rwtransform" how will I get to
> that?

I wasn't aware that you wanted two separate webapps on the same Virtual 
Host.

I'm honestly not sure how I can be more clear.

My ultimate suggestion for you is to get AWAY from using absolute paths.

My second suggestion for you is get it working with Tomcat first, no 
Apache.  Then worry about Apache.

In your configuration, as I understand it, the DocumentRoot in 
httpd.conf would be equal to your server.xml Host's appBase.

Then, you would access your webapps like:

http://my.host.com/webapp1
http://my.host.com/webapp2

and your homepage would be

http://my.host.com/index.html

John



RE: 2 VirtualHosts working other stuff not

Posted by David Wynter <da...@roamware.co.uk>.
Hi,

I don't quite get what is being instructed here. I have got the first 5
points sorted out but for my Turbine apps rather than the example jsp.

> Sixth: create a VirtualHost in httpd.conf.  Set the DocumentRoot to be
> equal to the Context in server.xml.

So if I have a <Context path=""
docBase="/usr/local/jakarata-tomcat-4.1.12/webapp2/se" /> DocumentRoot
should be "/usr/local/jakarata-tomcat-4.1.12/webapp2/se". If this case then
what about the other webapp in
"/usr/local/jakarata-tomcat-4.1.12/webapp2/rwtransform" how will I get to
that?

Thus, everything you do from that
> point on in your app has to be relative to the webapp root and URLs for
> static and dynamic content will be the same.
>
> Seventh: Setup your JkMount.  If your DocumentRoot is set correctly, and
> your Contexts are set correctly, you should be able to get what you want
> with:
>
> JkMount /*.jsp ajp13
> JkMount /servlet/* ajp13
>
> assuming your servlets are in /servlet.  You might also want to consider
> putting an extension on your servlets, as in Struts, like *.do or
> something.  This makes JkMount even easier.
>
>

Regards

David


Re: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by John Turner <to...@johnturner.com>.
Advice:

Forget about servlets.  Forget about serving all content from a servlet. 
  Too many variables, causing you too much confusion.

Take it one step at a time.

First:  set up Tomcat so that you have 2 virtual hosts.  Each virtual 
host needs a SEPARATE appBase.  If BOTH virtual hosts are to be 
IDENTICAL, then DON'T use a separate Host node for the second one (or a 
separate appBase), instead set up one Host node and use the <Alias> 
directive in server.xml to alias the second hostname to the first.

Second: Create your Contexts.  Root, subdir, whatever, set it up as you 
plan to use them in your URLs.

Third: Create a SIMPLE JSP, like "hello world" or whatever.  Put that in 
the appropriate Context.  Stop Tomcat.  Delete EVERYTHING in the work 
directory (but not the work directory itself).  Start Tomcat.

Fourth:  Verify that http://host1:8080/yourContext1/yourSimple.jsp works 
as expected.

Fifth: Verify that http://host2:8080/yourContext2/yourSimple.jsp works 
as expected.

Then, and only then, worry about Apache.  If you get to this step, then 
you know Tomcat is OK and your problems are Apache related.  Right now 
you are fudging with both ends of the equation, and being wrong in 
either or both can make the whole thing fall apart with zero indication 
of which end is causing the problem.

Sixth: create a VirtualHost in httpd.conf.  Set the DocumentRoot to be 
equal to the Context in server.xml.  Thus, everything you do from that 
point on in your app has to be relative to the webapp root and URLs for 
static and dynamic content will be the same.

Seventh: Setup your JkMount.  If your DocumentRoot is set correctly, and 
your Contexts are set correctly, you should be able to get what you want 
with:

JkMount /*.jsp ajp13
JkMount /servlet/* ajp13

assuming your servlets are in /servlet.  You might also want to consider 
putting an extension on your servlets, as in Struts, like *.do or 
something.  This makes JkMount even easier.

This is only for testing.  Once you have it working, and you want to 
generate everything with a servlet, then change your JkMount to /*.

John

David Wynter wrote:

> Hi,
> 
> I have read dozens of archived posts on virtualhost. I have distilled my
> httpd.conf and server.xml back to what seems to be the recommended approach,
> see below. But now I can see no sites on any URL. I have a suspicous "End
> event threw exception" in the catalina.out log, which suggests a problem
> with server.xml, but reading it I cannot see any illegal XML, so assume it
> is a configuration value error. At the end of the exception it also has
> "...IllegalArguementException: Servlet mapping specifies an unknown servlet
> name rwsite" which suggests it doesn't like my second Host configuration.
> But I copied and pasted it from a posted version that worked and just
> changed the appBase and servername to appropriate values?
> 
> In my error_log I get 2 types of errors:
> 1.  "Directory Index forbidden by rule:
> /usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite" - there is that same
> troublesome rwsite again.
> 2. "File does not exist:
> /usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite/servlet" it's not a file but
> a directory? and I get "File does not exist:
> /usr/local/jakarta-tomcat-4.1.12/webapp2/se/servlet, referer:
> http://www.stpenable.com/se/servlet/se/template/solutions%2Cmdmanage.vm"
> which is real.
> 



Re: 2 VirtualHosts now work, mod_jk not

Posted by Fred Kreek <f....@amc.uva.nl>.

I did not get the mail, but i've got it working with more than 1:
(part of) httpd.conf
--------------------------------------
<VirtualHost my.real.host>
         ServerAdmin webmaster@my.first.virtualhost
         DocumentRoot /home/webmaster/www/v1/webapps
         ServerName my.first.virtualhost
         Port 80
         <LocationMatch "/WEB-INF/">
            AllowOverride None
            deny from all
         </LocationMatch>
         <LocationMatch "/META_INF/">
            AllowOverride None
            deny from all
         </LocationMatch>
         ErrorLog logs/my.first.virtualhost_error
         TransferLog logs/my.first.virtualhost_log
   JkMount /*/servlet/ v1
         JkMount /servlet/* v1
         JkMount /*.jsp v1
</VirtualHost>
<VirtualHost my.real.host>
         ServerAdmin webmaster@my.second.virtualhost
         DocumentRoot /home/webmaster/www/v1/webapps
         ServerName my.second.virtualhost
         Port 80
         <LocationMatch "/WEB-INF/">
            AllowOverride None
            deny from all
         </LocationMatch>
         <LocationMatch "/META_INF/">
            AllowOverride None
            deny from all
         </LocationMatch>
         ErrorLog logs/my.second.virtualhost_error
         TransferLog logs/my.second.virtualhost_log
   JkMount /*/servlet/ v2
         JkMount /servlet/* v2
         JkMount /*.jsp v2
</VirtualHost>
----------------------------------------------
server.xml
---------------------------------------------
<Server port="8010" shutdown="SHUTDOWN" debug="999">
   <Service name="Tomcat-Apache-my.first.virtualhost" debug="999">
     <Connector className="org.apache.ajp.tomcat4.Ajp13Connector" 
port="8011" minProcessors="2" maxProcessors="75" acceptCount="10" debug="0"/>
     <Engine name="v1" debug="999" defaultHost="my.first.virtualhost">
       <Logger className="org.apache.catalina.logger.FileLogger" 
prefix="my.first.virtualhost_log_" suffix=".txt" timestamp="true" debug="999"/>
       <Realm className="org.apache.catalina.realm.MemoryRealm" debug="999"/>
       <Host name="my.first.virtualhost" debug="999" appBase="webapps/v1" 
unpackWARs="false" autoDeploy="true" liveDeploy="true" reloadable="true">
         <Context path="" docBase="ROOT" debug="999" reloadable="true"/>
       </Host>
     </Engine>
   </Service>
   <Service name="Tomcat-Apache-my.second.virtualhost" debug="999">
     <Connector className="org.apache.ajp.tomcat4.Ajp13Connector" 
port="8011" minProcessors="2" maxProcessors="75" acceptCount="10" debug="0"/>
     <Engine name="v1" debug="999" defaultHost="my.second.virtualhost">
       <Logger className="org.apache.catalina.logger.FileLogger" 
prefix="my.second.virtualhost_log_" suffix=".txt" timestamp="true" 
debug="999"/>
       <Realm className="org.apache.catalina.realm.MemoryRealm" debug="999"/>
       <Host name="my.second.virtualhost" debug="999" appBase="webapps/v1" 
unpackWARs="false" autoDeploy="true" liveDeploy="true" reloadable="true">
         <Context path="" docBase="ROOT" debug="999" reloadable="true"/>
       </Host>
     </Engine>
   </Service>
</Server>
------------------------------------
workers.properties
-----------------------------------
worker.list=v1,v2
worker.v1.port=8011
worker.v2.port=8012

worker.v1.host=localhost
worker.v1.host=localhost

worker.v1.type=ajp13
worker.v1.type=ajp13

#standard load balancing
worker.v1.lbfactor=1
worker.v1.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=v1

hope that this is useful,
Fred




"There are 10 types of people when it comes to binary, those that 
understand it.. and those who don't."


RE: 2 VirtualHosts now work, mod_jk not

Posted by David Wynter <da...@roamware.co.uk>.
Hi John,

Thanks very much, all is working now. I now have an index.html in each of
the webapp directories that doe san onload to pick up the full path to the
appropriate Turbine webapp index page. It refers to no particualr port so
the JkMount is working.

One thing I did have a problem with was when I took your suggestion to not
use full paths. I change my docBase in server.xml to be a relative path to
the appBase value in the Host directive rather than the full path I had been
using. I got a "java.lang.IllegalArgumentException: Document base
/rwtransform does not exist" error.

I read up on the allowed docBase values and it says it can be a relative
value to the appBase value, but it did not work, when I put in the full path
it worked.

Regards

David

> -----Original Message-----
> From: John Turner [mailto:tomcat-user@johnturner.com]
> Sent: 26 August 2003 15:24
> To: Tomcat Users List
> Subject: Re: 2 VirtualHosts now work, mod_jk not
>
>
>
> The DocumentRoot is "/".
>
> Host name="myHost" appBase="myHost"
>
> Context path="" docBase="se" ($CATALINA_HOME/myHost/se)
> Context path="/rwtransform" docBase="rwtransform"
> ($CATALINA_HOME/myHost/rwtransform)
>
> DocumentRoot /some/path/to/myHost
>
> Please understand that "DocumentRoot" is for Apache only.  It instructs
> Apache where to find files that ARE NOT covered by your JkMount.
> "DocumentRoot" does nothing for Tomcat.
>
> Thus, put index.html, etc. in $CATALINA_HOME/myHost.
>
> Alternatively, setup a root context:
>
> Context path="" docBase="ROOT" ($CATALINA_HOME/myHost/ROOT)
>
> In that context, setup a welcome-file in web.xml as index.jsp.  In
> index.jsp, do a forward/redirect to myHost/se.
>
> Then your se Context would look like:
>
> Context path="/se" docBase="se" ($CATALINA_HOME/myHost/se)
>
> I really, really, really, really suggest getting all of this to work
> with Tomcat alone first, then worrying about Apache.
>
> John
>
> David Wynter wrote:
>
> > Hi,
> >
> > Thanks for the example. One final thing is puzzling me. I have 2 webapps
> > under my domain so if I use this
> > "DocumentRoot /some/path/to/tomcat/webappname1"
> > How do I then reach the second webappname2? Ideally I want to have
> > www.stpenable.com hit
> www.stpenable.com/se/servlet/se/templates/index.vm and
> > have www.stpenable.com/rwt hit
> > www.stpenable.com/rwtransform/servlet/rwtransform/templates/index.vm
> >
> > i.e. in httpd.conf
> >
> > <VirtualHost *>
> >     ServerName www.stpenable.com
> >
> >     ServerAlias localhost
> >
> >     Alias /se /usr/local/jakarta-tomcat-4.1.12/webapp2/se
> >     DocumentRoot /usr/local/jakarta-tomcat-4.1.12/webapp2/se
> >
> >     <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp2/se">
> >         Options Indexes FollowSymLinks
> >         DirectoryIndex index.vm index.html
> >     </Directory>
> >
> >     <Location "/WEB-INF/*">
> >         AllowOverride None
> >         deny from all
> >     </Location>
> >
> >     <Location "/META-INF/*">
> >         AllowOverride None
> >         deny from all
> >     </Location>
> >
> >     JkMount /* ajp13
> >
> >     Alias /rwtransform
> /usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform
> >
> >     <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform">
> >         Options Indexes FollowSymLinks
> >         DirectoryIndex index.vm index.html
> >     </Directory>
> >
> >     ??????????????
> >
> > </VirtualHost>
> >
> > In my Host section of the server.xml I have 2 Contexts one with path="/"
> > pointing to docBase="/se" and one with path="/rwtransform" and
> > docBase="/rwtransform".
> >
> > With the DocumentRoot pointing at the specific webapp se I
> cannot see how I
> > can have a JkMount that effectively looks like ../rwtransform/*?
> >
> > thanks
> >
> > David
> >
> >
> >>-----Original Message-----
> >>From: John Turner [mailto:tomcat-user@johnturner.com]
> >>Sent: 22 August 2003 18:07
> >>To: Tomcat Users List
> >>Subject: Re: 2 VirtualHosts now work, mod_jk not
> >>
> >>
> >>
> >>I would try setting:
> >>
> >>Alias /webappname /some/path/to/tomcat/webappname
> >>DocumentRoot /some/path/to/tomcat/webappname
> >>
> >>Then:
> >>
> >>JkMount /servlet/* ajp13
> >>
> >>Then your URL of
> >>
> >>http://some.host.com//webappname/servlet/webappname/templates/index.vm
> >>
> >>should work.  Even this should work:
> >>
> >>Alias / /some/path/to/tomcat/webappname
> >>DocumentRoot /some/path/to/tomcat/webappname
> >>JkMount /*.vm ajp13
> >>
> >>The "*" in this case means "/webappname/servlet/webappname/templates".
> >>
> >>I don't know anything about Turbine, so I can't help with specifics.
> >>You might just be better off using Tomcat alone.
> >>
> >>John
> >>
> >>David Wynter wrote:
> >>
> >>
> >>>I have long URLs because I am using the Apache Turbine project
> >>
> >>to develop my
> >>
> >>>webapps. Here is an article on how to shorten them, which gives me the
> >>>impression that i am stuck with these long URLs
> >>>
> >>
> >>http://jakarta.apache.org/turbine/turbine-2.2.1/howto/url-rewritin
> >>g-howto.ht
> >>
> >>>ml unless I follow this method.
> >>>
> >>>This URL is a standard Turbine app URL -
> >>>/webappname/servlet/webappname/templates/index.vm .
> >>>
> >>>It always seemed to me that the /webappname/servlet/webappname
> should be
> >>>replaceable by Aliases, but it is not clear to me how.
> >>>
> >>>The web.xml supplied with Turbine does not have a mapping to
> >>
> >>.vm files. Here
> >>
> >>>it is.
> >>>
> >>><?xml version="1.0" encoding="ISO-8859-1"?>
> >>>
> >>><!DOCTYPE web-app
> >>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
> >>>    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
> >>>
> >>><web-app>
> >>>  <servlet>
> >>>    <servlet-name>se</servlet-name>
> >>>    <servlet-class>org.apache.turbine.Turbine</servlet-class>
> >>>    <init-param>
> >>>      <param-name>applicationRoot</param-name>
> >>>      <param-value>webContext</param-value>
> >>>    </init-param>
> >>>    <init-param>
> >>>      <param-name>properties</param-name>
> >>>
> >><param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
> >>
> >>>    </init-param>
> >>>    <load-on-startup>1</load-on-startup>
> >>>  </servlet>
> >>>  <security-constraint>
> >>>    <web-resource-collection>
> >>>      <web-resource-name>templates</web-resource-name>
> >>>      <url-pattern>/templates/*</url-pattern>
> >>>    </web-resource-collection>
> >>>    <web-resource-collection>
> >>>      <web-resource-name>logs</web-resource-name>
> >>>      <url-pattern>/logs/*</url-pattern>
> >>>    </web-resource-collection>
> >>>    <auth-constraint>
> >>>      <role-name>admin</role-name>
> >>>    </auth-constraint>
> >>>  </security-constraint>
> >>>  <login-config>
> >>>    <auth-method>BASIC</auth-method>
> >>>    <realm-name>Templates</realm-name>
> >>>  </login-config>
> >>></web-app>
> >>>
> >>>What is not clear is how the JkMount works in the context of
> >>
> >>the long URLs
> >>
> >>>for Turbine apps as opposed to the short URLs for the example
> >>
> >>jsp. Why did I
> >>
> >>>use the alias name in my Location and JkMount directives? Because the
> >>>archive is littered with examples doing just that eg.
> >>>http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg98299
> >>>According to this thread the solution was not changing what he
> >>
> >>had in the
> >>
> >>>JkMount so I cannot but help take it as an example, sorry.
> >>>
> >>>Thanks John, you are the only one who is replying to these.
> >>>
> >>>David
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >>>
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


Re: 2 VirtualHosts now work, mod_jk not

Posted by John Turner <to...@johnturner.com>.
The DocumentRoot is "/".

Host name="myHost" appBase="myHost"

Context path="" docBase="se" ($CATALINA_HOME/myHost/se)
Context path="/rwtransform" docBase="rwtransform" 
($CATALINA_HOME/myHost/rwtransform)

DocumentRoot /some/path/to/myHost

Please understand that "DocumentRoot" is for Apache only.  It instructs 
Apache where to find files that ARE NOT covered by your JkMount. 
"DocumentRoot" does nothing for Tomcat.

Thus, put index.html, etc. in $CATALINA_HOME/myHost.

Alternatively, setup a root context:

Context path="" docBase="ROOT" ($CATALINA_HOME/myHost/ROOT)

In that context, setup a welcome-file in web.xml as index.jsp.  In 
index.jsp, do a forward/redirect to myHost/se.

Then your se Context would look like:

Context path="/se" docBase="se" ($CATALINA_HOME/myHost/se)

I really, really, really, really suggest getting all of this to work 
with Tomcat alone first, then worrying about Apache.

John

David Wynter wrote:

> Hi,
> 
> Thanks for the example. One final thing is puzzling me. I have 2 webapps
> under my domain so if I use this
> "DocumentRoot /some/path/to/tomcat/webappname1"
> How do I then reach the second webappname2? Ideally I want to have
> www.stpenable.com hit www.stpenable.com/se/servlet/se/templates/index.vm and
> have www.stpenable.com/rwt hit
> www.stpenable.com/rwtransform/servlet/rwtransform/templates/index.vm
> 
> i.e. in httpd.conf
> 
> <VirtualHost *>
>     ServerName www.stpenable.com
> 
>     ServerAlias localhost
> 
>     Alias /se /usr/local/jakarta-tomcat-4.1.12/webapp2/se
>     DocumentRoot /usr/local/jakarta-tomcat-4.1.12/webapp2/se
> 
>     <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp2/se">
>         Options Indexes FollowSymLinks
>         DirectoryIndex index.vm index.html
>     </Directory>
> 
>     <Location "/WEB-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     <Location "/META-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     JkMount /* ajp13
> 
>     Alias /rwtransform /usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform
> 
>     <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform">
>         Options Indexes FollowSymLinks
>         DirectoryIndex index.vm index.html
>     </Directory>
> 
>     ??????????????
> 
> </VirtualHost>
> 
> In my Host section of the server.xml I have 2 Contexts one with path="/"
> pointing to docBase="/se" and one with path="/rwtransform" and
> docBase="/rwtransform".
> 
> With the DocumentRoot pointing at the specific webapp se I cannot see how I
> can have a JkMount that effectively looks like ../rwtransform/*?
> 
> thanks
> 
> David
> 
> 
>>-----Original Message-----
>>From: John Turner [mailto:tomcat-user@johnturner.com]
>>Sent: 22 August 2003 18:07
>>To: Tomcat Users List
>>Subject: Re: 2 VirtualHosts now work, mod_jk not
>>
>>
>>
>>I would try setting:
>>
>>Alias /webappname /some/path/to/tomcat/webappname
>>DocumentRoot /some/path/to/tomcat/webappname
>>
>>Then:
>>
>>JkMount /servlet/* ajp13
>>
>>Then your URL of
>>
>>http://some.host.com//webappname/servlet/webappname/templates/index.vm
>>
>>should work.  Even this should work:
>>
>>Alias / /some/path/to/tomcat/webappname
>>DocumentRoot /some/path/to/tomcat/webappname
>>JkMount /*.vm ajp13
>>
>>The "*" in this case means "/webappname/servlet/webappname/templates".
>>
>>I don't know anything about Turbine, so I can't help with specifics.
>>You might just be better off using Tomcat alone.
>>
>>John
>>
>>David Wynter wrote:
>>
>>
>>>I have long URLs because I am using the Apache Turbine project
>>
>>to develop my
>>
>>>webapps. Here is an article on how to shorten them, which gives me the
>>>impression that i am stuck with these long URLs
>>>
>>
>>http://jakarta.apache.org/turbine/turbine-2.2.1/howto/url-rewritin
>>g-howto.ht
>>
>>>ml unless I follow this method.
>>>
>>>This URL is a standard Turbine app URL -
>>>/webappname/servlet/webappname/templates/index.vm .
>>>
>>>It always seemed to me that the /webappname/servlet/webappname should be
>>>replaceable by Aliases, but it is not clear to me how.
>>>
>>>The web.xml supplied with Turbine does not have a mapping to
>>
>>.vm files. Here
>>
>>>it is.
>>>
>>><?xml version="1.0" encoding="ISO-8859-1"?>
>>>
>>><!DOCTYPE web-app
>>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>>>    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
>>>
>>><web-app>
>>>  <servlet>
>>>    <servlet-name>se</servlet-name>
>>>    <servlet-class>org.apache.turbine.Turbine</servlet-class>
>>>    <init-param>
>>>      <param-name>applicationRoot</param-name>
>>>      <param-value>webContext</param-value>
>>>    </init-param>
>>>    <init-param>
>>>      <param-name>properties</param-name>
>>>
>><param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
>>
>>>    </init-param>
>>>    <load-on-startup>1</load-on-startup>
>>>  </servlet>
>>>  <security-constraint>
>>>    <web-resource-collection>
>>>      <web-resource-name>templates</web-resource-name>
>>>      <url-pattern>/templates/*</url-pattern>
>>>    </web-resource-collection>
>>>    <web-resource-collection>
>>>      <web-resource-name>logs</web-resource-name>
>>>      <url-pattern>/logs/*</url-pattern>
>>>    </web-resource-collection>
>>>    <auth-constraint>
>>>      <role-name>admin</role-name>
>>>    </auth-constraint>
>>>  </security-constraint>
>>>  <login-config>
>>>    <auth-method>BASIC</auth-method>
>>>    <realm-name>Templates</realm-name>
>>>  </login-config>
>>></web-app>
>>>
>>>What is not clear is how the JkMount works in the context of
>>
>>the long URLs
>>
>>>for Turbine apps as opposed to the short URLs for the example
>>
>>jsp. Why did I
>>
>>>use the alias name in my Location and JkMount directives? Because the
>>>archive is littered with examples doing just that eg.
>>>http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg98299
>>>According to this thread the solution was not changing what he
>>
>>had in the
>>
>>>JkMount so I cannot but help take it as an example, sorry.
>>>
>>>Thanks John, you are the only one who is replying to these.
>>>
>>>David
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 



RE: 2 VirtualHosts now work, mod_jk not

Posted by David Wynter <da...@roamware.co.uk>.
I just found your reply to this question (preempting it) amongst all the
Compuserve emails. I have the Tomcat applications working fine, it is just
the httpd.conf I am having problems with. I thought of another way of
addressing the second webapp on the stpenable domain name, setup a separate
sub domain and have a virtualhost just for that so, webapp2.stpenable.com
is handled by a separate VirtualHost.

Thanks

David

> -----Original Message-----
> From: David Wynter [mailto:david@roamware.co.uk]
> Sent: 26 August 2003 15:13
> To: Tomcat Users List
> Subject: RE: 2 VirtualHosts now work, mod_jk not
>
>
> Hi,
>
> Thanks for the example. One final thing is puzzling me. I have 2 webapps
> under my domain so if I use this
> "DocumentRoot /some/path/to/tomcat/webappname1"
> How do I then reach the second webappname2? Ideally I want to have
> www.stpenable.com hit
> www.stpenable.com/se/servlet/se/templates/index.vm and
> have www.stpenable.com/rwt hit
> www.stpenable.com/rwtransform/servlet/rwtransform/templates/index.vm
>
> i.e. in httpd.conf
>
> <VirtualHost *>
>     ServerName www.stpenable.com
>
>     ServerAlias localhost
>
>     Alias /se /usr/local/jakarta-tomcat-4.1.12/webapp2/se
>     DocumentRoot /usr/local/jakarta-tomcat-4.1.12/webapp2/se
>
>     <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp2/se">
>         Options Indexes FollowSymLinks
>         DirectoryIndex index.vm index.html
>     </Directory>
>
>     <Location "/WEB-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
>
>     <Location "/META-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
>
>     JkMount /* ajp13
>
>     Alias /rwtransform
> /usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform
>
>     <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform">
>         Options Indexes FollowSymLinks
>         DirectoryIndex index.vm index.html
>     </Directory>
>
>     ??????????????
>
> </VirtualHost>
>
> In my Host section of the server.xml I have 2 Contexts one with path="/"
> pointing to docBase="/se" and one with path="/rwtransform" and
> docBase="/rwtransform".
>
> With the DocumentRoot pointing at the specific webapp se I cannot
> see how I
> can have a JkMount that effectively looks like ../rwtransform/*?
>
> thanks
>
> David
>
> > -----Original Message-----
> > From: John Turner [mailto:tomcat-user@johnturner.com]
> > Sent: 22 August 2003 18:07
> > To: Tomcat Users List
> > Subject: Re: 2 VirtualHosts now work, mod_jk not
> >
> >
> >
> > I would try setting:
> >
> > Alias /webappname /some/path/to/tomcat/webappname
> > DocumentRoot /some/path/to/tomcat/webappname
> >
> > Then:
> >
> > JkMount /servlet/* ajp13
> >
> > Then your URL of
> >
> > http://some.host.com//webappname/servlet/webappname/templates/index.vm
> >
> > should work.  Even this should work:
> >
> > Alias / /some/path/to/tomcat/webappname
> > DocumentRoot /some/path/to/tomcat/webappname
> > JkMount /*.vm ajp13
> >
> > The "*" in this case means "/webappname/servlet/webappname/templates".
> >
> > I don't know anything about Turbine, so I can't help with specifics.
> > You might just be better off using Tomcat alone.
> >
> > John
> >
> > David Wynter wrote:
> >
> > > I have long URLs because I am using the Apache Turbine project
> > to develop my
> > > webapps. Here is an article on how to shorten them, which gives me the
> > > impression that i am stuck with these long URLs
> > >
> > http://jakarta.apache.org/turbine/turbine-2.2.1/howto/url-rewritin
> > g-howto.ht
> > > ml unless I follow this method.
> > >
> > > This URL is a standard Turbine app URL -
> > > /webappname/servlet/webappname/templates/index.vm .
> > >
> > > It always seemed to me that the
> /webappname/servlet/webappname should be
> > > replaceable by Aliases, but it is not clear to me how.
> > >
> > > The web.xml supplied with Turbine does not have a mapping to
> > .vm files. Here
> > > it is.
> > >
> > > <?xml version="1.0" encoding="ISO-8859-1"?>
> > >
> > > <!DOCTYPE web-app
> > >     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
> > >     "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
> > >
> > > <web-app>
> > >   <servlet>
> > >     <servlet-name>se</servlet-name>
> > >     <servlet-class>org.apache.turbine.Turbine</servlet-class>
> > >     <init-param>
> > >       <param-name>applicationRoot</param-name>
> > >       <param-value>webContext</param-value>
> > >     </init-param>
> > >     <init-param>
> > >       <param-name>properties</param-name>
> > >
> > <param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
> > >     </init-param>
> > >     <load-on-startup>1</load-on-startup>
> > >   </servlet>
> > >   <security-constraint>
> > >     <web-resource-collection>
> > >       <web-resource-name>templates</web-resource-name>
> > >       <url-pattern>/templates/*</url-pattern>
> > >     </web-resource-collection>
> > >     <web-resource-collection>
> > >       <web-resource-name>logs</web-resource-name>
> > >       <url-pattern>/logs/*</url-pattern>
> > >     </web-resource-collection>
> > >     <auth-constraint>
> > >       <role-name>admin</role-name>
> > >     </auth-constraint>
> > >   </security-constraint>
> > >   <login-config>
> > >     <auth-method>BASIC</auth-method>
> > >     <realm-name>Templates</realm-name>
> > >   </login-config>
> > > </web-app>
> > >
> > > What is not clear is how the JkMount works in the context of
> > the long URLs
> > > for Turbine apps as opposed to the short URLs for the example
> > jsp. Why did I
> > > use the alias name in my Location and JkMount directives? Because the
> > > archive is littered with examples doing just that eg.
> > > http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg98299
> > > According to this thread the solution was not changing what he
> > had in the
> > > JkMount so I cannot but help take it as an example, sorry.
> > >
> > > Thanks John, you are the only one who is replying to these.
> > >
> > > David
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


RE: 2 VirtualHosts now work, mod_jk not

Posted by David Wynter <da...@roamware.co.uk>.
Hi,

Thanks for the example. One final thing is puzzling me. I have 2 webapps
under my domain so if I use this
"DocumentRoot /some/path/to/tomcat/webappname1"
How do I then reach the second webappname2? Ideally I want to have
www.stpenable.com hit www.stpenable.com/se/servlet/se/templates/index.vm and
have www.stpenable.com/rwt hit
www.stpenable.com/rwtransform/servlet/rwtransform/templates/index.vm

i.e. in httpd.conf

<VirtualHost *>
    ServerName www.stpenable.com

    ServerAlias localhost

    Alias /se /usr/local/jakarta-tomcat-4.1.12/webapp2/se
    DocumentRoot /usr/local/jakarta-tomcat-4.1.12/webapp2/se

    <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp2/se">
        Options Indexes FollowSymLinks
        DirectoryIndex index.vm index.html
    </Directory>

    <Location "/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>

    <Location "/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /* ajp13

    Alias /rwtransform /usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform

    <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform">
        Options Indexes FollowSymLinks
        DirectoryIndex index.vm index.html
    </Directory>

    ??????????????

</VirtualHost>

In my Host section of the server.xml I have 2 Contexts one with path="/"
pointing to docBase="/se" and one with path="/rwtransform" and
docBase="/rwtransform".

With the DocumentRoot pointing at the specific webapp se I cannot see how I
can have a JkMount that effectively looks like ../rwtransform/*?

thanks

David

> -----Original Message-----
> From: John Turner [mailto:tomcat-user@johnturner.com]
> Sent: 22 August 2003 18:07
> To: Tomcat Users List
> Subject: Re: 2 VirtualHosts now work, mod_jk not
>
>
>
> I would try setting:
>
> Alias /webappname /some/path/to/tomcat/webappname
> DocumentRoot /some/path/to/tomcat/webappname
>
> Then:
>
> JkMount /servlet/* ajp13
>
> Then your URL of
>
> http://some.host.com//webappname/servlet/webappname/templates/index.vm
>
> should work.  Even this should work:
>
> Alias / /some/path/to/tomcat/webappname
> DocumentRoot /some/path/to/tomcat/webappname
> JkMount /*.vm ajp13
>
> The "*" in this case means "/webappname/servlet/webappname/templates".
>
> I don't know anything about Turbine, so I can't help with specifics.
> You might just be better off using Tomcat alone.
>
> John
>
> David Wynter wrote:
>
> > I have long URLs because I am using the Apache Turbine project
> to develop my
> > webapps. Here is an article on how to shorten them, which gives me the
> > impression that i am stuck with these long URLs
> >
> http://jakarta.apache.org/turbine/turbine-2.2.1/howto/url-rewritin
> g-howto.ht
> > ml unless I follow this method.
> >
> > This URL is a standard Turbine app URL -
> > /webappname/servlet/webappname/templates/index.vm .
> >
> > It always seemed to me that the /webappname/servlet/webappname should be
> > replaceable by Aliases, but it is not clear to me how.
> >
> > The web.xml supplied with Turbine does not have a mapping to
> .vm files. Here
> > it is.
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > <!DOCTYPE web-app
> >     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
> >     "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
> >
> > <web-app>
> >   <servlet>
> >     <servlet-name>se</servlet-name>
> >     <servlet-class>org.apache.turbine.Turbine</servlet-class>
> >     <init-param>
> >       <param-name>applicationRoot</param-name>
> >       <param-value>webContext</param-value>
> >     </init-param>
> >     <init-param>
> >       <param-name>properties</param-name>
> >
> <param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
> >     </init-param>
> >     <load-on-startup>1</load-on-startup>
> >   </servlet>
> >   <security-constraint>
> >     <web-resource-collection>
> >       <web-resource-name>templates</web-resource-name>
> >       <url-pattern>/templates/*</url-pattern>
> >     </web-resource-collection>
> >     <web-resource-collection>
> >       <web-resource-name>logs</web-resource-name>
> >       <url-pattern>/logs/*</url-pattern>
> >     </web-resource-collection>
> >     <auth-constraint>
> >       <role-name>admin</role-name>
> >     </auth-constraint>
> >   </security-constraint>
> >   <login-config>
> >     <auth-method>BASIC</auth-method>
> >     <realm-name>Templates</realm-name>
> >   </login-config>
> > </web-app>
> >
> > What is not clear is how the JkMount works in the context of
> the long URLs
> > for Turbine apps as opposed to the short URLs for the example
> jsp. Why did I
> > use the alias name in my Location and JkMount directives? Because the
> > archive is littered with examples doing just that eg.
> > http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg98299
> > According to this thread the solution was not changing what he
> had in the
> > JkMount so I cannot but help take it as an example, sorry.
> >
> > Thanks John, you are the only one who is replying to these.
> >
> > David
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


Re: 2 VirtualHosts now work, mod_jk not

Posted by John Turner <to...@johnturner.com>.
I would try setting:

Alias /webappname /some/path/to/tomcat/webappname
DocumentRoot /some/path/to/tomcat/webappname

Then:

JkMount /servlet/* ajp13

Then your URL of

http://some.host.com//webappname/servlet/webappname/templates/index.vm

should work.  Even this should work:

Alias / /some/path/to/tomcat/webappname
DocumentRoot /some/path/to/tomcat/webappname
JkMount /*.vm ajp13

The "*" in this case means "/webappname/servlet/webappname/templates".

I don't know anything about Turbine, so I can't help with specifics. 
You might just be better off using Tomcat alone.

John

David Wynter wrote:

> I have long URLs because I am using the Apache Turbine project to develop my
> webapps. Here is an article on how to shorten them, which gives me the
> impression that i am stuck with these long URLs
> http://jakarta.apache.org/turbine/turbine-2.2.1/howto/url-rewriting-howto.ht
> ml unless I follow this method.
> 
> This URL is a standard Turbine app URL -
> /webappname/servlet/webappname/templates/index.vm .
> 
> It always seemed to me that the /webappname/servlet/webappname should be
> replaceable by Aliases, but it is not clear to me how.
> 
> The web.xml supplied with Turbine does not have a mapping to .vm files. Here
> it is.
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>     "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
> 
> <web-app>
>   <servlet>
>     <servlet-name>se</servlet-name>
>     <servlet-class>org.apache.turbine.Turbine</servlet-class>
>     <init-param>
>       <param-name>applicationRoot</param-name>
>       <param-value>webContext</param-value>
>     </init-param>
>     <init-param>
>       <param-name>properties</param-name>
>       <param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
>     </init-param>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
>   <security-constraint>
>     <web-resource-collection>
>       <web-resource-name>templates</web-resource-name>
>       <url-pattern>/templates/*</url-pattern>
>     </web-resource-collection>
>     <web-resource-collection>
>       <web-resource-name>logs</web-resource-name>
>       <url-pattern>/logs/*</url-pattern>
>     </web-resource-collection>
>     <auth-constraint>
>       <role-name>admin</role-name>
>     </auth-constraint>
>   </security-constraint>
>   <login-config>
>     <auth-method>BASIC</auth-method>
>     <realm-name>Templates</realm-name>
>   </login-config>
> </web-app>
> 
> What is not clear is how the JkMount works in the context of the long URLs
> for Turbine apps as opposed to the short URLs for the example jsp. Why did I
> use the alias name in my Location and JkMount directives? Because the
> archive is littered with examples doing just that eg.
> http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg98299
> According to this thread the solution was not changing what he had in the
> JkMount so I cannot but help take it as an example, sorry.
> 
> Thanks John, you are the only one who is replying to these.
> 
> David
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 



RE: 2 VirtualHosts now work, mod_jk not

Posted by David Wynter <da...@roamware.co.uk>.
I have long URLs because I am using the Apache Turbine project to develop my
webapps. Here is an article on how to shorten them, which gives me the
impression that i am stuck with these long URLs
http://jakarta.apache.org/turbine/turbine-2.2.1/howto/url-rewriting-howto.ht
ml unless I follow this method.

This URL is a standard Turbine app URL -
/webappname/servlet/webappname/templates/index.vm .

It always seemed to me that the /webappname/servlet/webappname should be
replaceable by Aliases, but it is not clear to me how.

The web.xml supplied with Turbine does not have a mapping to .vm files. Here
it is.

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
  <servlet>
    <servlet-name>se</servlet-name>
    <servlet-class>org.apache.turbine.Turbine</servlet-class>
    <init-param>
      <param-name>applicationRoot</param-name>
      <param-value>webContext</param-value>
    </init-param>
    <init-param>
      <param-name>properties</param-name>
      <param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>templates</web-resource-name>
      <url-pattern>/templates/*</url-pattern>
    </web-resource-collection>
    <web-resource-collection>
      <web-resource-name>logs</web-resource-name>
      <url-pattern>/logs/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>admin</role-name>
    </auth-constraint>
  </security-constraint>
  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Templates</realm-name>
  </login-config>
</web-app>

What is not clear is how the JkMount works in the context of the long URLs
for Turbine apps as opposed to the short URLs for the example jsp. Why did I
use the alias name in my Location and JkMount directives? Because the
archive is littered with examples doing just that eg.
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg98299
According to this thread the solution was not changing what he had in the
JkMount so I cannot but help take it as an example, sorry.

Thanks John, you are the only one who is replying to these.

David


Re: 2 VirtualHosts now work, mod_jk not

Posted by John Turner <to...@johnturner.com>.
David Wynter wrote:

> Now I am getting somewhere.
> 
> I had left out the Directory directives in httpd.conf in my previous post
> because I had editted it from the Tomcat site vhost example, one that had a
> global directive, not for each VirtualHost. I found that the web.xml file
> for the rwsite ahd a different servlet name and thus the catalina.out error.
> 
> Now I use a index.html in each of the webapp directories (/se, /rwtransform
> & /rwsite) in each it has a
> <body
> onload="location='http://www.domainname.com:8080/webappname/servlet/webappna
> me/templates/index.vm';">
> 
> This overcomes the lack of mod_jk working. I'd still like to do away with
> this redirect if I can. Any pointers? I have a feeling it is something to do
> with the JkMount directives, which are redirect everything to Tomcat from
> nmy understanding.

I have no idea why you are trying to do this.  This isn't necessary at all.

Do you understand that your httpd.conf is confused?  You have a URL like:

/webappname/servlet/webappname/templates/index.vm

when it should be:

/webappname/servlet/templates/index.vm

or even better:

/webappname/index.vm

Then you just need to map *.vm in web.xml to your servlet, and your 
JkMount would be:

/webappname/*.vm ajp13

>     JkMount /usr/local/jakarta-tomcat-4.1.12/webapp2/se/*  ajp13

This is major confusion for mod_jk.

>     <Location "/rwtransform/WEB-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
>     <Location "/rwtransform/META-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>

Ditto...this should be something like "/META-INF" not 
"/someDir/META-INF".  the purpose of Alias and DocumentRoot is to get 
you away from using absolute paths in places like Location and JkMount.

> I get the feeling no one is reading these, but hopefully some other poor
> soul will find this helpful in the archives.

Are you serious?  Say the word and I'll stop all this typing.

John




RE: 2 VirtualHosts now work, mod_jk not

Posted by David Wynter <da...@roamware.co.uk>.
Now I am getting somewhere.

I had left out the Directory directives in httpd.conf in my previous post
because I had editted it from the Tomcat site vhost example, one that had a
global directive, not for each VirtualHost. I found that the web.xml file
for the rwsite ahd a different servlet name and thus the catalina.out error.

Now I use a index.html in each of the webapp directories (/se, /rwtransform
& /rwsite) in each it has a
<body
onload="location='http://www.domainname.com:8080/webappname/servlet/webappna
me/templates/index.vm';">

This overcomes the lack of mod_jk working. I'd still like to do away with
this redirect if I can. Any pointers? I have a feeling it is something to do
with the JkMount directives, which are redirect everything to Tomcat from
nmy understanding.

Here is an excerpt from my httpd.conf-------------------------------->

NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#


JkWorkersFile "/usr/local/tomcat/conf/jk/workers.properties"
JkLogFile "/usr/local/tomcat/logs/mod_jk.log"

JkLogLevel debug

<VirtualHost *>
    ServerName www.stpenable.com

    #################### www.stpenable.com:/se ####################

    ServerAlias localhost
    # Static files
    DocumentRoot /usr/local/jakarta-tomcat-4.1.12/webapp2/se
    Alias /se /usr/local/jakarta-tomcat-4.1.12/webapp2/se

    <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp2/se">
        Options Indexes FollowSymLinks
        DirectoryIndex index.vm index.html
    </Directory>

    <Location "/se/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>
    <Location "/se/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /usr/local/jakarta-tomcat-4.1.12/webapp2/se/*  ajp13

    #################### www.stpenable.com:/rwtransform ####################

    Alias /rwtransform /usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform

    <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform">
        Options Indexes FollowSymLinks
        DirectoryIndex index.vm  index.html
    </Directory>

    <Location "/rwtransform/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>
    <Location "/rwtransform/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform/*  ajp13

</VirtualHost>

<VirtualHost *>
    ServerName www.roamware.co.uk

    #################### www.roamware.co.uk:/rwsite ####################

    # Static files
    DocumentRoot /usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite

    Alias /rwsite /usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite

    <Directory "/usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite">
        Options Indexes FollowSymLinks
        DirectoryIndex index.vm  index.html
    </Directory>

    <Location "/rwsite/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>
    <Location "/rwsite/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite/*  ajp13

</VirtualHost>

I get the feeling no one is reading these, but hopefully some other poor
soul will find this helpful in the archives.

David


RE: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by David Wynter <da...@roamware.co.uk>.
Hi,

I have read dozens of archived posts on virtualhost. I have distilled my
httpd.conf and server.xml back to what seems to be the recommended approach,
see below. But now I can see no sites on any URL. I have a suspicous "End
event threw exception" in the catalina.out log, which suggests a problem
with server.xml, but reading it I cannot see any illegal XML, so assume it
is a configuration value error. At the end of the exception it also has
"...IllegalArguementException: Servlet mapping specifies an unknown servlet
name rwsite" which suggests it doesn't like my second Host configuration.
But I copied and pasted it from a posted version that worked and just
changed the appBase and servername to appropriate values?

In my error_log I get 2 types of errors:
1.  "Directory Index forbidden by rule:
/usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite" - there is that same
troublesome rwsite again.
2. "File does not exist:
/usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite/servlet" it's not a file but
a directory? and I get "File does not exist:
/usr/local/jakarta-tomcat-4.1.12/webapp2/se/servlet, referer:
http://www.stpenable.com/se/servlet/se/template/solutions%2Cmdmanage.vm"
which is real.

server.xml hosts section-------------------------->

     <!-- Define the default virtual host -->
      <Host name="www.stpenable.com" debug="0"
appBase="/usr/local/jakarta-tomcat-4.1.12/webapp2"
       unpackWARs="true" autoDeploy="true">

       <Alias>localhost</Alias>

        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="stpenable_access_log."
suffix=".txt"
                 pattern="common"/>

        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="stpenable_log." suffix=".txt"
	        timestamp="true"/>

        <Context path=""
docBase="/usr/local/jakarta-tomcat-4.1.12/webapp2/se" debug="1"/>
        <Context path="/rwtransform"
docBase="/usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform" debug="1"/>

      </Host>

      <Host name="www.roamware.co.uk" debug="0"
appBase="/usr/local/jakarta-tomcat-4.1.12/webapp1"
                   unpackWARs="true" autoDeploy="true">

		<Context path="" docBase="" debug="1"/>

		<Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="roamware_access_log."
suffix=".txt"
                 pattern="common" resolveHosts="false"/>
      </Host>

httpd.conf section-------------------------->

NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#


JkWorkersFile "/usr/local/tomcat/conf/jk/workers.properties"
JkLogFile "/usr/local/tomcat/logs/mod_jk.log"

JkLogLevel debug

<VirtualHost *>
    ServerName www.stpenable.com

    #################### www.stpenable.com:/se ####################

    ServerAlias localhost
    # Static files
    DocumentRoot /usr/local/jakarta-tomcat-4.1.12/webapp2/se
    Alias /se /usr/local/jakarta-tomcat-4.1.12/webapp2/se

    <Location "/se/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>
    <Location "/se/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /usr/local/jakarta-tomcat-4.1.12/webapp2/se/*  ajp13

    #################### www.stpenable.com:/rwtransform ####################

    Alias /rwsite /usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform

    <Location "/rwtransform/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>
    <Location "/rwtransform/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform/*  ajp13

</VirtualHost>

<VirtualHost *>
    ServerName www.roamware.co.uk

    #################### www.roamware.co.uk:/rwsite ####################

    # Static files
    DocumentRoot /usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite

    Alias /rwsite /usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite

    <Location "/rwsite/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>
    <Location "/rwsite/META-INF/*">
        AllowOverride None
        deny from all
    </Location>

    JkMount /usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite/*  ajp13

</VirtualHost>

I think I have tried everything I can with this. Any further suggestions?
Seems like John Turner is the only one able to answer these questions.

Regards

David


RE: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by David Wynter <da...@roamware.co.uk>.
Hi John,

Thanks for the pointers. I found a good tutorial on vhosts but using jk2 in
the Tomcat 4.1 docs. So it helped a little. I have change to using
DocumentRoot, less confusing. I also tried full paths instead of relative. I
had removed the Context entries because it meant I could at least type in
the full servlet URL and see the site, with the ones I had (which must have
been wrong) I couldn't.

Anyway I am at the stage where using the example files I am forbidden (403)
from seeing www.stpenable.com or www.roamware.co.uk I think because of the
<Directory /> entry. But I can see the /se servlet with the full URL but not
rwtransform or rwsite webapps.

Here is the bottom of my httpd.conf. I think i need to change the overall
DocumentRoot to /usr/local/jakarta-tomcat-4.1.12/webapp2/ , this directive
is easy to understand in the context of serving up static pages, but not
where all content is dynamically served by a servlet? I also think I need to
get rid of the <Directory /> entry and I might get further along.

-------------------->

DocumentRoot "/usr/local/jakarta-tomcat-4.1.12/webapp2/se"

<Directory /usr/local/jakarta-tomcat-4.1.12/webapp2/se>
    Options None
    AllowOverride None
</Directory>

DirectoryIndex index.html index.vm

<Directory />
    Options None
    AllowOverride None
</Directory>

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

<Location /WEB-INF/>
    Order Allow,Deny
</Location>

<Location /META-INF/>
    Order Allow,Deny
</Location>

NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#


JkWorkersFile "/usr/local/tomcat/conf/jk/workers.properties"
JkLogFile "/usr/local/tomcat/logs/mod_jk.log"

JkLogLevel debug

<VirtualHost *>
    ServerName www.stpenable.com

    #################### www.stpenable.com:/se ####################

    ServerAlias localhost
    # Static files
    DocumentRoot /usr/local/jakarta-tomcat-4.1.12/webapp2

    JkMount /se/servlet/*  ajp13
    JkMount /se/*.vm  ajp13

    #################### www.stpenable.com:/rwtransform ####################

#    JkMount /rwtransform/servlet/*  ajp13
#    JkMount /rwtransform/*.vm  ajp13

</VirtualHost>

<VirtualHost *>
    ServerName www.roamware.co.uk

    #################### www.roamware.co.uk:/rwsite ####################

    # Static files
    DocumentRoot /usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite

    JkMount /servlet/*  ajp13
    JkMount /*.vm  ajp13
</VirtualHost>

Now my Hosts section of the Server.xml-------------------------->

     <!-- Define the default virtual host -->
      <Host name="www.stpenable.com" debug="0"
appBase="/usr/local/jakarta-tomcat-4.1.12/webapp2"
       unpackWARs="true" autoDeploy="true">

       <Alias>localhost</Alias>

        <!-- Access log processes all requests for this virtual host.  By
             default, log files are created in the "logs" directory relative
to
             $CATALINA_HOME.  If you wish, you can specify a different
             directory with the "directory" attribute.  Specify either a
relative
             (to $CATALINA_HOME) or absolute path to the desired directory.
        -->
        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="stpenable_access_log."
suffix=".txt"
                 pattern="common"/>

        <!-- Logger shared by all Contexts related to this virtual host.  By
             default (when using FileLogger), log files are created in the
"logs"
             directory relative to $CATALINA_HOME.  If you wish, you can
specify
             a different directory with the "directory" attribute.  Specify
either a
             relative (to $CATALINA_HOME) or absolute path to the desired
             directory.-->
        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="stpenable_log." suffix=".txt"
	        timestamp="true"/>

        <Context path=""
docBase="/usr/local/jakarta-tomcat-4.1.12/webapp2/se" debug="1"/>
        <Context path="/rwtransform"
docBase="/usr/local/jakarta-tomcat-4.1.12/webapp2/rwtransform" debug="1"/>
      </Host>

      <!-- Define the default virtual host -->
      <Host name="www.roamware.co.uk" debug="0"
appBase="/usr/local/jakarta-tomcat-4.1.12/webapp1"
       unpackWARs="true" autoDeploy="true">

        <!-- Access log processes all requests for this virtual host.  By
             default, log files are created in the "logs" directory relative
to
             $CATALINA_HOME.  If you wish, you can specify a different
             directory with the "directory" attribute.  Specify either a
relative
             (to $CATALINA_HOME) or absolute path to the desired directory.
        -->
        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="stpenable_access_log."
suffix=".txt"
                 pattern="common"/>

        <!-- Logger shared by all Contexts related to this virtual host.  By
             default (when using FileLogger), log files are created in the
"logs"
             directory relative to $CATALINA_HOME.  If you wish, you can
specify
             a different directory with the "directory" attribute.  Specify
either a
             relative (to $CATALINA_HOME) or absolute path to the desired
             directory.-->
        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="roamware_log." suffix=".txt"
	        timestamp="true"/>

        <Context path=""
docBase="/usr/local/jakarta-tomcat-4.1.12/webapp1/rwsite" debug="1"/>

      </Host>

I am understanding a bit more how the connectors work. But I have worked 16
hours a day for the last 2 on this. I need some sleep.

Regards,

David


> -----Original Message-----
> From: John Turner [mailto:tomcat-user@johnturner.com]
> Sent: 21 August 2003 20:39
> To: Tomcat Users List
> Subject: Re: 2 VirtualHosts same IP address and port on Tomcat not
> working
>
>
>
> Did you remove the Context entries for some reason?  They are critical.
>
> Also, in httpd.conf you have:
>
> # Static files
>      Alias /rwsite "/usr/local/tomcat/webapp1/rwsite"
>
> and later
>
>     JkMount /rwsite/servlet/*  worker1
>     JkMount /rwsite/*.vm  worker1
>
> Thus, the URLs that Apache would expect would be:
>
> www.roamware.co.uk/rwsite/rwsite/servlet/rwsite/templates/index.vm
>
> Aside from the three "rwsite" entries this looks pretty convoluted to me.
>
> If you have /rwsite in an Alias in httpd.conf, then your JkMount would
> be, AFAIK:
>
>     JkMount /servlet/*  worker1
>     JkMount /*.vm  worker1
>
> John
>


Re: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by John Turner <to...@johnturner.com>.
Did you remove the Context entries for some reason?  They are critical.

Also, in httpd.conf you have:

# Static files
     Alias /rwsite "/usr/local/tomcat/webapp1/rwsite"

and later

    JkMount /rwsite/servlet/*  worker1
    JkMount /rwsite/*.vm  worker1

Thus, the URLs that Apache would expect would be:

www.roamware.co.uk/rwsite/rwsite/servlet/rwsite/templates/index.vm

Aside from the three "rwsite" entries this looks pretty convoluted to me.

If you have /rwsite in an Alias in httpd.conf, then your JkMount would 
be, AFAIK:

    JkMount /servlet/*  worker1
    JkMount /*.vm  worker1

John

David Wynter wrote:
> Actually I should qualify what I said. I have stpenable as the default Host
> so you can see www.stpenable.com/se/servlet/se/templates/index.vm  but for
> some reason you cannot see
> www.roamware.co.uk/rwsite/servlet/rwsite/templates/index.vm which is the
> second of the VirtualHosts in my conf file. They are configured as matching
> patterns (if you know what I mean - only the names have changed between the
> 2 configs).
> 
> The DefualHost in the Engine is www.stpenable.com
> 
> Here is the Host section from my server.xml, I've strpped out the
> comments----------------->
> 
>       <!-- Define the default virtual host -->
>       <Host name="localhost" debug="0" appBase="webapps"
>        unpackWARs="true" autoDeploy="true">
> 
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="localhost_log." suffix=".txt"
> 	        timestamp="true"/>
> 
>       </Host>
> 
>      <!-- Define the default virtual host -->
>       <Host name="www.stpenable.com" debug="0" appBase="webapp2"
>        unpackWARs="true" autoDeploy="true">
> 
>         <Valve className="org.apache.catalina.valves.AccessLogValve"
>                  directory="logs"  prefix="stpenable_access_log."
> suffix=".txt"
>                  pattern="common"/>
> 
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="stpenable_log." suffix=".txt"
> 	        timestamp="true"/>
> 
>       </Host>
> 
>       <!-- Define the default virtual host -->
>       <Host name="www.roamware.co.uk" debug="0" appBase="webapp1"
>        unpackWARs="true" autoDeploy="true">
> 
>         <Valve className="org.apache.catalina.valves.AccessLogValve"
>                  directory="logs"  prefix="stpenable_access_log."
> suffix=".txt"
>                  pattern="common"/>
> 
> 
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="roamware_log." suffix=".txt"
> 	        timestamp="true"/>
> 
>       </Host>
> 
> 
> regards,
> 
> David
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 



Re: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by John Turner <to...@johnturner.com>.
David Wynter wrote:

> Hi,
> 
> It seems that the second VirtualHost I have set up for my second domain name
> is not paasing the requests through mod_jk to Tomcat. It is not even clear
> that you can support 2 virtualhosts for different domains with the same IP
> address and port 80.
> This is a separate problem to the www.stpenable.com not redirecting to
> www.stpenable.com/se/servlet/se/templates/index.vm but it still affects me.

You can support many virtual hosts on the same IP address.  I have 
production environments with 6, 9, and 12 virtual hosts working just fine.

> Is the only way I can support a second virtual host is by setting up a
> second <Service> with its own Engine and Ajp13 connector listening on a
> separate port (say 8007 instead of 8009?). I assume I then setup a second
> worker on the port I have introduced. And in this case do both sevices also
> have a listener for port 8080, or do I need one on that port at all since
> all my trafic will be on port 80?

No, this is incorrect.  You only need one Service.

Your problems are related to your httpd.conf file, not the connector and 
not Tomcat.  You have to instruct Apache appropriately.  Its more than 
just JkMount, you also have to get your Alias and your DocumentRoot 
directives correct in httpd.conf...getting them wrong will cause Apache 
to "miss" the mod_jk match.

> I just tried it without a listener on port 8080, and a service with a
> connector on 8007 for one virtual host and a separate service with connector
> on 8009 for the other, nothing worked, so I suppose that answers my
> question.
> 
> I am kinda surprised that on the whole internet there is not a configuration
> example of running different webapps on 2 domains on the same Tomcat
> instance, there must be hundreds of people doing it?

There are.  I've posted an example to this list twice in the past 4 
months or so.

John




Re: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by John Turner <to...@johnturner.com>.
For grins, I decided to setup an example.  Here it is.

The server has multiple virtual hosts.  There are currently 6 working, 
this configuration describes how I added a seventh by copying a config 
from one of the other 6 and changing values as needed.

The scenario:

One Tomcat instance (4.1.12, yes I know its old but its an internal 
"play" server so not that important)

Multi-virtual hosts, each one has its own appBase ($CATALINA_HOME/hostname).

Each virtual host has a root context ($CATALINA_HOME/hostname/hostname).

Apache 2, mod_jk.so.

The goal:

http://hostname/test.jsp works
http://hostname/test.html works

To setup the new virtual host, I did the following:

- in server.xml, added:

<Host name="www.DOMAIN.com" debug="1" appBase="DOMAIN"
       unpackWARs="true" autoDeploy="true">

     <Logger className="org.apache.catalina.logger.FileLogger"
             directory="logs"  prefix="DOMAIN_com." suffix=".log"
             timestamp="true"/>

     <Context path="" docBase="DOMAIN" debug="0" reloadable="true">

     <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="DOMAIN." suffix=".log" timestamp="true" />

     <Resource name="mail/Session" auth="Container"
               type="javax.mail.Session"/>
         <ResourceParams name="mail/Session">
             <parameter>
                 <name>mail.smtp.host</name>
                 <value>localhost</value>
             </parameter>
         </ResourceParams>

     </Context>
</Host>

- created $CATALINA_HOME/DOMAIN, $CATALINA_HOME/DOMAIN/DOMAIN, 
$CATALINA_HOME/DOMAIN/DOMAIN/WEB-INF, 
$CATALINA_HOME/DOMAIN/DOMAIN/WEB-INF/classes, 
$CATALINA_HOME/DOMAIN/DOMAIN/WEB-INF/lib, 
$CATALINA_HOME/DOMAIN/DOMAIN/WEB-INF/web.xml where $CATALINA_HOME = 
"/usr/local/jakarta-tomcat-4.1.12"

- chown -R tomcat:tomcat $CATALINA_HOME/DOMAIN

- created $CATALINA_HOME/DOMAIN/DOMAIN/test.html and 
$CATALINA_HOME/DOMAIN/DOMAIN/test.jsp

in Apache httpd.conf, added:

<VirtualHost *>
     ServerName www.DOMAIN.com
     DocumentRoot /usr/local/jakarta-tomcat-4.1.12/DOMAIN/DOMAIN

     # Static files
     Alias / "/usr/local/jakarta-tomcat-4.1.12/DOMAIN/DOMAIN"

     <Directory "/usr/local/jakarta-tomcat-4.1.12/DOMAIN/DOMAIN">
         Options Indexes FollowSymLinks
         DirectoryIndex index.jsp
     </Directory>

     # Deny direct access to WEB-INF and META-INF
     #
     <Location "/WEB-INF/*">
         AllowOverride None
         deny from all
     </Location>

     <Location "/META-INF/*">
         AllowOverride None
         deny from all
     </Location>

     JkMount /* ajp13

</VirtualHost>

- stopped Tomcat.  stopped Apache.  Removed contents of 
$CATALINA_HOME/work/Standalone.  Started Tomcat.  Started Apache.

- verified that http://www.DOMAIN.com/test.jsp and 
http://www.DOMAIN.com/test.html work, and that 
http://www.DOMAIN.com/WEB-INF/web.xml returns a 403.

Wherever you see "DOMAIN" in the above, substitute the domain name that 
you want to use, or anything else, as long as you stay consistent.

I decided to use a JkMount of "/*" only because that's what you said you 
wanted to do by having a servlet generate all content...I could have 
just as easily made the JkMount be "/*.jsp" or whatever.  Your servlets 
now go in $CATALINA_HOME/DOMAIN/DOMAIN/WEB-INF, and you can adjust your 
web.xml appropriately to map them to a URL starting with "/" as in 
http://www.DOMAIN.com/SERVLET-URL.

Thus, things like "/WEB-INF" in the Location directive are RELATIVE to 
things like Alias, as is JkMount..if you get Alias wrong (and/or 
DocumentRoot) you're going to have lots of problems, and messing with 
your Contexts in server.xml or putting strange onLoad Javascript 
redirects in your pages isn't going to make it any better.

I'm not sure how much clearer I can be than the above, but I am always 
open to suggestions/corrections.

HTH

John

David Wynter wrote:

> Hi,
> 
> It seems that the second VirtualHost I have set up for my second domain name
> is not paasing the requests through mod_jk to Tomcat. It is not even clear
> that you can support 2 virtualhosts for different domains with the same IP
> address and port 80.
> This is a separate problem to the www.stpenable.com not redirecting to
> www.stpenable.com/se/servlet/se/templates/index.vm but it still affects me.
> 
> Is the only way I can support a second virtual host is by setting up a
> second <Service> with its own Engine and Ajp13 connector listening on a
> separate port (say 8007 instead of 8009?). I assume I then setup a second
> worker on the port I have introduced. And in this case do both sevices also
> have a listener for port 8080, or do I need one on that port at all since
> all my trafic will be on port 80?
> 
> I just tried it without a listener on port 8080, and a service with a
> connector on 8007 for one virtual host and a separate service with connector
> on 8009 for the other, nothing worked, so I suppose that answers my
> question.
> 
> I am kinda surprised that on the whole internet there is not a configuration
> example of running different webapps on 2 domains on the same Tomcat
> instance, there must be hundreds of people doing it?
> 
> Thanks
> 
> David
> 
>>-----Original Message-----
>>From: David Wynter [mailto:david@roamware.co.uk]
>>Sent: 21 August 2003 15:39
>>To: Tomcat Users List
>>Subject: RE: 2 VirtualHosts same IP address and port on Tomcat not
>>working
>>
>>
>>Actually I should qualify what I said. I have stpenable as the
>>default Host
>>so you can see www.stpenable.com/se/servlet/se/templates/index.vm  but for
>>some reason you cannot see
>>www.roamware.co.uk/rwsite/servlet/rwsite/templates/index.vm which is the
>>second of the VirtualHosts in my conf file. They are configured
>>as matching
>>patterns (if you know what I mean - only the names have changed
>>between the
>>2 configs).
>>
>>The DefualHost in the Engine is www.stpenable.com
>>
>>Here is the Host section from my server.xml, I've strpped out the
>>comments----------------->
>>
>>      <!-- Define the default virtual host -->
>>      <Host name="localhost" debug="0" appBase="webapps"
>>       unpackWARs="true" autoDeploy="true">
>>
>>        <Logger className="org.apache.catalina.logger.FileLogger"
>>                 directory="logs"  prefix="localhost_log." suffix=".txt"
>>	        timestamp="true"/>
>>
>>      </Host>
>>
>>     <!-- Define the default virtual host -->
>>      <Host name="www.stpenable.com" debug="0" appBase="webapp2"
>>       unpackWARs="true" autoDeploy="true">
>>
>>        <Valve className="org.apache.catalina.valves.AccessLogValve"
>>                 directory="logs"  prefix="stpenable_access_log."
>>suffix=".txt"
>>                 pattern="common"/>
>>
>>        <Logger className="org.apache.catalina.logger.FileLogger"
>>                 directory="logs"  prefix="stpenable_log." suffix=".txt"
>>	        timestamp="true"/>
>>
>>      </Host>
>>
>>      <!-- Define the default virtual host -->
>>      <Host name="www.roamware.co.uk" debug="0" appBase="webapp1"
>>       unpackWARs="true" autoDeploy="true">
>>
>>        <Valve className="org.apache.catalina.valves.AccessLogValve"
>>                 directory="logs"  prefix="stpenable_access_log."
>>suffix=".txt"
>>                 pattern="common"/>
>>
>>
>>        <Logger className="org.apache.catalina.logger.FileLogger"
>>                 directory="logs"  prefix="roamware_log." suffix=".txt"
>>	        timestamp="true"/>
>>
>>      </Host>
>>
>>
>>regards,
>>
>>David
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 



RE: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by David Wynter <da...@roamware.co.uk>.
Hi,

It seems that the second VirtualHost I have set up for my second domain name
is not paasing the requests through mod_jk to Tomcat. It is not even clear
that you can support 2 virtualhosts for different domains with the same IP
address and port 80.
This is a separate problem to the www.stpenable.com not redirecting to
www.stpenable.com/se/servlet/se/templates/index.vm but it still affects me.

Is the only way I can support a second virtual host is by setting up a
second <Service> with its own Engine and Ajp13 connector listening on a
separate port (say 8007 instead of 8009?). I assume I then setup a second
worker on the port I have introduced. And in this case do both sevices also
have a listener for port 8080, or do I need one on that port at all since
all my trafic will be on port 80?

I just tried it without a listener on port 8080, and a service with a
connector on 8007 for one virtual host and a separate service with connector
on 8009 for the other, nothing worked, so I suppose that answers my
question.

I am kinda surprised that on the whole internet there is not a configuration
example of running different webapps on 2 domains on the same Tomcat
instance, there must be hundreds of people doing it?

Thanks

David
> -----Original Message-----
> From: David Wynter [mailto:david@roamware.co.uk]
> Sent: 21 August 2003 15:39
> To: Tomcat Users List
> Subject: RE: 2 VirtualHosts same IP address and port on Tomcat not
> working
>
>
> Actually I should qualify what I said. I have stpenable as the
> default Host
> so you can see www.stpenable.com/se/servlet/se/templates/index.vm  but for
> some reason you cannot see
> www.roamware.co.uk/rwsite/servlet/rwsite/templates/index.vm which is the
> second of the VirtualHosts in my conf file. They are configured
> as matching
> patterns (if you know what I mean - only the names have changed
> between the
> 2 configs).
>
> The DefualHost in the Engine is www.stpenable.com
>
> Here is the Host section from my server.xml, I've strpped out the
> comments----------------->
>
>       <!-- Define the default virtual host -->
>       <Host name="localhost" debug="0" appBase="webapps"
>        unpackWARs="true" autoDeploy="true">
>
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="localhost_log." suffix=".txt"
> 	        timestamp="true"/>
>
>       </Host>
>
>      <!-- Define the default virtual host -->
>       <Host name="www.stpenable.com" debug="0" appBase="webapp2"
>        unpackWARs="true" autoDeploy="true">
>
>         <Valve className="org.apache.catalina.valves.AccessLogValve"
>                  directory="logs"  prefix="stpenable_access_log."
> suffix=".txt"
>                  pattern="common"/>
>
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="stpenable_log." suffix=".txt"
> 	        timestamp="true"/>
>
>       </Host>
>
>       <!-- Define the default virtual host -->
>       <Host name="www.roamware.co.uk" debug="0" appBase="webapp1"
>        unpackWARs="true" autoDeploy="true">
>
>         <Valve className="org.apache.catalina.valves.AccessLogValve"
>                  directory="logs"  prefix="stpenable_access_log."
> suffix=".txt"
>                  pattern="common"/>
>
>
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="roamware_log." suffix=".txt"
> 	        timestamp="true"/>
>
>       </Host>
>
>
> regards,
>
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


RE: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by David Wynter <da...@roamware.co.uk>.
Actually I should qualify what I said. I have stpenable as the default Host
so you can see www.stpenable.com/se/servlet/se/templates/index.vm  but for
some reason you cannot see
www.roamware.co.uk/rwsite/servlet/rwsite/templates/index.vm which is the
second of the VirtualHosts in my conf file. They are configured as matching
patterns (if you know what I mean - only the names have changed between the
2 configs).

The DefualHost in the Engine is www.stpenable.com

Here is the Host section from my server.xml, I've strpped out the
comments----------------->

      <!-- Define the default virtual host -->
      <Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true">

        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="localhost_log." suffix=".txt"
	        timestamp="true"/>

      </Host>

     <!-- Define the default virtual host -->
      <Host name="www.stpenable.com" debug="0" appBase="webapp2"
       unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="stpenable_access_log."
suffix=".txt"
                 pattern="common"/>

        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="stpenable_log." suffix=".txt"
	        timestamp="true"/>

      </Host>

      <!-- Define the default virtual host -->
      <Host name="www.roamware.co.uk" debug="0" appBase="webapp1"
       unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="stpenable_access_log."
suffix=".txt"
                 pattern="common"/>


        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="roamware_log." suffix=".txt"
	        timestamp="true"/>

      </Host>


regards,

David


RE: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by David Wynter <da...@roamware.co.uk>.
Actually I should qualify what I said. I have stpenable as the default Host
so you can see www.stpenable.com/se/servlet/se/templates/index.vm  but for
some reason you cannot see
www.roamware.co.uk/rwsite/servlet/rwsite/templates/index.vm which is the
second of the VirtualHosts in my conf file. They are configured as matching
patterns (if you know what I mean - only the names have changed between the
2 configs).

The DefualHost in the Engine is www.stpenable.com

Here is the Host section from my server.xml, I've strpped out the
comments----------------->

      <!-- Define the default virtual host -->
      <Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true">

        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="localhost_log." suffix=".txt"
	        timestamp="true"/>

      </Host>

     <!-- Define the default virtual host -->
      <Host name="www.stpenable.com" debug="0" appBase="webapp2"
       unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="stpenable_access_log."
suffix=".txt"
                 pattern="common"/>

        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="stpenable_log." suffix=".txt"
	        timestamp="true"/>

      </Host>

      <!-- Define the default virtual host -->
      <Host name="www.roamware.co.uk" debug="0" appBase="webapp1"
       unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="stpenable_access_log."
suffix=".txt"
                 pattern="common"/>


        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="roamware_log." suffix=".txt"
	        timestamp="true"/>

      </Host>


regards,

David


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by David Wynter <da...@roamware.co.uk>.
Hi John,

Thanks for the reply. I have fixed the workers.properties and related stuff
in the httpd.conf you pointed out below.

What I want is to see what i see at
www.stpenable.com/se/servlet/se/templates/index.vm to be what I see when I
hit www.stpenable.com Ditto for www.roamware.co.uk to see
www.roamware.co.uk/rwsite/servlet/rwsite/templates/index.vm. These servlet
contexts have just become visible because I removed all the Context entries
in the various <Host...> sections of my server.xml.

thanks

David

> -----Original Message-----
> From: John Turner [mailto:tomcat-user@johnturner.com]
> Sent: 21 August 2003 14:59
> To: Tomcat Users List
> Subject: Re: 2 VirtualHosts same IP address and port on Tomcat not
> working
>
>
>
> I think there's some confusion...you only need this in workers.properties:
>
> # BEGIN workers.properties
> worker.list=ajp13
> worker.ajp13.port=8009
> worker.ajp13.host=localhost
> worker.ajp13.type=ajp13
>
> ".host" = "location of Tomcat"
>
> When I first started trying to connect Tomcat and Apache a year ago, I
> thought I needed an entry for each virtual host in workers.properties.
> I have since learned that this is not true.  Workers.properties only
> defines "where do I find Tomcat" not "which virtual hosts will Tomcat
> accept".  The latter is determined by server.xml.
>
> When I go to http://www.stpenable.com and http://www.stpenable.com/se/ I
> get a directory listing.  What is it that I am supposed to get?
>
> You have "*.shtml" assigned to Tomcat.  Why?  Do you have ".shtml" as a
> servlet mapping in web.xml or something?
>
> I don't think your issues are virtual host related...perhaps if you
> could clarify what it is you want to do, we can help.
>
> John
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by David Wynter <da...@roamware.co.uk>.
Hi John,

Thanks for the reply. I have fixed the workers.properties and related stuff
in the httpd.conf you pointed out below.

What I want is to see what i see at
www.stpenable.com/se/servlet/se/templates/index.vm to be what I see when I
hit www.stpenable.com Ditto for www.roamware.co.uk to see
www.roamware.co.uk/rwsite/servlet/rwsite/templates/index.vm. These servlet
contexts have just become visible because I removed all the Context entries
in the various <Host...> sections of my server.xml.

thanks

David

> -----Original Message-----
> From: John Turner [mailto:tomcat-user@johnturner.com]
> Sent: 21 August 2003 14:59
> To: Tomcat Users List
> Subject: Re: 2 VirtualHosts same IP address and port on Tomcat not
> working
>
>
>
> I think there's some confusion...you only need this in workers.properties:
>
> # BEGIN workers.properties
> worker.list=ajp13
> worker.ajp13.port=8009
> worker.ajp13.host=localhost
> worker.ajp13.type=ajp13
>
> ".host" = "location of Tomcat"
>
> When I first started trying to connect Tomcat and Apache a year ago, I
> thought I needed an entry for each virtual host in workers.properties.
> I have since learned that this is not true.  Workers.properties only
> defines "where do I find Tomcat" not "which virtual hosts will Tomcat
> accept".  The latter is determined by server.xml.
>
> When I go to http://www.stpenable.com and http://www.stpenable.com/se/ I
> get a directory listing.  What is it that I am supposed to get?
>
> You have "*.shtml" assigned to Tomcat.  Why?  Do you have ".shtml" as a
> servlet mapping in web.xml or something?
>
> I don't think your issues are virtual host related...perhaps if you
> could clarify what it is you want to do, we can help.
>
> John
>
>


Re: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by John Turner <to...@johnturner.com>.
I think there's some confusion...you only need this in workers.properties:

# BEGIN workers.properties
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13

".host" = "location of Tomcat"

When I first started trying to connect Tomcat and Apache a year ago, I 
thought I needed an entry for each virtual host in workers.properties. 
I have since learned that this is not true.  Workers.properties only 
defines "where do I find Tomcat" not "which virtual hosts will Tomcat 
accept".  The latter is determined by server.xml.

When I go to http://www.stpenable.com and http://www.stpenable.com/se/ I 
get a directory listing.  What is it that I am supposed to get?

You have "*.shtml" assigned to Tomcat.  Why?  Do you have ".shtml" as a 
servlet mapping in web.xml or something?

I don't think your issues are virtual host related...perhaps if you 
could clarify what it is you want to do, we can help.

John

David Wynter wrote:

> Hi,.
> 
> I have read John Turner HowTo and the Galatea ones too. I have tried
> multiple different combinations of these. I found John's assetion that
> Tomcat does not generate multi VirtualHosts, but you can take the generated
> one, insert at the bottom of the httpd.conf and modify it to work. I know
> mod_jk works as I used it with a single host until I need it have to
> domains.
> 
> I have tried the approach suggested by John but so far all I get is a
> directory listing of the resolved directory. I am using Turbine as the
> servlet processor, it uses .vm extension not .jsp. Here is my
> workers.properties and bottom of my httpd.conf. Can anyone see what is
> wrong. The server is up so try the URLs if you want to. I can put  in the
> full servlet path eg. www.stpenable.com/se/servlet/se/templates/index.vm and
> it works. But it does not resolve from www.stpenable.com as it should.
> 
> worker.properties----------------->
> 
> # BEGIN workers.properties
> worker.list=ajp13, worker1
> 
> worker.ajp13.port=8009
> # change this line to match apache ServerName and Host name in server.xml
> worker.ajp13.host=www.stpenable.com
> worker.ajp13.type=ajp13
> 
> worker.worker1.port=8009
> # change this line to match apache ServerName and Host name in server.xml
> worker.worker1.host=www.roamware.co.uk
> worker.worker1.type=ajp13
> # END workers.properties
> 
> excerpt from bottom of http.conf, and yes it does have mod_jk.so
> loaded-------------->
> 
> NameVirtualHost *
> 
> JkWorkersFile "/usr/local/tomcat/conf/jk/workers.properties"
> JkLogFile "/usr/local/tomcat/logs/mod_jk.log"
> 
> JkLogLevel debug
> 
> <VirtualHost *>
>     ServerName www.stpenable.com
> 
>     #################### www.stpenable.com:/se ####################
> 
>     # Static files
>     Alias /se "/usr/local/tomcat/webapp2/se"
> 
>     <Directory "/usr/local/tomcat/webapp2/se">
>         Options Indexes FollowSymLinks
>         DirectoryIndex index.html index.htm index.vm
>     </Directory>
> 
> 
>     # Deny direct access to WEB-INF and META-INF
>     #
>     <Location "/se/WEB-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     <Location "/se/META-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     JkMount /se/*.shtml  ajp13
>     JkMount /se/cgi-bin/*  ajp13
>     JkMount /se/servlet/*  ajp13
>     JkMount /se/*.vm  ajp13
> 
>     #################### www.stpenable.com:/rwtransform ####################
> 
>     # Static files
>     Alias /rwtransform "/usr/local/tomcat/webapp2/rwtransform"
> 
>     <Directory "/usr/local/tomcat/webapp2/rwtransform">
>         Options Indexes FollowSymLinks
>         DirectoryIndex index.html index.htm index.vm
>     </Directory>
> 
> 
>     # Deny direct access to WEB-INF and META-INF
>     #
>     <Location "/rwtransform/WEB-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     <Location "/rwtransform/META-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     JkMount /rwtransform/*.shtml  ajp13
>     JkMount /rwtransform/cgi-bin/*  ajp13
>     JkMount /rwtransform/servlet/*  ajp13
>     JkMount /rwtransform/*.vm  ajp13
> 
> </VirtualHost>
> 
> <VirtualHost *>
>     ServerName www.roamware.co.uk
> 
>     #################### www.roamware.co.uk:/rwsite ####################
> 
>     # Static files
>     Alias /rwsite "/usr/local/tomcat/webapp1/rwsite"
> 
>     <Directory "/usr/local/tomcat/webapp1/rwsite">
>         Options Indexes FollowSymLinks
>         DirectoryIndex index.html index.htm index.vm
>     </Directory>
> 
> 
>     # Deny direct access to WEB-INF and META-INF
>     #
>     <Location "/rwsite/WEB-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     <Location "/rwsite/META-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     JkMount /rwsite/servlet/*  worker1
>     JkMount /rwsite/*.vm  worker1
> </VirtualHost>
> 
> David Wynter
> 
> roamware Ltd.
> (+44) (0) 208 922 7539 B.
> (+44) (0) 7879 605 706 M.
> www.roamware.co.uk
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: 2 VirtualHosts same IP address and port on Tomcat not working

Posted by John Turner <to...@johnturner.com>.
I think there's some confusion...you only need this in workers.properties:

# BEGIN workers.properties
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13

".host" = "location of Tomcat"

When I first started trying to connect Tomcat and Apache a year ago, I 
thought I needed an entry for each virtual host in workers.properties. 
I have since learned that this is not true.  Workers.properties only 
defines "where do I find Tomcat" not "which virtual hosts will Tomcat 
accept".  The latter is determined by server.xml.

When I go to http://www.stpenable.com and http://www.stpenable.com/se/ I 
get a directory listing.  What is it that I am supposed to get?

You have "*.shtml" assigned to Tomcat.  Why?  Do you have ".shtml" as a 
servlet mapping in web.xml or something?

I don't think your issues are virtual host related...perhaps if you 
could clarify what it is you want to do, we can help.

John

David Wynter wrote:

> Hi,.
> 
> I have read John Turner HowTo and the Galatea ones too. I have tried
> multiple different combinations of these. I found John's assetion that
> Tomcat does not generate multi VirtualHosts, but you can take the generated
> one, insert at the bottom of the httpd.conf and modify it to work. I know
> mod_jk works as I used it with a single host until I need it have to
> domains.
> 
> I have tried the approach suggested by John but so far all I get is a
> directory listing of the resolved directory. I am using Turbine as the
> servlet processor, it uses .vm extension not .jsp. Here is my
> workers.properties and bottom of my httpd.conf. Can anyone see what is
> wrong. The server is up so try the URLs if you want to. I can put  in the
> full servlet path eg. www.stpenable.com/se/servlet/se/templates/index.vm and
> it works. But it does not resolve from www.stpenable.com as it should.
> 
> worker.properties----------------->
> 
> # BEGIN workers.properties
> worker.list=ajp13, worker1
> 
> worker.ajp13.port=8009
> # change this line to match apache ServerName and Host name in server.xml
> worker.ajp13.host=www.stpenable.com
> worker.ajp13.type=ajp13
> 
> worker.worker1.port=8009
> # change this line to match apache ServerName and Host name in server.xml
> worker.worker1.host=www.roamware.co.uk
> worker.worker1.type=ajp13
> # END workers.properties
> 
> excerpt from bottom of http.conf, and yes it does have mod_jk.so
> loaded-------------->
> 
> NameVirtualHost *
> 
> JkWorkersFile "/usr/local/tomcat/conf/jk/workers.properties"
> JkLogFile "/usr/local/tomcat/logs/mod_jk.log"
> 
> JkLogLevel debug
> 
> <VirtualHost *>
>     ServerName www.stpenable.com
> 
>     #################### www.stpenable.com:/se ####################
> 
>     # Static files
>     Alias /se "/usr/local/tomcat/webapp2/se"
> 
>     <Directory "/usr/local/tomcat/webapp2/se">
>         Options Indexes FollowSymLinks
>         DirectoryIndex index.html index.htm index.vm
>     </Directory>
> 
> 
>     # Deny direct access to WEB-INF and META-INF
>     #
>     <Location "/se/WEB-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     <Location "/se/META-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     JkMount /se/*.shtml  ajp13
>     JkMount /se/cgi-bin/*  ajp13
>     JkMount /se/servlet/*  ajp13
>     JkMount /se/*.vm  ajp13
> 
>     #################### www.stpenable.com:/rwtransform ####################
> 
>     # Static files
>     Alias /rwtransform "/usr/local/tomcat/webapp2/rwtransform"
> 
>     <Directory "/usr/local/tomcat/webapp2/rwtransform">
>         Options Indexes FollowSymLinks
>         DirectoryIndex index.html index.htm index.vm
>     </Directory>
> 
> 
>     # Deny direct access to WEB-INF and META-INF
>     #
>     <Location "/rwtransform/WEB-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     <Location "/rwtransform/META-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     JkMount /rwtransform/*.shtml  ajp13
>     JkMount /rwtransform/cgi-bin/*  ajp13
>     JkMount /rwtransform/servlet/*  ajp13
>     JkMount /rwtransform/*.vm  ajp13
> 
> </VirtualHost>
> 
> <VirtualHost *>
>     ServerName www.roamware.co.uk
> 
>     #################### www.roamware.co.uk:/rwsite ####################
> 
>     # Static files
>     Alias /rwsite "/usr/local/tomcat/webapp1/rwsite"
> 
>     <Directory "/usr/local/tomcat/webapp1/rwsite">
>         Options Indexes FollowSymLinks
>         DirectoryIndex index.html index.htm index.vm
>     </Directory>
> 
> 
>     # Deny direct access to WEB-INF and META-INF
>     #
>     <Location "/rwsite/WEB-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     <Location "/rwsite/META-INF/*">
>         AllowOverride None
>         deny from all
>     </Location>
> 
>     JkMount /rwsite/servlet/*  worker1
>     JkMount /rwsite/*.vm  worker1
> </VirtualHost>
> 
> David Wynter
> 
> roamware Ltd.
> (+44) (0) 208 922 7539 B.
> (+44) (0) 7879 605 706 M.
> www.roamware.co.uk
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>