Tuesday, March 26, 2013

Tomcat7 setup in Ubuntu 12.04 LTS

Installing Tomcat is easy using any linux package management tools, but once it is installed on Ubuntu 12.04 LTS you may not be able to access the deployed web application from outside that computer. It is because of firewall configuration, for this you need to allow the HTTP port on which tomcat is running.

ufw allow <port_number>

Install tomcat 7 using:
sudo apt-get install tomcat7

Tomcat7 web app location: /var/lib/tomcat7/webapps
Tomcat7 configuration location: /var/lib/tomcat7/conf

Tomcat7 Start/Stop:
sudo /etc/init.d/tomcat7 [stop/start/restart]

Allow Tomcat7 port (assume it is configured on 6040) for accessing deployed web application outside the hosted computer:
sudo ufw allow 6040