Apache Tomcat (sometimes simply referred to as Tomcat) is a popular open-source web server software used to set up Java-based server environments. The technologies used in Tomcat include Java Servlet, Java Server Pages, Java Expression Language, and WebSocket and provides an HTTP server environment ideal for running Java-based applications. In this article, we will outline how to install Tomcat on your CentOS 7 server. Please note, in order to perform the instructions on this guide, you will need root SSH access to your VPS or Dedicated server.
Before you begin, make sure you have installed Java.
Topics Include:
Please note that this article only pertains to Private Cloud and Bare Metal servers. Also, Control Web Panel (CWP) users can install this in a few clicks.
Installing Apache Tomcat
- First, ensure your machine and all related packages are up-to-date with the following commands:
- Next, create a tomcat user and add it to the tomcat group with the following commands:
- Next, change back to the home directory and download the Tomcat .tar file using the following commands:
Note: You will want to check the official Apache website for the latest stable release of the Tomcat software.
- Once it has finished downloading, extract the Tomcat archive using the following command:
- Once the extraction finishes, update the file permissions with the following commands:
- Next, you will need to set up a systemd unit file using the following command to open a text editor:
- With the text editor open, add the following code:
- Press Crtl + X to save and quit the text editor.
- Next, you will need to install and enable the haveged utility for security using the following commands:
- Once that is done, you can start Tomcat and enable it to start on reboot with the following commands:
Configuring Apache Tomcat
- Now that Tomcat has been installed, you will need to configure the firewall to allow browser access using the following commands:
- In order to start using the Tomcat Graphical User Interface (GUI), you will need to configure the users file with a new username and password. In this example, replace newusername and newpassword with the username and password you want to use to log in to Tomcat.
Within: Insert: - Restart Tomcat
Testing Apache Tomcat
To test your Tomcat installation, you can simply visit your server IP followed by :8080. If the installation was successful, you should immediately see the login page.
Experience unrestricted processing power on state-of-the-art hardware and your preferred operating system with Bare Metal Hosting!
Ubuntu, Debian, OpenSUSE, or Load your own OS
Unmanaged Hosting
Perfect for SysAdmins
Dedicated Resources
Ho to remove the 8080 from the url?
I found some posts via online search, where they discuss using port 443 with an SSL, or using a proxy.