Skip navigation.

Install Tomcat 5.5 in Debian and Ubuntu

, ,

1. Necessary packages
apt-get install tomcat5.5 tomcat5.5-admin tomcat5.5-webapps


2. Directories
/usr/share/tomcat5.5/
/usr/share/tomcat5.5-webapps/
/etc/tomcat5.5
/var/lib/tomcat5.5
/var/log/tomcat5.5


3. Remember to export JAVA_HOME, for example (put in .bashrc)
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-1.5.0.11/

Launch tomcat5.5 using
sudo /etc/init.d/tomcat5.5 start
sudo /etc/init.d/tomcat5.5 restart


4. Problem: Can't start tomcat5.5 in ubuntu
Here is the solution:
$ cd /usr/share/tomcat5.5/logs 
$ sudo mv catalina.out catalina.out.old
$ sudo touch catalina.out
$ sudo chown tomcat55:nogroup catalina.out 


5. Configuration for using Tomcat Manager (http://localhost:8180/manager/html) and Tomcat Administration (http://localhost:8180/admin).
Edit /usr/share/tomcat5.5/conf/tomcat-users.xml and include the following:
<user username="myname" password="mypassword" roles="manager"/>
<user username="myname" password="mypassword" roles="admin"/>


6. Problem of using Tomcat Administration in Debian
Solution:Add the following to the ‘/etc/tomcat5.5/policy.d/50user.policy’
// to activate the admin-interface
// http://lists.alioth.debian.org/pipermail/
// pkg-java-maintainers/2006-November/009749.html
grant codeBase “file:/usr/share/struts1.2/struts.jar” {
permission java.security.AllPermission;
};


7. Configure webapps
Recently when Debian upgrades tomcat5.5, all webapps configurations are deleted, only admin and manager apps remain in localhost configuration. This is a really annoying behavior for Debian package update. However, Debian update did notice that I changed tomcat-users.xml, 40webapps.policy and 50users.policy, so I had a chance to keep my old configuration.

For restoring all my webapps,
ln -s /usr/share/tomcat5.5-webapps/anywebapp.xml 
/usr/share/tomcat5.5/conf/Catalina/localhost/anywebapp.xml

Gaming in LinuxVim Tips

Comments

Anonymous 2. October 2007, 08:41

Martin writes:

Hi,
great tutorial!
I had problems with tomcat and couldnt figure out why.
Everything seemed fine when I started it but I couldnt connect.
Solution was changing the catalina.out as you explained!

Thanks a lot!

Anonymous 19. October 2007, 10:21

Egon writes:

Nice summary! Cheers!

Anonymous 9. November 2007, 01:12

Marco writes:

There's a small error in step 5



subjam 9. November 2007, 01:57

Hi, Marco,

Thank you for pointing out the typo!

Anonymous 21. November 2008, 17:12

Adam writes:

It works, but only if I run Tomcat as root. Since a tomcat55 user is created when I installed Tomcat, I had assumed it would run as that user.

Is there any way to have Tomcat run as tomcat55 instead of root?

Anonymous 22. May 2009, 13:19

Rams writes:

while installing tomcat, the installation is stopped in jvm.dll

please provide any suggestion to install correctly

Anonymous 31. May 2009, 13:30

ajit writes:

great link.thanks...it really worked..

Anonymous 15. June 2009, 01:16

oscar writes:

EXCELENT!
CHEERS FROM CHILE

Anonymous 25. July 2009, 00:49

Dave writes:

Still Useful! Thanks!

Anonymous 18. August 2009, 19:14

ipxmax writes:

Excelent!!! Tanx =)

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies