Question

I want to test my current application on Tomcat running on LINUX.

Was it helpful?

Solution

Click here to see the instructions for how to deploy a WAR file to Tomcat 5.5.

Alternately, check your {tomcat}\conf\server.xml file for the Host node and refer to the appBase attribute as follows:

<Host name="localhost" appBase="{THIS VALUE REPRESENTS A FILE PATH WHERE YOU CAN DROP YOUR WAR FILE MANUALLY}"
  unpackWARs="true" autoDeploy="true"
  xmlValidation="false" xmlNamespaceAware="false">

OTHER TIPS

I figured out the solution in my own way and hope this helps for someone who is looking for the same.

1) To create a war file from eclipse, Right click on MyApp>export>war file>browse for the destination path>Finish

2) Download Apache Tomcat Server 5.5 from http://tomcat.apache.org/ and extract (Install) the tar.gz to a desired folder.

3) Make sure that java environment variables (JAVA_HOME and PATH) are configured in your machine.

$ echo $JAVA_HOME

If not, go ahead and add them to the bash_profile or bashrc with the JDK or JRE absolute path.
For example: 
$ which java
/usr/bin/java
$ ls -l /usr/bin/java
lrwxrwxrwx. 1 root root 22 Jan 24 13:11 /usr/bin/java -> /etc/alternatives/java
$ ls -l /etc/alternatives/java
lrwxrwxrwx. 1 root root 42 Jan 24 13:11 /etc/alternatives/java -> /usr/lib/jvm/jre-1.6.0-ibm.x86_64/bin/java

4) Add below lines to bash_profile or bashrc by giving

$ gedit ~/.bashrc
$ export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-ibm.x86_64
$ export PATH=$PATH:/usr/lib/jvm/jre-1.6.0-ibm.x86_64/bin

5) Logout and Log back in to reflect the changes.

6) To start the Tomcat 5.5 server, go to the extracted folder (apache_tomcat_5.5.XX) which is mentioned in step2. apache_tomcat_5.5.XX/bin --> Right click --> open in terminal --> ./startup.sh

 If the server could not and complains about permissions, add the execute permission to the .sh files by using
 chmod 700 *.sh (Your terminal should point at tomcat's bin folder)

7) After starting up the server, enter localhost:8080 in your browser. If you see the Tomcat's home page, then you have succesfully configured the tomcat server setup.

8) To access manager module of Tomcat, you have to add the below lines in apache_tomcat_5.5.XX/conf/tomcat-users.xml

  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="admin" password="admin" roles="admin,manager"/>

Ignore this step if your xml is already configured with the manager roles by default.

9) Click Tomcat Manager on the left side menu under administration, enter admin as your username and password to get access to manager module.

10) Here you can select your buildcentral war file and deploy the same to the server. Click on the buildcentral link in the updated table to access the application from your browser.

PS: if you have any errors after the 10 step, you can see the log file for the runtime errors that are associated to your war file. Go to apache_tomcat_5.5.XX/logs/Catalina.out

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top