Installing Tomcat Debian


Ensure that you have Java installed first, read my previous Blog to give you the instructions just in case you don’t have Java and JAVA_HOME must be set.

Download Tomcat and unzip in the normal way.

Tips

gzip -d xxxxxxx

tar xvf xxxxxxx

Once unpackaged then copy or move to the /opt

mv apache-tomcat-6.0.29 /opt/tomcat

Create the startup file tomcat and add the lines below

vi /etc/init.d/tomcat

#!/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

Issue the command so tomcat start on boot

update-rc.d tomcat defaults

If you want run the web admin then a ser need to be setup

vi /opt/tomcat/conf/tomcat-users.xml

<role rolename=”manager”/>
<role rolename=”admin”/>
<user username=”YOUR_USERNAME” password=”YOUR_PASSWORD” roles=”admin,manager”/>

Tomcat starts on port 8080, if you have something already running on this then

vi /opt/tomcat/conf/server.xml

and change the lines to read
<Connector executor=”tomcatThreadPool”
port=”8181″ protocol=”HTTP/1.1″
connectionTimeout=”20000″
redirectPort=”8443″ />

In this example i have chosen 8181

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s