Install Apache Tomcat 8 on CentOS 7

Apache Tomcat is an open-source web server that is designed to serve Java web pages. It is widely deployed and powers various mission-critical web applications around the world.
As a starter guide, this article explains how to install Apache Tomcat 8, the latest stable version of Apache Tomcat, onto a Vultr CentOS 7 server instance.


Deploy a fresh CentOS 7 server instance.
Log into this machine from your SSH terminal as a non-root sudo user.

Update your CentOS system

yum install epel-release; yum update -y;

install java

yum install java -y

Create a user for Apache Tomcat

groupadd tomcat
mkdir /opt/tomcat
useradd -s /bin/nologin -g tomcat -d /opt/tomcat tomcat

 install the latest Apache Tomcat

tar -zxvfapache-tomcat-8.5.23-deployer.tar.gz -C /opt/tomcat –strip-components=1

Setup proper permissions


1 Comment

  1. Yum crashed with Keyboard Interrupt error

    I installed the newer version of python (3.2.3) than the one available in Fedora16 (python2.7)

    And now yum stops working. It shows the following error.

    [root@localhost yum-3.4.3]# yum
    File “/usr/bin/yum”, line 30
    except KeyboardInterrupt, e:
    SyntaxError: invalid syntax

    Because yum does not support Python3.
    You can run command vi /usr/bin/yum, change /usr/bin/python to /usr/bin/python2 in first line.
    Thus you can run the command yum by Python2 instead of Python3.

    Note however that this will make your setup unsupported and thus unmaintainable (as does what you did). You will likely have other similar problems in the future with other system packages.
    If you want to use an alternative Python installation, consider installing it into /usr/local, /opt or using pyenv.

Leave a Reply

Your email address will not be published.