Configuring Tomcat in Ubuntu with Apache server running on it
Login with the root account. Check if java is already installed on the machine. If not, first install java on ubuntu.
Web get the apache-tomcat tar file from the below location
$ cd /tmp
$ wget http://apache.hoxt.com/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz
Untar the file
$ tar xvzf apache-tomcat-6.0.18.tar.gz
Move the tomcat file to a location of your choice
$ mv apache-tomcat-6.0.18 /usr/local/tomcat
Now, edit the profile setting to add JAVA_HOME setting
$ vi ~/.bashrc
Add the below line and save the file
Now restart tomcat
Another way to do this is to setup a shell script in /etc/init.d
$ vi /etc/init.d/tomcat
#Tomcat start, stop, restart
case $1 in
Save the file and given execute permission for the script. Check your path settings for JAVA_HOME and the tomcat file locations to ensure that the script executes as expected.
$ chmod 755 tomcat
Now you can start, stop, restart tomcat as
$ /etc/init.d/tomcat start
$ /etc/init.d/tomcat stop
$ /etc/init.d/tomcat restart
Test if Tomcat is running smoothly by going to
It should show the welcome screen from Apache Tomcat.
Note that Tomcat takes up the port 8080 for its applications by default. You can configure Tomcat to run as several instances as well.