I installed java7 and ApacheTomcat7 in my Ubuntu12.04, and download eclipse EE. And now I have to configure my eclipse with tomcat. For I want to find the tomcat installation directory. How can I find it. I installed java and tomcat using Ubuntu software centre.
1. Download the package "
apache-tomcat-7.0.6.tar.gz" from the below link
2. Now unpack it with the following command:
tar xvzf apache-tomcat-7.0.8.tar.gz
3. Then move to more appropriate directory, in our case in
/usr/share/tomcat7, but can be in any directory. We do this with the command:
sudo mv apache-tomcat-7.0.8/ /usr/share/tomcat7
4. Now define the environment variables
JRE_HOME. This file is in the "environment" in / etc. Command to edit the file:
sudo gedit /etc/environment
5. Here we record the routes where we have installed Java in my case this is as follows:
JAVA_HOME="/usr/local/jdk1.6.0_23" JRE_HOME="/usr/local/jdk1.6.0_23/jre" PATH="...(other path):$JAVA_HOME:$JRE_HOME"
6. IMPORTANT: Verify the routes where they have installed Java.
sometimes tomcat does not recognize, but a surefire way of recognizing that tomcat is to define the file paths inside "
catalina.sh" located in
tomcat7/bin. To modify this file use the command:
sudo gedit /usr/share/tomcat7/bin/catalina.sh
Now insert the
JRE_HOME after the first line, so the file is as follows:
#!/bin/sh JAVA_HOME="/usr/local/jdk1.6.0_23" JRE_HOME="/usr/local/jdk1.6.0_23/jre" # Licensed to the Apache Software Foundation (ASF)... #... #... ....
Now configure Tomcat users, this is done in the file "
tomcat7/conf. Command to edit the file:
sudo gedit /usr/share/tomcat7/conf/tomcat-users.xml
7. Unlike previous versions, the administrator should own role "manager" now it should be "
manager-gui"to operate on the web administration tomcat7. The file would be as follows:
<?xml version='1.0' encoding='utf-8'?> <tomcat-users> <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager"/> <role rolename="admin-gui"/> <role rolename="admin-script"/> <role rolename="admin"/> <user username="usuario" password="contrasena" roles="manager-gui,admin-gui,manager,admin,manager-script,admin-script"/> </tomcat-users>
8. For further info look here