HowTo: Tomcat6 on Ubuntu 8.04 (strato v-power server)
1. Make shure you have a java-jdk installed.
2. Download the actual tar.gz file from the tomcat homepage. (I used 'apache-tomcat-6.0.18.tar.gz')
3. unpack the tar.gz file and move it to /usr/local/tomcat
tar xvzf apache-tomcat-6.0.18.tar.gz
mv apache-tomcat-6.0.18 /usr/local/tomcat
4. create an init script for tomcat
nano /etc/init.d/tomcat
5. Paste the following code in that script.
(take care of the java path depending on your java installation
sun version: /usr/lib/jvm/java-6-sun
gcj version: /usr/lib/jvm/java-gcj)
#!/bin/bash
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export CATALINA_BASE=/usr/local/tomcat
export CATALINA_OPTS="-server -Xmx128m"
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
Save and exit ('Crtl+X', 'Y' and 'Enter').
You may want to allocate more RAM to CATALINA_OPTS (I would recommend 256MB). But I just have the cheapest version of the strato servers with just 256MB RAM guaranteed, so I have to do it smaller... ;-)
7. set the init script as startup script
chmod 755 /etc/init.d/tomcat
update-rc.d tomcat defaults
10. startup tomcat
Tomcat shuold now be ready for startup
type in the shell:
/etc/init.d/tomcat start
when you now enter the following url into your browser you should see your tomcat running:
http://your_server:8080/
The string 'your_server' should be substituted by 'localhost' or the remote servers IP addres or domain name you installed tomcat on.
Have fun with JavaEE on your server! :)
