How to Install Tomcat 8 in CentOS 6/7

Download tomcat tar file
# wget wget http://www.us.apache.org/dist/tomcat/tomcat-8/v8.5.15/bin/apache-tomcat-8.5.15.tar.gz

Extract file
# tar -zvxf apache-tomcat-8.5.15.tar.gz
# cd apache-tomcat-8.5.15

Set home path of Tomcat
# echo “export CATALINA_HOME=”/opt/apache-tomcat-8.5.15″” >> ~/.bashrcecho “export CATALINA_HOME=”/opt/apache-tomcat-8.5.15″” >> ~/.bashrc

Update file
# source ~/.bashrc

Start tomcat service
# cd /opt/apache-tomcat-8.5.15
# ./bin/startup.sh

Now access server from below URL
http://server_address:8080/

Put /opt/apache-tomcat-8.5.15/bin/startup.sh script in /etc/rc.local file to auto start server on boot.

# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don’t
# want to do the full Sys V style init stuff.
/opt/apache-tomcat-8.5.15/bin/startup.sh
touch /var/lock/subsys/local

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*