In my previous post on June 25th 2009, I wrote about the installation and configuration of apache tomcat 6 on debian lenny. For single instance please see the post given below;
http://www.itoperationz.com/2009/06/how-to-install-and-configure-apache-tomcat-6-on-debian-5/
Here in this post, I am going to share the installation and configuration of multiple instances of Apache Tomcat 6 on Debian 5.0 Lenny. If you have followed the instructions given in the above post, Installation and configuration of Apache Tomcat’s multiple instances is just a piece of cake.
Please follow the instructions given below;
1. Download the latest Apache Tomcat from the under given location;
2. http://apache.siamwebhosting.com/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz
3. Untar the source at any location you like; (but remember you have to put those addresses in a file to make a service for apache tomcat)
4. I will use the location given below;
5. /opt/tomcat1 (For the second instance of apache tomcat
6. Remember the first instance path /opt/tomcat
7. Changes in server.xml file
8. /opt/tomcat1/conf/server.xml
9. Please change the default ports to some other because the first instance of Apache Tomcat 6 is running on the default ports
10. Changes are given as under;
11.
<Connector port=”8081″ protocol=”HTTP/1.1″ Change port from 8080 to 8081
connectionTimeout=”20000″
redirectPort=”8444″ /> Change port from 8443 to 8444
<Connector executor=”tomcatThreadPool”
port=”8081″ protocol=”HTTP/1.1″ Change Port from 8080 to 8081
connectionTimeout=”20000″
redirectPort=”8444″ /> Change port from 8443 to 8444
<Connector port=”8010″ protocol=”AJP/1.3″ redirectPort=”8444″ /> Change ports from 8009 to 8010 and 8443 to 8444
12. Changes in user.xml file
13. /opt/tomcat1/conf/tomcat-users.xml
14. <tomcat-users>
<role rolename=”manager”/>
<role rolename=”admin”/>
<user username=”manager” password=”test1″ roles=”admin,manager”/>
</tomcat-users>
16. Change the user name, password and roles according to your needs;
17. Create a new file with the name of /etc/init.d/tomcat1
18.
#!/bin/sh
# Tomcat Init-Script
case $1 in
start)
sh /opt/tomcat1/bin/startup.sh
;;
stop)
sh /opt/tomcat1/bin/shutdown.sh
;;
restart)
sh /opt/tomcat1/bin/shutdown.sh
sh /opt/tomcat1/bin/startup.sh
;;
esac
exit 0
19. Change the user rights to 0755 by using chmod 0755 /etc/init.d/tomcat1
20. Now add the newly created file in debian startup by using rcconf
If everything goes according to the above given instructions your multiple instances of Apache tomcat 6 on Debian 5 Lenny are ready to use;
Please feel free to send me your comments about this post.