Skip to main content


Showing posts from 2021

How To Install Tomcat 9 and Java 8 on Amazon Linux 2

  Step 1: Install Java on Amazon Linux 2 Update and reboot the server 1) sudo yum -y update 2) sudo reboot 3) sudo yum install java-1.8.0-openjdk 4) java -version 5) wget here we can copy the path of tomcat version 6) sudo groupadd --system tomcat 7) sudo useradd -d /usr/share/tomcat -r -s /bin/false -g tomcat tomcat 8) sudo tar xvf apache-tomcat-9.0.43.tar.gz -C /usr/share/ 9) sudo mv apache-tomcat-9.0.43 tomcat 10) sudo chown -R tomcat:tomcat /usr/share/tomcat 11) sudo tee /etc/systemd/system/tomcat.service<<EOF [Unit] Description=Tomcat Server [Service] Type=forking User=tomcat Group=tomcat Environment=JAVA_HOME=/usr/lib/jvm/jre Environment='JAVA_OPTS=-Djava.awt.headless=true' Environment=CATALINA_HOME=/usr/share/tomcat Environment=CATALINA_BASE=/usr/share/tomcat Environment=CATALINA_PID=/usr/share/tomcat/temp/ Environment='C