Prerequisites
• Ubuntu 8.04 (you can try with other ubuntu/debian, with other OS you have to install JVM in a different way)
Needed files:
• apache-tomcat-6.0.18.zip from http://tomcat.apache.org/download-60.cgi
-
sudo apt-get update
-
sudo apt-get upgrade
-
sudo apt-get install openjdk-6-jdk
unpack apache-tomcat-6.0.18.zip where you want (i used /usr/local/tomcat, change the following commands accordingly if you have used a different directory)
set JAVA_HOME environment variable:
-
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
-
export JAVA_HOME
start the server:
-
/usr/local/tomcat/bin/startup.sh
and try to navigate http://localhost:8080
stop the server:
-
/usr/local/tomcat/bin/shutdown.sh
if you need the init.d script use this (this automatically sets JAVA_HOME)
-
sudo nano /etc/init.d/tomcat
copy and paste the following
-
# Tomcat auto-start
-
#
-
# description: Auto-starts tomcat
-
# processname: tomcat
-
# pidfile: /var/run/tomcat.pid
-
-
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
-
-
case $1 in
-
start)
-
sh /usr/local/tomcat/bin/startup.sh
-
;;
-
stop)
-
sh /usr/local/tomcat/bin/shutdown.sh
-
;;
-
restart)
-
sh /usr/local/tomcat/bin/shutdown.sh
-
sh /usr/local/tomcat/bin/startup.sh
-
;;
-
esac
-
exit 0
make it executable
-
sudo chmod +x /etc/init.d/tomcat
then you can start/stop/restart tomcat in this way
-
/etc/init.d/tomcat start
-
/etc/init.d/tomcat stop
-
/etc/init.d/tomcat restart
and if you want to run at boot time run this command:
-
update-rc.d tomcat defaults
i suggest to add a default user changing the password for the tomcat admin page, to do this, edit the file:
-
sudo nano /usr/local/tomcat/conf/tomcat-users.xml
and add in the
-
<role rolename=”manager”/>
-
<user username=”manager” password=”password” roles=”manager”/>
follow this guide to run zk on this tomcat freshly installation
english
italiano
Ultimi commenti
RSS