Install Tomcat server on Ubuntu 16

Date Posted:05-04-2016

Tomcat is a webserver used to deploy java application. We will install tomcat server 8 version and java 1.8 version on Ubuntu Host.

Implementation:

Before installing tomcat or java, we will perform system upgrades on host.

apt-get update

apt-get upgrade

Install tomcat8 on the host. This will install additional packages. Just press to install all the dependencies.

apt-get install tomcat8

Install web-based application tools, document for tomcat.

apt-get install tomcat8-docs tomcat8-examples tomcat8-admin

Start the tomcat application and enable tomcat application on boot up.

systemctl start tomcat8

systemctl enable tomcat8

The default installation location will be /var/lib/tomcat8/conf/.

Open the tomcat-users.xml file and add web based manager gui and admin gui to be protected by password authentication.

The lines should be added before </tomcat-users>

vi /var/lib/tomcat8/conf/tomcat-users.xml

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

Replace username and password as per your wish.

Restart tomcat8 service.

systemctl restart tomcat8

Default port for tomcat application is 8080.  You can access the tomcat interface by using the IP address

http://IPaddress:8080/manager/html

If you followed this post then default username is admin and the password is password  to access tomcat8 manager-gui.

The interface will appear as shown in below fig.

 

 

 

 

 

 

 

Leave a Reply