Wondering if my solution for my last task can be reviewed, I feel it might have been checked wrong. it failed saying tomcat package is not found on app server 3. Mind boggling, I checked systemctl status tomcat and it was running.
This is what I did:
on app 3 server:
sudo yum install wget
sudo yum install -y firewalld
sudo systemctl enable firewalld
sudo systemctl start firewalld
sudo firewall-cmd --permanent --add-port=port-number/tcp
sudo firewall-cmd --reload
sudo bash firewalld.sh
sudo vi /etc/resolv.conf ------> nameserver 8.8.8.8
sudo yum install -y java-1.8.0-openjdk.x86_64
sudo groupadd tomcat
sudo mkdir /opt/tomcat
sudo useradd -s /bin/nologin -g tomcat -d /opt/tomcat tomcat
cd /tmp
sudo wget https://downloads.apache.org/tomcat/tomcat-10/v10.0.5/bin/apache-tomcat-10.0.5.tar.gz
cd /opt
sudo tar -xvf /tmp/apache-tomcat-10.0.5.tar.gz
sudo mv apache-tomcat-10.0.5 tomcat
sudo chown -R tomcat:tomcat /opt/tomcat
sudo vi /etc/systemd/system/tomcat.service
-----------
add :
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment=‘CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC’
Environment=‘JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom’
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
User=tomcat
Group=tomcat
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start tomcat
sudo systemctl enable tomcat
move ROOT file from jump server to app:
on jump server:
sudo scp /tmp/ROOT.war banner@stapp03:/home/banner
on app:
sudo cp ROOT.war /opt/tomcat/webapps/
sudo systemctl restart tomcat