How to Install Apache Tomcat on Ubuntu Remote Server – Vultr Hosting Example

install-java-in-linux-remote-server-with-vultr-hosting-vps-feature-image

In the tutorial, we show you how to install Apache Tomcat server on Ubuntu Remote Server with Vultr Hosting example.

Related post:
How to install Java in Ubuntu Remote Server – Vutr Hosting VPS Example

Technologies

– Ubuntu 18.10 x64
– Tomcat 9.0.13
– Vultr Hosting

Install Apache Tomcat

Create Vultr Vps

Follow the link to create a Linux Vultr VPS.

install-java-in-linux-remote-server-with-vultr-hosting-vps-tom-cat-server-information

Use Putty to login Vultr VPS:

install-java-in-linux-remote-server-with-vultr-hosting-vps-tom-cat-putty-access

Install Java

Tomcat requires Java to be installed. We can install Open JDK or Oracle Java for development.

Follow below post for Java Installation:
Install Java in Ubuntu Remote Server – Vutr Hosting VPS Example

Check Java version by cmd:

Create Tomcat User

We need a new tomcat user for security purposes.

Install Tomcat

Download the latest binary release of Tomcat 9 from Tomcat Download page:

Extract the Tomcat archive & move it to the /opt/tomcat directory:

Create a symbolic link latest which will point to the Tomcat installation directory:

-> For upgrade Tomcat installation, just simply unpack the newer version and change the symlink to point to the latest version.

Change the directory /opt/tomcat/latest ownership to user and group tomcat:

Setup Tomcat as a Service

Create a tomcat.service as below:

Content of tomcat.service as below:

Use below cmd to findout JAVA_HOME:

Save the file and notify systemd for the new tomcat.service changed:

Start Tomcat service:

Check the service status:

-> Output:

install-java-in-linux-remote-server-with-vultr-hosting-vps-tomcat-status

To be automatically started at boot time, Enable the Tomcat service:

Configure Tomcat Web Management

Add new user to tomcat-users.xml to access the Tomcat web interface:

– Open tomcat-users.xml by cmd ->

sudo nano /opt/tomcat/latest/conf/tomcat-users.xml

– Add admin user ->

To access the web interface from any IPs address,

-> Manager app, open file: sudo nano /opt/tomcat/latest/webapps/manager/META-INF/context.xml
-> For the Host Manager app, open file: sudo nano /opt/tomcat/latest/webapps/host-manager/META-INF/context.xml

Then change context.xml as below:

We can control specific address IPs for accessing with | operator as below:

Now restart Tomcat service to take the effect: sudo systemctl restart tomcat

Check Results

Access Tomcat ->

install-java-in-linux-remote-server-with-vultr-hosting-vps-tom-cat-dashboard

Server Status ->

install-java-in-linux-remote-server-with-vultr-hosting-vps-tom-cat-server-status

Tomcat Web Application Manager ->

install-java-in-linux-remote-server-with-vultr-hosting-vps-tom-cat-manager-app

Tomcat Virtual Host Manager ->

install-java-in-linux-remote-server-with-vultr-hosting-vps-tom-cat-host-manager

By grokonez | November 24, 2018.



Related Posts


Got Something To Say:

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

*