Debian Admin - Your way to Debian World

November 27, 2007

How to setup Apache Tomcat 5.5 on Debian Etch

by @ 12:29 am. Filed under Webserver

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Apache Tomcat is a web container, or application server developed at the Apache Software Foundation (ASF). Tomcat implements the servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, providing an environment for Java code to run in cooperation with a web server. It adds tools for configuration and management but can also be configured by editing configuration files that are normally XML-formatted. Tomcat includes its own internal HTTP server.

First Sun JDK 5 need to be installed. It can be installed from Debian repository with unstable software

First you need to edit /etc/apt/sources.list file

#vi /etc/apt/sources.list

Add the following lines

# for sun-java packages in unstable
deb http://ftp.debian.org/debian/ unstable non-free
deb-src http://ftp.debian.org/debian/ unstable non-free

Save and exit the file.

Now you need to Update apt using the following command

#apt-get update

Install jdk using the following command

#apt-get install sun-java5-jdk

Check the java version using the following command

#java -version

Output looks similar to the following

java version “1.5.0_10″
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)

Installing Apache Tomcat

Install Tomcat using the following commands

#apt-get install tomcat5.5
#apt-get install tomcat5.5-admin
#apt-get install tomcat5.5-webapps

To verify that Tomcat is running just navigate to http://localhost:8180/ in your browser (make sure you have replaced ‘localhost’ with your server ip or name)

You can start/stop or restart Tomcat using following command:

#/etc/init.d/tomcat5.5 [start | stop | restart]

Configuring ‘admin’ and ‘manager’ applications

You need to configure some user to have admin and manager roles. For example you can do it with ‘tomcat’ user. Stop server using the following command.

#/etc/init.d/tomcat5.5 stop

Now you need to edit /var/lib/tomcat5.5/conf/tomcat-users.xml file to look like below

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="admin"/>
<role rolename="manager"/>
<role rolename="tomcat"/>
<user username="tomcat"
password=”tomcatpassword”
roles="tomcat,admin,manager"/>
</tomcat-users>

Save and exit the file.

Start tomcat using the following command

#/etc/init.d/tomcat5.5 start

Now you can use manager application at http://localhost:8180/manager/html.
Your user will be ‘tomcat’ and password will be ‘tomcatpassword’

Tags: , , , ,

You may also be interested in...

One Response to “How to setup Apache Tomcat 5.5 on Debian Etch”

  1. Yong Says:

    I followded those instructions and was able to run tomcat admin/manager (great!!!).
    But when I deployed my web app, the app failed to start. The only error I can see in catalina.log is:
    SEVERE: Error listenerStart

    How can I get more details about what causes the failure???

    Thanks!

    -Yong

Leave a Reply

Subscribe RSS Feed

subscribe to the Debian Admin RSS feed

Internal links:

Sponsors:



Categories:

Support Debian Admin

Amount $:
Website(Optional):

Sponsors:

Archives:

Related Links:


Favourite Sites:

Wordpress Collection
Windows Reference
Ubuntu Geek
DebianHelp
All About Debian Tutorials
Power Electrical
Check Your IP Here
Debian,Ubuntu News
DebCentral
Tuxmachines
Capnkirby
Libervis
Nuxifield
Linux Horizon
Linux Appfinder
Debuntu
GNU/Linux For Everyone
Free Penguin
DebianAdmin is not related to the Debian Project.
This site is copyright © 2006,2007 Debian Admin
All Trademarks are the property of their respective owners.
The contents of this website may not be mirrored or archived without the express written permission of DebianAdmin Site Owner.

DISCLAIMER: All the information, troubleshooting methods, utilities offered in this website is provided AS-IS, without any warranties. Though I strive for perfection, and always test the validity and effectiveness of the troubleshooting content in various systems, I assume no responsibility for your use of these Fixes, Utilities and other troubleshooting advice. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason. All use is completely at your own risk. Changes to the existing content and new additions are made to this website periodically, without notification.
Rodney's Kontera DynamiContext Plugin plugged in.