How to install apache tomcat 8 on ubuntu 20.04

How to Install Apache Tomcat 8 on Ubuntu 20.04


Apache Tomcat is an open-source implementation of java servlet.It is a web server used to manage Java web-based applications. In this blog,you can find the steps to ease your installation process for Tomcat 8 on ubuntu 20.04

1. Update the machine by using the below command.

Update the machine by using the below command.

2. We need to install java to execute the java web application code. Open JDK is the default platform for java development in Ubuntu 20.04.

 install java to execute the java web application code

3. Create a tomcat group.

Create a tomcat group.

4. Next, create a tomcat user.

create a tomcat user.


Steps to Install Tomcat:



  1. Change to the /tmp directory for downloading your tomcat link.Change to the /tmp directory
  2. Use wget to download from the copied link. (https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.5/bin/)Use wget to download from the copied link
  3. Now the output will be like this.

Now the output will be like this.

4.Make a directory /opt/tomcat to extract your tar file.Make a directory /opt/tomcat to extract your tar file.

5. Extract your downloaded file.

Extract your downloaded file.

Update Permissions:

1. Change directory into /opt/tomcat

Change directory into /opt/tomcat

2. Give tomcat group ownership over the entire installation Give tomcat group ownership over the entire installation

3. Now, give the tomcat-users access to the conf directory.Now, give the tomcat-users access to the conf directory.

give the tomcat-users access to the conf directory.

4. Make the Tomcat user the owner of the web apps, temp, logsMake the Tomcat user the owner of the web apps, temp, logs

5. Create tomcat service file in the /etc/ systemd/ system/ directoryCreate tomcat service file in the /etc/ systemd/ system/ directory

The following content has to be included in the file.

The following content has to be included in the file.

Save and then exit it.

1. Notify the system that you have created a new file.Notify the system that you have created a new file.

2. Start tomcat service.

Start tomcat service.

3. To know the status of the tomcat service, follow the below commands

To know the status of the tomcat service, follow the below commands

4. We need to adjust the firewall to allow our requests to get to the service. Allow traffic to that port by using UFW.

# sudo ufw allow 8080

5. Paste “http://your_IP_address:8080” in a web browser.

Paste “http://your_IP_address:8080” in a web browser.

Management Interface:

Configure the user data to be used for the log-in.

Configure the user data to be used for the log-in.

Add the below content in that one.

Add the below content in that one.

If you’re installing tomcat on a remote server and trying to access the manager and host manager, then follow the below instructions to disable few commands.

For manager:

 trying to access the manager and host manager

 

For host-manager:

image

For host-manager:

Save and exit now.

Now, enable and restart the tomcat service.

Now, enable and restart the tomcat service. 1

Now, enable and restart the tomcat service. 2

Now, browse the URL as shown below

http://IP_address:8080/manager/html

Now, browse the URL as shown below

Enter username and password in the field provided

Enter username and password in the field provided

To know the server information

To know the server information

Conclusion:

The above steps and commands illustrate the simple steps required for the successful apache tomcat 8 installation on ubuntu 20.04 is explained in detail.