{"id":13296,"date":"2023-10-02T03:22:37","date_gmt":"2023-10-02T07:22:37","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=13296"},"modified":"2023-10-02T03:22:41","modified_gmt":"2023-10-02T07:22:41","slug":"how-to-install-apache-tomcat-10-on-centos-8-7-or-rocky-linux-8","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-install-apache-tomcat-10-on-centos-8-7-or-rocky-linux-8\/","title":{"rendered":"How to Install Apache Tomcat 10 on CentOS 8\/7 or Rocky Linux 8"},"content":{"rendered":"\n
Apache Tomcat is a widely-used open-source application server that is essential for running Java-based web applications. If you’re using CentOS<\/a> 8, CentOS 7, or Rocky Linux 8 and need to set up the latest version of Apache Tomcat, this guide is here to help. In this tutorial, we’ll walk you through the step-by-step process of installing Apache Tomcat 10 on your CentOS or Rocky Linux system.<\/p>\n\n\n\n Before we start with the installation, make sure you have the following prerequisites:<\/p>\n\n\n\n Always begin by ensuring that your system is up to date with the latest packages. Open a terminal and run:<\/p>\n\n\n\n Visit the official Apache Tomcat<\/a> download page to find the latest version of Tomcat 10. Copy the download link for the tar.gz file for your preferred version.<\/p>\n\n\n\n Replace Once the download is complete, extract the downloaded Apache<\/a> Tomcat archive:<\/p>\n\n\n\n It’s a good practice to move Apache Tomcat to the To ensure that Apache Tomcat runs smoothly, you need to set up environment variables. Create a new file for Tomcat environment variables:<\/p>\n\n\n\n Add the following content to the file, replacing Save the file and exit the text editor.<\/p>\n\n\n\n Apply the environment variables by running:<\/p>\n\n\n\n You can now start Apache Tomcat:<\/p>\n\n\n\n To ensure Tomcat starts automatically at boot, enable it:<\/p>\n\n\n\n If you have a firewall enabled on your server, open the HTTP and HTTPS ports to allow external access to Apache Tomcat:<\/p>\n\n\n\n You can access the Apache Tomcat Manager using a web browser by navigating to:<\/p>\n\n\n\n Replace You’ve successfully installed the latest Apache Tomcat 10 on your CentOS 8, CentOS 7, or Rocky Linux<\/a> 8 server. You can now deploy your Java<\/a> web applications and enjoy the benefits of this robust application server. If you encounter any issues or need further assistance, refer to the official Apache Tomcat documentation<\/a> or seek help from the Tomcat community.<\/p>\n","protected":false},"excerpt":{"rendered":" Apache Tomcat is a widely-used open-source application server that is essential for running Java-based web applications. If you’re using CentOS 8, CentOS 7, or Rocky Linux 8 and need to…<\/p>\n","protected":false},"author":1,"featured_media":13303,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,16],"tags":[58,121,327,433,449,1268,531,544,545,1267,591,635,636],"yoast_head":"\nPrerequisites:<\/h3>\n\n\n\n
\n
$ sudo yum install java<\/code><\/pre>\n\n\n\n
Step 1: Update Your System<\/h3>\n\n\n\n
$ sudo yum update<\/code><\/pre>\n\n\n\n
Step 2: Download Apache Tomcat 10<\/h3>\n\n\n\n
cd \/tmp\nwget https:\/\/downloads.apache.org\/tomcat\/tomcat-10\/v10.x.y\/z\/apache-tomcat-10.x.y.tar.gz\n<\/code><\/pre>\n\n\n\n
10.x.y<\/code> with the specific version number you want to install.<\/p>\n\n\n\n
Step 3: Extract Tomcat<\/h3>\n\n\n\n
$ tar -xzvf apache-tomcat-10.x.y.tar.gz<\/code><\/pre>\n\n\n\n
Step 4: Move Tomcat to \/opt Directory<\/h3>\n\n\n\n
\/opt<\/code> directory for better organization and system-wide accessibility:<\/p>\n\n\n\n
$ sudo mv apache-tomcat-10.x.y \/opt\/tomcat<\/code><\/pre>\n\n\n\n
Step 5: Configure Environment Variables<\/h3>\n\n\n\n
$ sudo nano \/etc\/profile.d\/tomcat.sh<\/code><\/pre>\n\n\n\n
10.x.y<\/code> with your Tomcat version:<\/p>\n\n\n\n
$ export CATALINA_HOME="\/opt\/tomcat"\n$ export PATH="$CATALINA_HOME\/bin:$PATH"<\/code><\/pre>\n\n\n\n
Step 6: Apply the Environment Variables<\/h3>\n\n\n\n
$ source \/etc\/profile.d\/tomcat.sh<\/code><\/pre>\n\n\n\n
Step 7: Start and Enable Tomcat Service<\/h3>\n\n\n\n
$ sudo systemctl start tomcat<\/code><\/pre>\n\n\n\n
$ sudo systemctl enable tomcat<\/code><\/pre>\n\n\n\n
Step 8: Adjust Firewall Rules<\/h3>\n\n\n\n
$ sudo firewall-cmd --permanent --zone=public --add-port=8080\/tcp\n$ sudo firewall-cmd --permanent --zone=public --add-port=8443\/tcp\n$ sudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n
Step 9: Access the Tomcat Manager<\/h3>\n\n\n\n
http:\/\/your_server_ip:8080<\/code><\/pre>\n\n\n\n
your_server_ip<\/code> with your server’s IP address. You’ll be prompted to enter the Tomcat manager credentials, which are defined in the
tomcat-users.xml<\/code> file located in the Tomcat
conf<\/code> directory.<\/p>\n\n\n\n
Conclusion:<\/h3>\n\n\n\n