Monday, August 5, 2019

Setup Tomcat8 on Red Hat Enterprise Linux 8 - How to install Tomcat 8 on Red Hat 8

Welcome to setting up Tomcat 8 on RedHat Linux 8.

Please find below steps for setting up Tomcat 8 on RHEL 8.

update package

sudo yum update

Install wget
sudo yum install wget -y
sudo yum install unzip -y

Java Installation

Download Java from Oracle site.

sudo wget --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' ''

Install from RPM
sudo  rpm -i jdk-8u141-linux-x64.rpm

java -version

make sure Java version appearing fine.

Tomcat Installation

cd /opt

sudo wget

unzip Tomcat

sudo unzip

create a symbolic link 
sudo ln -s /opt/apache-tomcat-8.5.43 /opt/tomcat

Create user for tomcat

Create a user for running tomcat and give required permissions.
sudo useradd tomcat
sudo chown -R tomcat:tomcat /opt/apache-tomcat-8.5.43
sudo chmod +x /opt/tomcat/bin/*.sh

Create tomcat 8 as a service

sudo vi /etc/systemd/system/tomcat.service




ExecStart=/opt/tomcat/bin/ start
ExecStop=/opt/tomcat/bin/ stop


Re-load systemd

sudo systemctl daemon-reload

Restart Tomcat8 as a service

sudo systemctl start tomcat

Verify Tomcat service is running
sudo systemctl status tomcat

Enable as a service

sudo systemctl enable tomcat

No comments:

Post a Comment