Tomcat 6 Ubuntu install for multiple instances

Install SUN JAVA6 JDK
[code lang="shell"]
root@h apt-get install sun-java6-jdk
[/code]
Install TOMCAT6 user instances
[code lang="shell"]
root@h: apt-get install tomcat6-user
[/code]
Add new user:
[code lang="shell"]
root@h: adduser tomcatA
[/code]
Create TOMCAT6 user instance:
[code lang="shell"]
tomcatA@h: tomcat6-instance-create tomcat
[/code]
Tomcat configure(port):
[code lang="shell"]
tomcatA@h: vim tomcat/conf/server.xml
[/code]
Tomcat start/stop:
[code lang="shell"]
tomcatA@h: ./tomcat/bin/startup.sh
tomcatA@h: ./tomcat/bin/shutdown.sh
[/code]
Add to autostart:
[code lang="shell"]
root@h: vim /etc/init.d/tomcatA
#!/bin/bash
# Tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid

export JAVA_HOME=/usr/lib/jvm/java-6-sun

case $1 in
start)
sudo -u tomcatA /home/tomcatA/tomcat/bin/startup.sh
;;
stop)
sudo -u tomcatA /home/tomcatA/tomcat/bin/shutdown.sh
;;
restart)
sudo -u tomcatA /home/tomcatA/tomcat/bin/shutdown.sh
sudo -u tomcatA /home/tomcatA/tomcat/bin/startup.sh
;;
esac
exit 0
[/code]
[code lang="shell"]
root@h: chmod +x /etc/init.d/tomcatA
[/code]
Update init.d scripts
[code lang="shell"]
sudo update-rc.d tomcatA defaults
[/code]

Komentarze

Popularne posty z tego bloga

Set up JBoss AS 5.1.0 and Seam 2.2.0 in Ubuntu 9.04