Let's say you would like to start several Tomcat instances on the same server.
In this case you have several possibilities.
1) You are not worried to duplicate the binaries and it is the way most of us do at the beginning.
You copy/paste the directory Tomcat on some other place. Every instance will have it's own CATALINA_HOME directory. Easy to do. But you waste the binaries.
2) You don't want to waste disk space and you start to play with CATALINA_BASE.
CATALINA_BASE is the location where you will put the configuration, logs, ... of your new instance.
More precisely, conf, logs, shared, temp, web apps and work.
You'll have to assign 2 variables this time : CATALINA_BASE and
CATALINA_HOME. In point 1) you only assign 1 variable : CATALINA_HOME.
Is it clear enough ? Maybe not ? So let's show you an example.
On the same server, there are 2 users, rudy and user1. The users, rudy and users1 both would like to manage theirs own Tomcat instance but the Administrator of the server did not allow to duplicate the software/binaries.
rudy has /export/home/rudy as homedir
rudy decided /export/home/rudy/tomcat as CATALINA_BASE
user1 has /export/home/user1 as homedir
rudy decided /export/home/user1/tomcat as CATALINA_BASE
/opt/tomcat is CATALINA_HOME
root has to
cd /opt/tomcat
copy conf, logs, shared, temp, webapps and work
to /export/home/rudy/tomcat
and to /export/home/user1/tomcat
and of course change the ownership of the files to rudy and user1.
Now, Rudy and User1 can both start theirs own instances of Tomcat. The instances share the binaries located in /opt/tomcat but each instance has its own configuration in $CATALINA_BASE/conf.
Of course, you have to modify server.xml(both users) to avoid to use the same ports, ip addresses. Otherwise Tomcat will not start.
-rudy-
Showing posts with label Tomcat. Show all posts
Showing posts with label Tomcat. Show all posts
Friday, August 22, 2008
http connector / address
address
For servers with more than one IP address, this attribute specifies which address will be used for listening on the specified port. By default, this port will be used on all IP addresses associated with the server.
It happens in server.xml.
Example :
1) address="127.0.0.1"
Aug 22, 2008 3:18:47 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-127.0.0.1-18080
bash-3.00$ netstat -an | grep -i listen | grep 18080
127.0.0.1.18080 *.* 0 0 49152 0 LISTEN
2) address is not specified
Aug 22, 2008 3:19:26 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-18080
bash-3.00$ netstat -an | grep -i listen | grep 18080
*.18080 *.* 0 0 49152 0 LISTEN
*.18080 *.* 0 0 49152 0 LISTEN
Do you see the difference ?
-rudy-
For servers with more than one IP address, this attribute specifies which address will be used for listening on the specified port. By default, this port will be used on all IP addresses associated with the server.
It happens in server.xml.
Example :
1) address="127.0.0.1"
Aug 22, 2008 3:18:47 PM org.apache.coyote.http11.
INFO: Starting Coyote HTTP/1.1 on http-127.0.0.1-18080
bash-3.00$ netstat -an | grep -i listen | grep 18080
127.0.0.1.18080 *.* 0 0 49152 0 LISTEN
2) address is not specified
Aug 22, 2008 3:19:26 PM org.apache.coyote.http11.
INFO: Starting Coyote HTTP/1.1 on http-18080
bash-3.00$ netstat -an | grep -i listen | grep 18080
*.18080 *.* 0 0 49152 0 LISTEN
*.18080 *.*
Do you see the difference ?
-rudy-
Subscribe to:
Posts (Atom)