tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent Salle" <Laurent.Sa...@aventin.com>
Subject RE: Apache + Virtual hosts on different ports + Tomcat
Date Wed, 18 Oct 2000 13:03:31 GMT


> -----Original Message-----
> From: Mirko Froehlich [mailto:mirko.froehlich@bigfoot.com]
> Sent: Wednesday, October 18, 2000 5:57 AM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: Apache + Virtual hosts on different ports + Tomcat
>
>
> Werner,
>
> Sorry, but I am not really running a real website yet. I had a small
> personal website consisting of static HTML files, and I am now going to
> convert it to JSP and add some dynamic features. Right now, I just tried
> some test pages to see if I can get Tomcat and Apache working together
> correctly.
>
> -Mirko
>
>
> > -----Original Message-----
> > From: Werner Ramaekers [mailto:crypto@pandora.be]
> > Sent: Monday, October 16, 2000 11:46 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Re: Apache + Virtual hosts on different ports + Tomcat
> >
> >
> > Hi Mirko,
> >
> > is your own website using sessions to share objects between
> > servlets and JSP's ?
> >
> > If so I would like to know how where you put the class files
> > for the shared
> > objects
> > so that they can be found both by servlets and the JSP's.
> > I'm using the same setup as you but am having problems with the above.
> >
> > Werner
> >
> > Mirko Froehlich wrote:
> >
> > > Hi!
> > >
> > > I am running Apache 1.3 and Tomcat 3.2 beta 6 on a Linux
> > box. I followed the
> > > documentation to integrate these via mod_jk, which
> > basically seems to work
> > > fine. Both servlets and JSP work for the Tomcat example
> > site and my own
> > > website if I put them in the right directory. Now this is
> > what I am trying
> > > to do:
> > >
> > > I want to have two different websites (i.e. a production
> > site and a staging
> > > site) running on different ports (port 80 for production,
> > port 8080 for
> > > staging). "http.conf" defines a virtual host for each of
> > these websites, and
> > > as long as I am only using static files, everything is
> > working as expected.
> > > However, I don't know how to map these virtual hosts to the
> > appropriate
> > > contexts in Tomcat's "server.xml", since these seem to only
> > differentiate
> > > hosts by name, not by port. Is there any way this can be done?

  What you can do is map each virtual host to a different tomcat setup. This
way you will be able to start / stop / crash stagging web site without
affecting production website.

  Il you have two tomcat running, listning Ajp12 on 10001 and 10002 ports:

/etc/httpd/conf/httpd.conf:
-----------------------------

LoadModule jk_module /etc/httpd/libexec/mod_jk.so

JkWorkersFile /etc/httpd/conf/workers.properties

Listen 8001

<VirtualHost _default_:8001>
  Port 8001
  DocumentRoot /home/httpd/virtual_hosts/8001/html/
  JkMount / 8001Worker
</VirtualHost>


Listen 8002

<VirtualHost _default_:8002>
  Port 8002
  DocumentRoot /home/httpd/virtual_hosts/8002/html/
  JkMount / 8002Worker
</VirtualHost>

/etc/httpd/conf/workers.properties
----------------------------------

worker.list=8001Worker, 8002Worker

worker.8001Worker.port=10001
worker.8001Worker.host=localhost
worker.8001Worker.type=ajp12
worker.8001Worker.lbfactor=1

worker.8002Worker.port=10002
worker.8002Worker.host=localhost
worker.8002Worker.type=ajp12
worker.8002Worker.lbfactor=1

> > >
> > > -Mirko
> >
> > --
> > --------------------------------------------------------------
> > ---------
> > crypto : One who covertly supports a certain doctrine, group,
> > or party.
> > <mailto: crypto@pandora.be>  <http://www.shiftat.com>
> > --------------------------------------------------------------
> > ---------
> >
> >
> >
>
>


Mime
View raw message