"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects." (Robert A. Heinlein)

Sunday, 29 March 2009

Apache Tomcat on my Linux server

I installed Apache Tomcat on my little Linux server (PIII-550Mz) since I'm going to test some java server application at home. I mainly based my installation on this howto with some little variation.
I first installed Java jdk 
 sudo apt-get install sun-java6-jdk
 Then I downloaded Apache Tomcat from my nearest mirror server
wget http://apache.fis.uniroma2.it/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz
 Then I installed it
tar -xzvf apache-tomcat-6.0.18.tar.gz
sudo mv apache-tomcat-6.0.18 /opt/
sudo ln -s /opt/apache-tomcat-6.0.18/ /opt/tomcat



 then I checked it was correctly installed by typing
cd /opt/apache-tomcat-6.0.18/
/bin/startup.sh
and verifying it's default page (http://192.168.30.100:8080/) in my browser window.
I then created an initialization script to make Tomcat automatically start
sudo vim /etc/init.d/tomcat
 here is the initialization file content
#!/bin/sh
# Tomcat Init-Script
case $1 in
start)
sh /opt/tomcat/bin/startup.sh
;;
stop)
sh /opt/tomcat/bin/shutdown.sh
;;
restart)
sh /opt/tomcat/bin/shutdown.sh
sh /opt/tomcat/bin/startup.sh
;;
esac
exit 0
 and at last I installed the script file
sudo chmod +x /etc/init.d/tomcat
sudo update-rc.d tomcat defaults
I eventually verified that everything was correctly starting by typing:
sudo /etc/init.d/tomcat start
Next time I'll continue, with the original howto thrack,with integration between Tomcat and Apache2 (which is already running in my server)