Installing tomcat on Ubuntu

How to find java version
Install Tomcat on CentOS 7

To install tomcat on Ubuntu 18.04, run

apt install tomcat9

Start tomcat with

systemctl start tomcat9

Once tomcat started, you will be able to see it at

http://your-ip-addr:8080/

You can verify tomcat running with netstat

root@magmito-server:~# netstat -lntp | grep java
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      2921/java           
tcp6       0      0 :::8080                 :::*                    LISTEN      2921/java           
root@magmito-server:~# 

Tomcat default home page is

/var/lib/tomcat9/webapps/ROOT/index.html

Some other folders

CATALINA_HOME=/usr/share/tomcat9
CATALINA_BASE=/var/lib/tomcat9

Deploying Application

You can upload war file to /var/lib/tomcat9/webapps folder. When you upload war file, it get auto extracted to the folder.

To deplay sample application, do following

cd /var/lib/tomcat9/webapps/
wget https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war

Now you will see “sample” folder (/var/lib/tomcat9/webapps/sample). You can access the application with url

http://your-ip-addr:8080/sample/

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *