Install of Tomcat 5.5 on Ubuntu (using apt) leaves CATALINA_HOME unset

196

Solution 1

  1. The path where your Tomcat is installed. I don't know, I am on openSUSE, and usually install tomcat in my preferred directory, most likely under my /home/adeel/. You can check it using whereis tomcat command on your console, or may be try whereis catalina. It might give you the path of your tomcat. This time I am running tomcat under my Netbeans, just for a try, and didn't set the environment variable.

  2. You may just copy the war file under the CATALINA_HOME/webapps/ directory. Or you can even place it exploded. I don't think you would need to change the privileges of your war.

  3. You can set it in CATALINA_HOME/webapps/tomcat-users.xml. Below is the example,

    <?xml version='1.0' encoding='utf-8'?>

    <tomcat-users>
    <role rolename="manager"/>
    <role rolename="tomcat"/> <user username="tomcat" password="tomcat" roles="tomcat,manager"/>

    </tomcat-users>

  4. Not really. The only suggestion I have in my mind at the moment is, to set it as user-variable, not in system-variable.

NOTE: In case you are using Tomcat under Netbeans, number of tomcat configuration is provided within the IDE, for example, you can change the port, username/password, VM options, etc. Beware Netbeans keep its own place and file for web-app deployment in Tomcat, and doesn't use CATALINA_HOME/webapps/.

Solution 2

You have to add it manually. You can either do it in the file:

 ~/.bashrc  <---- for session-wide variables
 /etc/environment <---- for system-wide variables

You should set CATALINA_HOME in here by adding the following line:

 CATALINA_HOME=PATH_TO_WHERE_YOU_ARE_RUNNING_TOMCAT

Afterwards, if you edited .bashrc, reload the file, by typing in:

 Source .bashrc

If it was /etc/environment, I believe you can do the same thing. If that doesn't work, try logging off then in. If that doesn't work, just restart.

Solution 3

You could do an "echo $CATALINA_HOME" to check if it has been defined or not.

It should be set to the installation directory of tomcat. Mine is set to /usr/local/tomcat

Are you using an IDE? I was able to provide a user name and password for admin when adding Tomcat as a server in NetBeans. You need to set the Catalina_Home first.

I had some trouble installing Tomcat on Ubuntu (through sudo apt-get install and synaptic manager) with NetBeans. The best option is to download the tar file (using wget) and extract it to your choice of path.

Share:
196
user3806649
Author by

user3806649

Updated on August 02, 2022

Comments

  • user3806649
    user3806649 almost 2 years

    I need to provide white list for Genymotion, so that only allowed apps could use internet access.

    As I need my own VPN application, the apps which need VPN access are not useful. Also I have try DroidWall and Android Firewall but some Genymotion devices like :Samsung Galaxy S8 and Google Nexus9 don't provide root access to firewall apps (It seems they are not rooted) and the other devices rule don't work since apps which are not in white list still have internet access when Firewall is Enabled.