-   Fedora (
-   -   tomcat home directory (

kpachopoulos 07-31-2005 04:06 PM

tomcat home directory
I've installed the tomcat-5 package on fedora 4. Where is the TOMCAT_HOME or CATALINA_HOME -why do they call it this way?-directory? It is mentioned everywhere, but i can not find any fedora specific info. Also "find / -name tomcat* " filled me with many pages and a variety of directories.

morleron 07-31-2005 04:36 PM

Re: tomcat home directory
While I'm not running Fedora Core 4 myself this sort of thing is common across the Linux/Unix world. TOMCAT_HOME and CATALINA_HOME are known as environmental variables. They need to be set before one attempts to use the software associated with them as they tell the software where to "find itself", as it were. There are two ways to set these variables, one permanent, the other good only for your current shell and any children spawned from it.

To keep things simple I'll only illustrate the Tomcat example. The Catalina variable is set using the same method, but possibly in a different directory. To temporarily set TOMCAT_HOME do the following:
1) cd to the directory in which the tomcat software is installed
2) execute the command "export TOMCAT_HOME=`pwd`". (Note that there are no spaces around the "=" sign. Also, don't use the " when entering the command)
3) you can check to make sure the variable is set by doing "echo $TOMCAT_HOME". If nothing is returned by this command recheck step 2 and make sure you have the syntax correct.

The above process sets the variable only for your current shell session and any children spawned from it. In order to set the variable permanently it's necessary to modify your .bashrc file. Note that these instructions apply only to the Bash shell, if you're not using Bash you'll need to modify thecommand syntax and filename accordingly.
1) Open your ~/.bashrc file using your editor of choice.
2) in another shell execute the steps given for setting the variable temporarily.
3) In your .bashrc editor you'll need to insert a new line at the bottom of the file (or wherever else is convenient for you.)
4) On the new line enter "export TOMCAT_HOME="
5) From the window in which you temporarily set the variable use your mouse to highlight the result of the "echo $TOMCAT_HOME" step.
6) Go back to your editor window and paste that result onto the end of the "export" line that you started in step 4.
7) Save your .bashrc file and you're set to go.
(Note: you can duplicate the above for the CATALINA_HOME variable)

The only thing that remains is to start another shell session. Doing this should read your new .bashrc file and set the TOMCAT_HOME variable. To test that it does simply do the "echo $TOMCAT_HOME" step. You should see a directory path that matches what you put in your .bashrc file. If you don't you may need to logout of your current session and login again for the changes to take affect.


iswc_technical 08-04-2005 03:07 PM

I don't know is the following going to help:-

I did a fresh install of FC4 recently along with tomcat5. What I have discovered is that /usr/share/tomcat5 seems to be a good 'representation' of a typical tomcat installation .

Within this directory you will see all the familiar sub-directories such as


The only different is that they are all symbolic link to elsewhere.

If you treat /usr/share/tomcat5 as where you install tomcat you should be okay..

For me I have got mod_jk (apache-tomcat) up and running together base on the above idea...

good luck


johnMG 08-05-2005 08:28 PM

I've been putting together a Java-on-Fedora faq:

Maybe the little Tomcat section at the end will be of use.

I haven't actually started using Tomcat yet, so I'm sure there's some environment variable issues I need to add to the faq. I'm hoping to do a lot of work with it this weekend. :)

ziox 04-01-2006 03:50 PM

Hi there
Is there a way to use file with tomcat5 the same way as Apache+mod_jk?
Or I still need to install mod_jk with tomcat5 to support ajpxx protocol, load balancing and so on?

iswc_technical 04-07-2006 02:33 PM

I can't remember exactly and I can't really say it for sure. I think you still need to install mod_jk to "plug in" with Apache. The reason I am "guessing" this way is because as far as I remembered mod_jk is in fedora-extra distro. If mod_jk isn't needed Fedora geeks will not have mod_jk in their fedora-extra distro.

Sorry for my reply being so unsure about things this is because I havn't be on the balls with Tomcat/Apache for a while...

good luck anyway


All times are GMT -5. The time now is 01:38 AM.