How to install Apache tomcat 9 on centos7

Install Apache tomcat 9 on centos7 

Apache Tomcat is a open source web server. It provide required java web server platform for running java code.

1. first update cantos
#yum -y update

2. Java package default available in cantos 7  repositories for the installation of java on cantos
# yum install java-1.8.0

3. for the check version of java
#Java -version

4. Now open local folder
# cd /usr/local

5. Now download tomcat 9


#wget http://mirrors.estointernet.in/apache/tomcat/tomcat-9/v9.0.22/bin/apache-tomcat-9.0.22.tar.gz

5. Run the tar command for extract tomcat file

#tar -xvf apache-tomcat-9.0.22.tar.gz

6. Now configure catalina _home  using mention command

#echo "export CATALINA_HOME="/usr/local/tomcat9"" >> ~/.bashrc

#source ~/.bashrc

7. Now we are start the service on tomcat

#cd /usr/local/tomcat9/bin


# ./startup.sh

8. Now open your server tomcat page using port 8080. tomcat default port is 8080


9. By default you have access default Tomcat page, to access admin, Server Status, Manager App and Host Manager. You need to configure user accounts for admins and managers.

#vi /usr/local/tomcat9/conf/tomcat-users.xml

10. Add mention details in tomcat-users.xml

<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="admin@123" roles="manager-gui,admin-gui,manager-script"/>

11. Now shutdown and start the server of tomcat


# ./startup.sh

12. After start the service open Apache link http://10.*.*.*:8080/  in browser and click on manager app and type user and password which you set in tomcat-users.xml file

Post a Comment