You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Martin Mauri <mm...@profesi.com.ar> on 2001/05/14 15:26:54 UTC

Virtual Hosts

Hi Users!

As far as I know, with 3.1 versions it's necessary ti run different virtual
hosts mounts in different JVM. But according to the mod_jk module
documentation it seems that it's fixed because the virtual hosts directives
are set in workers.properties, httpd.conf and server.xml. Does anybodu know
if I'm right or wrong with this?

regards.

Lic. Martin O. Mauri
Profesion + Auge A.F.J.P
Parana 666 - Cap. Federal
TE: (011) 4373-7786/7 int: 422
mmauri@profesi.com.ar
www.profesi.com.ar


Re: Virtual Hosts

Posted by Jeff Kilbride <je...@kilbride.com>.
Hi Martin,

I'm using name-based vhosts and they work the same as the IP-based. Just
substitute the name for the IP.

Here's my server.xml config:

<Host name="www.myhost.com" >
    <Context path=""
             docBase="/usr/local/java/webapps/hqcash/dist"
             crossContext="false"
             debug="0"
             reloadable="true">
    </Context>
</Host>

Set one of these up for each virtual host in Apache. Also note that if you
use the ServerAlias directive in Apache to make your host respond to more
than one name (i.e.  www.myhost.com *and* myhost.com ), you need to have two
entries in your server.xml file -- which will cause all of your servlets to
be init'ed and instantiated twice. The Host directive in server.xml doesn't
take wildcards or multiple host names. (I wish it did!)

Also, you should put all your JkMount directives for that specific host
inside your <VirtualHost> directives in your apache config. If they are
outside your <VirtualHost> directive, all hosts on the machine will inherit
the JkMount points.

Thanks,
--jeff

----- Original Message -----
From: "Martin Mauri" <mm...@profesi.com.ar>
To: <to...@jakarta.apache.org>
Sent: Wednesday, May 16, 2001 6:40 AM
Subject: Re: Virtual Hosts


> Hi Jeff,
>
> I agree, but the example shows an IP based virtual host configuration that
> means I have to set up different virtual IP addresses in my OS and I don't
> want to, I'd like to know how to configure named based virtual hosts
within
> the same JVM.
>
> Any idea?
>
> regards,
>
> Martin
>
> > Hi Martin,
> >
> > Take a look at the mod_jk howto:
> >
> >
http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/mod_jk-howto.html
> >
> > The example configuration shows how to use the <Host> directive in
> > server.xml to set up virtual hosts using the same JVM. There's no need
to
> > specify different ports.
> >
> > Thanks,
> > --jeff
> >
> > ----- Original Message -----
> > From: "Martin Mauri" <mm...@profesi.com.ar>
> > To: <to...@jakarta.apache.org>
> > Sent: Monday, May 14, 2001 11:01 AM
> > Subject: Re: Virtual Hosts
> >
> >
> > > Thanks Ronan,
> > >
> > > Now, suppose I want to do it within the same process, with mod_jk I
> think
> > I
> > > should have different ports per virtual host shouldn't I?
> > >
> > > Do you have an example on how to set up this?
> > >
> > > thanks.
> > >
> > > m-
> > >
> > > > Martin,
> > > >
> > > > With 3.1 if you had multiple virtual hosts, you had to have a
seperate
> > > > server.xml
> > > > file for each vitual host. Tomcat used a seperatee JVM for each
> virtual
> > > > host.
> > > > This is handy in a development environment so that you can stop and
> > start
> > > > one
> > > > virtual host without having to stop and start them all.
> > > >
> > > > However, with 3.2 you can run them all in one JVm (or all
seperately,
> > > > whichever you
> > > > prefer). I think you might have to use the AJp12 protocol with
mod_jk
> if
> > > you
> > > > wish
> > > > to run them in seperate JVMs but if you are using just on JVM you
can
> > use
> > > > either
> > > > ajp13 or ajp12.
> > > >
> > > > Ronan
> > > >
> > > > -----Original Message-----
> > > > From: Martin Mauri [mailto:mmauri@profesi.com.ar]
> > > > Sent: 14 May 2001 14:27
> > > > To: tomcat-user@jakarta.apache.org
> > > > Subject: Virtual Hosts
> > > >
> > > >
> > > > Hi Users!
> > > >
> > > > As far as I know, with 3.1 versions it's necessary ti run different
> > > virtual
> > > > hosts mounts in different JVM. But according to the mod_jk module
> > > > documentation it seems that it's fixed because the virtual hosts
> > > directives
> > > > are set in workers.properties, httpd.conf and server.xml. Does
anybodu
> > > know
> > > > if I'm right or wrong with this?
> > > >
> > > > regards.
> > > >
> > > > Lic. Martin O. Mauri
> > > > Profesion + Auge A.F.J.P
> > > > Parana 666 - Cap. Federal
> > > > TE: (011) 4373-7786/7 int: 422
> > > > mmauri@profesi.com.ar
> > > > www.profesi.com.ar
> > > >
> > >
>


Re: Virtual Hosts

Posted by Martin Mauri <mm...@profesi.com.ar>.
Hi Jeff,

I agree, but the example shows an IP based virtual host configuration that
means I have to set up different virtual IP addresses in my OS and I don't
want to, I'd like to know how to configure named based virtual hosts within
the same JVM.

Any idea?

regards,

Martin

> Hi Martin,
>
> Take a look at the mod_jk howto:
>
> http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/mod_jk-howto.html
>
> The example configuration shows how to use the <Host> directive in
> server.xml to set up virtual hosts using the same JVM. There's no need to
> specify different ports.
>
> Thanks,
> --jeff
>
> ----- Original Message -----
> From: "Martin Mauri" <mm...@profesi.com.ar>
> To: <to...@jakarta.apache.org>
> Sent: Monday, May 14, 2001 11:01 AM
> Subject: Re: Virtual Hosts
>
>
> > Thanks Ronan,
> >
> > Now, suppose I want to do it within the same process, with mod_jk I
think
> I
> > should have different ports per virtual host shouldn't I?
> >
> > Do you have an example on how to set up this?
> >
> > thanks.
> >
> > m-
> >
> > > Martin,
> > >
> > > With 3.1 if you had multiple virtual hosts, you had to have a seperate
> > > server.xml
> > > file for each vitual host. Tomcat used a seperatee JVM for each
virtual
> > > host.
> > > This is handy in a development environment so that you can stop and
> start
> > > one
> > > virtual host without having to stop and start them all.
> > >
> > > However, with 3.2 you can run them all in one JVm (or all seperately,
> > > whichever you
> > > prefer). I think you might have to use the AJp12 protocol with mod_jk
if
> > you
> > > wish
> > > to run them in seperate JVMs but if you are using just on JVM you can
> use
> > > either
> > > ajp13 or ajp12.
> > >
> > > Ronan
> > >
> > > -----Original Message-----
> > > From: Martin Mauri [mailto:mmauri@profesi.com.ar]
> > > Sent: 14 May 2001 14:27
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Virtual Hosts
> > >
> > >
> > > Hi Users!
> > >
> > > As far as I know, with 3.1 versions it's necessary ti run different
> > virtual
> > > hosts mounts in different JVM. But according to the mod_jk module
> > > documentation it seems that it's fixed because the virtual hosts
> > directives
> > > are set in workers.properties, httpd.conf and server.xml. Does anybodu
> > know
> > > if I'm right or wrong with this?
> > >
> > > regards.
> > >
> > > Lic. Martin O. Mauri
> > > Profesion + Auge A.F.J.P
> > > Parana 666 - Cap. Federal
> > > TE: (011) 4373-7786/7 int: 422
> > > mmauri@profesi.com.ar
> > > www.profesi.com.ar
> > >
> >


Re: Virtual Hosts

Posted by Jeff Kilbride <je...@kilbride.com>.
Hi Martin,

Take a look at the mod_jk howto:

http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/mod_jk-howto.html

The example configuration shows how to use the <Host> directive in
server.xml to set up virtual hosts using the same JVM. There's no need to
specify different ports.

Thanks,
--jeff

----- Original Message -----
From: "Martin Mauri" <mm...@profesi.com.ar>
To: <to...@jakarta.apache.org>
Sent: Monday, May 14, 2001 11:01 AM
Subject: Re: Virtual Hosts


> Thanks Ronan,
>
> Now, suppose I want to do it within the same process, with mod_jk I think
I
> should have different ports per virtual host shouldn't I?
>
> Do you have an example on how to set up this?
>
> thanks.
>
> m-
>
> > Martin,
> >
> > With 3.1 if you had multiple virtual hosts, you had to have a seperate
> > server.xml
> > file for each vitual host. Tomcat used a seperatee JVM for each virtual
> > host.
> > This is handy in a development environment so that you can stop and
start
> > one
> > virtual host without having to stop and start them all.
> >
> > However, with 3.2 you can run them all in one JVm (or all seperately,
> > whichever you
> > prefer). I think you might have to use the AJp12 protocol with mod_jk if
> you
> > wish
> > to run them in seperate JVMs but if you are using just on JVM you can
use
> > either
> > ajp13 or ajp12.
> >
> > Ronan
> >
> > -----Original Message-----
> > From: Martin Mauri [mailto:mmauri@profesi.com.ar]
> > Sent: 14 May 2001 14:27
> > To: tomcat-user@jakarta.apache.org
> > Subject: Virtual Hosts
> >
> >
> > Hi Users!
> >
> > As far as I know, with 3.1 versions it's necessary ti run different
> virtual
> > hosts mounts in different JVM. But according to the mod_jk module
> > documentation it seems that it's fixed because the virtual hosts
> directives
> > are set in workers.properties, httpd.conf and server.xml. Does anybodu
> know
> > if I'm right or wrong with this?
> >
> > regards.
> >
> > Lic. Martin O. Mauri
> > Profesion + Auge A.F.J.P
> > Parana 666 - Cap. Federal
> > TE: (011) 4373-7786/7 int: 422
> > mmauri@profesi.com.ar
> > www.profesi.com.ar
> >
>


Re: Virtual Hosts

Posted by Martin Mauri <mm...@profesi.com.ar>.
Thanks Ronan,

Now, suppose I want to do it within the same process, with mod_jk I think I
should have different ports per virtual host shouldn't I?

Do you have an example on how to set up this?

thanks.

m-

> Martin,
>
> With 3.1 if you had multiple virtual hosts, you had to have a seperate
> server.xml
> file for each vitual host. Tomcat used a seperatee JVM for each virtual
> host.
> This is handy in a development environment so that you can stop and start
> one
> virtual host without having to stop and start them all.
>
> However, with 3.2 you can run them all in one JVm (or all seperately,
> whichever you
> prefer). I think you might have to use the AJp12 protocol with mod_jk if
you
> wish
> to run them in seperate JVMs but if you are using just on JVM you can use
> either
> ajp13 or ajp12.
>
> Ronan
>
> -----Original Message-----
> From: Martin Mauri [mailto:mmauri@profesi.com.ar]
> Sent: 14 May 2001 14:27
> To: tomcat-user@jakarta.apache.org
> Subject: Virtual Hosts
>
>
> Hi Users!
>
> As far as I know, with 3.1 versions it's necessary ti run different
virtual
> hosts mounts in different JVM. But according to the mod_jk module
> documentation it seems that it's fixed because the virtual hosts
directives
> are set in workers.properties, httpd.conf and server.xml. Does anybodu
know
> if I'm right or wrong with this?
>
> regards.
>
> Lic. Martin O. Mauri
> Profesion + Auge A.F.J.P
> Parana 666 - Cap. Federal
> TE: (011) 4373-7786/7 int: 422
> mmauri@profesi.com.ar
> www.profesi.com.ar
>


RE: Virtual Hosts

Posted by Ronan Derby <ro...@puca.ie>.
Martin,

With 3.1 if you had multiple virtual hosts, you had to have a seperate
server.xml
file for each vitual host. Tomcat used a seperatee JVM for each virtual
host.
This is handy in a development environment so that you can stop and start
one
virtual host without having to stop and start them all.

However, with 3.2 you can run them all in one JVm (or all seperately,
whichever you
prefer). I think you might have to use the AJp12 protocol with mod_jk if you
wish
to run them in seperate JVMs but if you are using just on JVM you can use
either
ajp13 or ajp12.

Ronan

-----Original Message-----
From: Martin Mauri [mailto:mmauri@profesi.com.ar]
Sent: 14 May 2001 14:27
To: tomcat-user@jakarta.apache.org
Subject: Virtual Hosts


Hi Users!

As far as I know, with 3.1 versions it's necessary ti run different virtual
hosts mounts in different JVM. But according to the mod_jk module
documentation it seems that it's fixed because the virtual hosts directives
are set in workers.properties, httpd.conf and server.xml. Does anybodu know
if I'm right or wrong with this?

regards.

Lic. Martin O. Mauri
Profesion + Auge A.F.J.P
Parana 666 - Cap. Federal
TE: (011) 4373-7786/7 int: 422
mmauri@profesi.com.ar
www.profesi.com.ar