• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to install Apache Tomcat 9 in CentOS

718

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

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.

Related Tutorials in How to install Apache Tomcat 9 in CentOS

Related Tutorials in How to install Apache Tomcat 9 in CentOS

How to install Apache Tomcat9.0.27 on opensuse15.1
How to install Apache Tomcat9.0.27 on opensuse15.1
Oct 31, 2019
How to install and Configure Apache Tomcat 8.0.23
How to install and Configure Apache Tomcat 8.0.23
Apr 29, 2016
How to install Tomcat in Freebsd
How to install Tomcat in Freebsd
Oct 25, 2016
How to install Apache tomcat 9.0.6 on centos 7
How to install Apache tomcat 9.0.6 on centos 7
May 16, 2018
How To Install Tomcat9 On Linuxmint 18.3
How To Install Tomcat9 On Linuxmint 18.3
May 14, 2018
How to install Jenkins in Linux
How to install Jenkins in Linux
Jul 6, 2016
How to Install Apache Tomcat 9.0.21 on Ubuntu 19.04
How to Install Apache Tomcat 9.0.21 on Ubuntu 19.04
Jun 26, 2019
How to install Apache Tomcat 9 in CentOS
How to install Apache Tomcat 9 in CentOS
Sep 8, 2016

Related Forums in How to install Apache Tomcat 9 in CentOS

Related Forums in How to install Apache Tomcat 9 in CentOS

Apache tomcat
AadrikaAnshu class=
Cannot find ./catalina.sh The file is absent or does not have execute permission This file is needed to run this program
Jun 17, 2019
Apache tomcat
alexander class=
how to configure two apache instances in CentOS
Apr 25, 2017
Apache tomcat
AadrikaAnshu class=
BASH: ./startup.sh: Permission denied On CentOS 7.6
Jun 17, 2019
Apache tomcat
elijah class=
installation for tomcat and httpd is same or not
May 6, 2017
Apache tomcat
benjamin class=
two apache in one machine
Apr 7, 2017
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 Gibbson ?
How do i run both nginx and apache in same instance on centos

Hi...,

my server is based centos operating system and my webserver is already running on Apache.... i need to run both apache and nginx on same instance ... please help me to implement this concept...

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.