r6 - 29 Mar 2006 - 12:41:16 - GarrySmithYou are here: TWiki >  Deploy Web  >  InstallationRequirements > DeployingTomcat

Simple instructions for deploying tomcat on unix/linux

- Download the tomcat bundle, e.g. into /tmp/jakarta-tomcat-5.0.19.tar.gz

- Extract it, e.g. :

       cd /tmp
       zcat /tmp/jakarta-tomcat-5.0.19.tar.gz | tar xf - 

- Copy the tomcat file tree to its final destination (in this example case, /usr/local/). You may have to do this as root if only root can write to the desired destination.

        cp -r /tmp/jakarta-tomcat-5.0.19 /usr/local

- Set the ownership of the entire tomcat file tree to reflect the user account in which tomcat will be run (we don't recommend running tomcat as root). In this example, we're using user id "agrid" and group id "agrid" :

        chown -R agrid:agrid /usr/local/jakarta-tomcat-5.0.19

- Use the instructions in the file RUNNING.txt, included in the toplevel directory of the tomcat distribution that you have just installed, to start and stop the server and check that it's running. (Do this while logged in as the tomcat user - "agrid" in this example - not as root!) This file also includes instructions for changing the port on which tomcat is run (by default, 8080) and for installing multiple copies of tomcat on the same server.

- Within tomcat, set up a user with privileges to allow administering and managing the tomcat server via its web interface. To do this, edit the file jakarta-tomcat-5.0.19/conf/tomcat-users.xml and add a suitable user:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
  <user username="agriduser" password="agridpasswd" roles="admin,manager"/>
</tomcat-users>
Here, we've added a user with name "agriduser" and password "agridpasswd". (This password is stored in plain text, so don't use a security-critical system password!) When you go to the manager or admin interfaces from tomcat's home page, you'll be prompted for this username and password to gain access. You'll also need to use this username and password when installing Astrogrid software using the deployment kit.

Running on a non-standard port

By default, tomcat runs on port 8080. If this port is blocked, or already in use, or if you want to run multiple tomcat installations on the same host, you will need to configure tomcat to run on a different port.

Here are the instructions from the tomcat distribution for how to do this (where $CATALINA_HOME is the toplevel directory in your tomcat file tree):

   To change [the default port], open the file:

       $CATALINA_HOME/conf/server.xml

   and search for '8080'.  Change it to a port that isn't in use, and is
   greater than 1024, as ports less than or equal to 1024 require superuser
   access to bind under UNIX.

   Restart Tomcat and you're in business.  Be sure that you replace the "8080"
   in the URL you're using to access Tomcat.  For example, if you change the
   port to 1977, you would request the URL http://localhost:1977/ in your browser

HOWEVER, you will probably find that simply changing this port is not enough and that multiple tomcats will fight over certain other ports.

I have attached a sample server.xml file to this page, showing which ports I needed to change in order to enable multiple tomcats to co-exist happily using the tomcat bundle we're distributing via the link above.

Search for "KEA" in the file and you'll find all ports that I changed from the default values to other values.

-- KonaAndrews - 24 Feb 2005

toggleopenShow attachmentstogglecloseHide attachments
Topic attachments
I Attachment Action Size Date Who Comment
xmlxml server.xml manage 17.3 K 10 Mar 2005 - 15:31 KonaAndrews Sample server.xml
Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r6 < r5 < r4 < r3 < r2 | More topic actions
 
AstroGrid Service Click here for the
AstroGrid Service Web
This is the AstroGrid
Development Wiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback