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.
Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will...
Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you...