The Apache Software Foundation, also known as ASF recently released Apache Tomcat server 9 on December 8, 2016. Tomcat server implements Java servlet and Java servlet technologies like JSP Java WebSocket. Apache Tomcat is an open-source web server and servlet container that is used to serve Java applications.
It is developed by the Apache Software Foundation, written in Java and released under Apache License 2.0.
Tomcat 9 does not require any special kind of hardware it will need a CentOS server, IP Address of your server and root privileges on the server.
Before installing Tomcat we will have to install Java Development Kit (JDK) on our system but it is recommended that you update the system and available packages before installing JDK. Run the following command to update system.
yum -y update
Now once the system is updated install JDK and to do so run following command:
Move all the files that are in the apache-tomcat-9.0.0.M15 directory to the tomcat directory to do so run following command :
mv apache-tomcat-9.0.0.M15/* tomcat/
Now change the proper ownership using the following command:
chown -hR tomcat:tomcat tomcat
We recommend you to run a short testing on Tomcat to make sure that there is no error and it is installed successfully so follow the below-given process.
Run below given command :
Currently, Tomcat is using port number 8080 so check the open port using netstat command as shown:
You can check this using a web browser with http://yourserver_IP:8080 then you'll see the homepage of Apache Tomcat Server but we recommend you to use browser later at final testing because we will run Tomcat with a systemd service file in the final configuration.
Now run following commands :
cd /opt/tomcat/bin/./shutdown.shchown -hR tomcat:tomcat /opt/tomcat/
Creating a systemd Service File
Now you'll need to create a systemd service file to run Apache Tomcat as a tomcat user. Creation of a systemd service file is recommended for easy starting and stopping the service.
Run following command :
Add the content below into nano text editor, you can simply copy/paste this into the file:
Open your web browser and visit server with port number 8080 http://YourserverIPaddress:8080 then you'll see the homepage of Apache Tomcat like shown below:
HP_NO_IMG/data/uploads/users/744ed2f1-2baa-42b2-b09d-ad15a2ae3934/241207610.png" alt=" " />
Click on the Manager app on the top right side of your screen then you'll be asked to username and password for authentication enter your username and password and you will see manager dashboard like this:
You can manage your Java applications using the Tomcat Web Application Manager. It is also used to Start, Stop, Reload, Deploy. You can also diagnostics on your apps using Tomcat Web Application Manager.
Now go to the host manager and here you'll be again asked to enter a username and password so repeat the above procedure and click on login you'll see a virtual host manager dashboard like this:
In this tutorial, we have learned how to install and configure Apache Tomcat 9 server on a CentOS system very easily and we hope that now after this guide you have enough knowledge to work with Tomcat 9.
Looking for the right web hosting solution for your website can be an intimidating task. Options nowadays are more diversified than ever, and each year brings new developments in the web hosting market. If you have no clue of what to look out for, you can find yourself overwhelmed with...
Content marketing continues to be one of the most valuable tools for today’s online businesses. With content, you can improve your chances of reaching your target audience, boost your search engine standing, and even unlock new opportunities for sales. The more content you produce, the more you can strengthen your...
User Experience (UX) is one of the most crucial factors to consider in web design. As the number of websites and applications in the world today continues to accelerate, businesses are under more pressure than ever to impress customers straight away. If a user visits your website and finds slow-loading...