Ubuntu 8.04 LTS + openjdk6 + apache-tomcat-6.0.18
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
1 2 3 |
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:
1 2 |
JAVA_HOME=/usr/lib/jvm/java-6-openjdk export JAVA_HOME |
start the server:
1 |
/usr/local/tomcat/bin/startup.sh |
and try to navigate http://localhost:8080
stop the server:
1 |
/usr/local/tomcat/bin/shutdown.sh |
if you need the init.d script use this (this automatically sets JAVA_HOME)
1 |
sudo nano /etc/init.d/tomcat |
copy and paste the following
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# 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
1 |
sudo chmod +x /etc/init.d/tomcat |
then you can start/stop/restart tomcat in this way
1 2 3 |
/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:
1 |
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:
1 |
sudo nano /usr/local/tomcat/conf/tomcat-users.xml |
and add in the
1 2 |
<role rolename=â€managerâ€/> <user username=â€manager†password=â€password†roles=â€managerâ€/> |
follow this guide to run zk on this tomcat freshly installation
5 risposte
Thank you, this was very useful.
glad to see that helps
grazie, dopo essermi imbattuto in mille casini, mi son accorto dell’articolo. Complimenti per l’articolo, bellissimo e semplicissimo!!
io come al solito son come san tommaso non mi rendo conto di una cosa finche non devo usarla.
ylcicdyo…
ylcicdyo…
i love to sail even if we do not have our own sailboat “,*