Re: i'm in trouble with configuring virtual hosting of tomcat 3.2

2001-01-06 Thread bhkwan


Phillip Rhodes post the following instruction which is working prefectly
for me...

check it out...


POST from Phillip Rhodes:

This kind of got long and detailed.   I would like it to be reused if
possible in the faq.

I did it.  I have 3 virtual hosts in Apache, with 3 different instances of
Tomcat.  One for each virtual host.

I am running apache 1.3.9 on FreeBSD, jdk1.2.2, tomcat 3.2.1

create a subdirectory in /usr/local/jakarta-tomcat-3.2.1 for each apache
virtual host you want to run a tomcat instance for.  You can call them
tomcat1, tomcat2, and tomcat3

copy /usr/local/jakarta-tomcat-3.2.1/conf into each of your new
subdirectories.
The following commands are just used to clarify the above stepI know
you
know this!
cd /usr/local/jakarta-tomcat-3.2.1/
cp -R conf ./tomcat1
cp -R conf ./tomcat2
cp -R conf ./tomcat3
So now there is a ./tomcat1/conf, ./tomcat2/conf and a ./tomcat3/conf

You need to edit each server.xml in each of the conf directories that you
have just created.
Edit Steps:

1)
Find the ContextManage element and add the attribute "home", as shown
below.
This allows tomcat to create what it needs in each of the subdirectories
that you have created.
ContextManager home="tomcat1" debug="0" workDir="work"
showDebugInfo="true" 
When you edit the 2nd and 3rd server.xml files, just change tomcat1 to
tomcat2, and so on.

2)
Find the connector for HTTP.  This defaults to 8080 or something like that,
but in any case, it is a STUPID default, because you have default http,
ajp12 and ajp13 ports right next to each other.  I like to increment my
ports as I increment my instances.  Change the first server.xml file to use
an http port of "7001", the second one can be 7002, and so one.  (A brief
aside for the enlightened, my scheme is 7000's for HTTP, 8000's for ajp12
and 9000's for ajp13)

If you don't understand the above, don't worry, just find the line below
and
change the value to "7001" for you first server.xml, use 7002 for your
second server.xml, 7003 for yourand so on.

!-- Normal HTTP --
Connector className="org.apache.tomcat.service.PoolTcpConnector"
Parameter name="handler"

value="org.apache.tomcat.service.http.HttpConnectionHandler"/
Parameter name="port"
value="7001"/
/Connector

3)
Find the connector for ajp12.  Change the port to 8001.  Use 8002, and so
on
for your other server.xml's
!-- Apache AJP12 support. This is also used to shut down tomcat.
  --
Connector className="org.apache.tomcat.service.PoolTcpConnector"
Parameter name="handler"
   value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/
Parameter name="port" value="8001"/
/Connector

4)
Add this line right after where the above line ends!  For subsequent
server.xml files, increment the port of 9001 to 9002

!--enable AJP13 support
  --
Connector className="org.apache.tomcat.service.PoolTcpConnector"
Parameter name="handler"
value
="org.apache.tomcat.service.connector.Ajp13ConnectionHandler"/
Parameter name="port" value="9001"/
/Connector

5)  Add the following right after the line above.  Change the name
attribute
of element host. This value will be the virtual host as it is known to
apache. Change docbase to point to your web server document root!

Host name="www.rhoderunner.com"
  Context path="/" docBase="/usr/local/www/rhoderunner" debug="0"/
/Host

You are now done with server.xml file editing.

6)
Now edit the /usr/local/jakarta-tomcat-3.2.1/conf /workers.properties file.
You should read the HOWTO on this, but just follow the pattern that I have
done:  You can see my file at
http://www.rhoderunner.com/tomcatconf/workers.properties

Make sure your JAVA_HOME, PS environment variable are set correctly.
You want to create a 2 workers for every virtual host.  One worker will be
of type ajp12, and the other will be ajp13
I used a portion of the domain appended to the type of worker to name it.
This makes it much easier when you are setting up your apache conf file.
For example, here is my def for "ajp13rhoderunner".  Notice that I use port
9001 for the ajp13.  Remember the schema I defined earlier?  We use 9000
for
ajp3, and 8000 for ajp2

#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13rhoderunner.port=9001
worker.ajp13rhoderunner.host=localhost
worker.ajp13rhoderunner.type=ajp13
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#   lbfactor must be  0
#   Low lbfactor means less work done by the worker.
worker.ajp13rhoderunner.lbfactor=1


Edit your apache httpd.conf file  Here is how I defined 2 virtual hosts:
# Load mod_jk
#
LoadModule

i'm in trouble with configuring virtual hosting of tomcat 3.2

2001-01-05 Thread



i'm running two site with defferent domain names
so i set up tomcat with virtual hosting function
one site is good(servlet, jsp both ok)
but the only servlet works at the ohter site
when i request .jsp files by my browser 
the server didn't respond
how can i solve it?
two sites have the nearly same configuration..
thanks..