install apache tomcat 8
How to Install Apache Tomcat 8 on Centos 7 / RHEL 7

This Tutorial is about How to Install Apache Tomcat 8 on Centos 7 or RHEL 7 using source code. Apache Tomcat is an Open-Source web server that is designed to serve Java Web Pages. It is widely deployed and powers various mission-critical web applications around the world.

Install Apache Tomcat 8

  1. First of all, you need to Update the system to the latest stable for that just type the following command.

2. After updating Check whether in your server java is installed or not with this following command.

Sample Output :

As you can see in my server java is already installed. If you didn’t got output like that means java is not installed.

Install Java

To install java on server just type the following command.

Create dedicated user for Apache Tomcat

3. Now, You have to Create a dedicated non-root user called “tomcat” who belongs to the “tomcat” group for security purpose.

With this command you created user ‘tomcat‘ who belongs to group ‘tomcat‘. You can cannot use this user account to login into the system. In this case, Home directory is “/opt/tomcat“. Here, The Apache tomcat program will reside.

Read :  Apache Virtual Hosting: IP Based Virtual Host in RHEL/Centos 7

 Download and Install Apache Tomcat

4. You can find the latest updates of Apache Tomcat release at Official Page. You can download latest version of Apache Tomcat from this link.

Type the following command to download and install Tomcat :

Set Permission

5. Before starting Apache Tomcat, You have to setup Proper permission for directory’s. for that just type the following commands.

Setup a Systemd unit File for Apache Tomcat

6. To start Tomcat from Command, you have to create unit file for Apache Tomcat. Just type this following command to create & configure Unit file.

Paste this lines in your tomcat.service unit file and then save it using :wq!

Security related Program : Install haveged

7. you should install haveged for security purpose, for that just type the following command.

Add Firewall Rule

8. To test Apache Tomcat in a web browser you have to modify firewall rule, for that type the following command.

To confirm port is added or not type the following command:

Start Apache Tomcat

  • Start the Apache Tomcat service from the following command :

  • To Automatically Start after reboot (Persist Apache Tomcat) :

Test Apache Tomcat

9. Now, You can test your Installation of Apache Tomcat by visiting the following URL in your browser.

To find ip of your server type the following command :

Preview :

install tomcat on centos 7

If you got this default Apache Tomcat Page that means you have successfully installed Apache Tomcat in your server.

That’s it, This is all about Installation of Tomcat 8 on Centos 7 / RHEL 7 (Linux) via source code. You can now deploy your own Java Application. If you want to ask any question about this Tutorial comment Below and always Remember to stay connected with the GeekyVaibhav.com for Latest updates about the Linux.

LEAVE A REPLY

Please enter your comment!
Please enter your name here