• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to install Apache Tomcat 9 in CentOS

{{postValue.id}}

To install Apache Tomcat 9 in CentOS

Apache Tomcat is an open-source web server and servlet container is used to serve JAVA application. It follows Java EE specifications and provides a HTTP web server. Installation of Apache tomcat 9 in CentOS is explained in this manual.

Installation of Apache Tomcat 9

First install the java 8 package with the following command.

[root@linuxhelp Desktop]# yum install java-1.8.0
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
 * base: centos.excellmedia.net
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
updates/7/x86_64/primary_db          
.
.
.
Dependency Updated:
  tzdata-java.noarch 0:2016f-1.el7                                                                            
Complete!


Then run the below command to check the version of Java.

[root@linuxhelp Desktop]# java -version
openjdk version " 1.8.0_101" 
OpenJDK Runtime Environment (build 1.8.0_101-b13)
OpenJDK 64-Bit Server VM (build 25.101-b13, mixed mode)

Now run the below link in the terminal to download the latest tomcat package.

[root@linuxhelp Desktop]# wget http://www-eu.apache.org/dist/tomcat/tomcat-9/v9.0.0.M21/src/apache-tomcat-9.0.0.M21-src.tar.gz
--2016-08-23 14:34:29--  http://www-eu.apache.org/dist/tomcat/tomcat-9/v9.0.0.M9/bin/apache-tomcat-9.0.0.M9.tar.gz
Resolving www-eu.apache.org (www-eu.apache.org)... 88.198.26.2, 2a01:4f8:130:2192::2
.
.
.
100%[====================================================================> ] 9,322,413    439KB/s   in 23s    

2016-08-23 14:34:52 (390 KB/s) - ‘ apache-tomcat-9.0.0.M21-src.tar.gz’  saved [9322413/9322413]


Extract the downloaded package in respective location.

[root@linuxhelp Desktop]# tar -xvf apache-tomcat-9.0.0.M21-src.tar.gz -C /opt/
apache-tomcat-9.0.0.M9/conf/
apache-tomcat-9.0.0.M9/conf/catalina.policy
apache-tomcat-9.0.0.M9/conf/catalina.properties
apache-tomcat-9.0.0.M9/conf/context.xml
.
.
.
apache-tomcat-9.0.0.M9/bin/startup.sh
apache-tomcat-9.0.0.M9/bin/tool-wrapper.sh
apache-tomcat-9.0.0.M9/bin/version.sh


Next move the extracted package to the new directory.

[root@linuxhelp Desktop]# cd /opt/
[root@linuxhelp opt]# mv apache-tomcat-9.0.0.M21/ tomcat/


Here use the below command to add and execute the configuration file.

[root@linuxhelp opt]# echo " export CATALINA_HOME=' /opt/tomcat/' "  > >  ~/.bashrc
[root@linuxhelp opt]# source ~/.bashrc


Now you can start the tomacat service with the below steps.

[root@linuxhelp ~]# cd /opt/tomcat/bin/
[root@linuxhelp bin]# ./startup.sh
Using CATALINA_BASE:   /opt/tomcat/
Using CATALINA_HOME:   /opt/tomcat/
Using CATALINA_TMPDIR: /opt/tomcat//temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /opt/tomcat//bin/bootstrap.jar:/opt/tomcat//bin/tomcat-juli.jar
Tomcat started.


If you want to stop the tomcat server, Run the below command to stop the tomacat service.

[root@linuxhelp ~]# cd /opt/tomcat/bin/
[root@linuxhelp bin]# ./shutdown.sh


Finally, configure the tomcat port in firewall and reload it with the below command.

[root@linuxhelp bin]# firewall-cmd --permanent --zone=public --add-port=8080/tcp
success
[root@linuxhelp bin]# firewall-cmd --reload 
Success


Open the browser and enter your server IP with port number to access the Apache tomcat.

1

Tags:
jackson
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

How to install Apache Tomcat 9 LinuxMint?

A

For the installation of Apache Tomcat 9 on Linuxmint, use the following link as given below "https://www.linuxhelp.com/how-to-install-tomcat9-on-linuxmint-18-3/"

Q

How to install Apache Tomcat 9 on FreeBSD?

A

For the installation of the Apache Tomcat on FreeBSD, use the following link as given below, "https://www.linuxhelp.com/how-to-install-tomcat-in-freebsd/"

Q

How to download the Apache Tomcat from officially?

A

For download the Apache Tomcat from officially as use the following link as given below "https://tomcat.apache.org/download-80.cgi"

Q

Who is responsible of Tomcat?

A

The Apache Software Foundation. The Apache Software Foundation is an umbrella organization that looks after a number of Open Source projects.

Jakarta is the group name for the Java based projects of the Apache Software foundation.

Tomcat is a Web Server that handles server side Java (in the form of Servlets and JSPs), and it’s a part of the Apache Jakarta project group. Tomcat is the “reference” implementation of the Servlet and JSP standards – in other words, if it runs under Tomcat, it should run under any compliant Servlet / JSP container.

Q

What is the Tomcat default port?

A

The default port for Tomcat is 8080. You can change the default port by editing the file server.xml under the conf folder in the Tomcat installed directory. Change the property Connector port=”8080″ to the desired port and restart Tomcat so the changes can take effect.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Isaiah ?
What is the use of SUID & SGID commands

How to set the special permissions to the files and folders using SUID and SGID commands...

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.