You have a privilege to create a quiz (QnA) related to this subject and obtain creativity score...
Update AWS Java and other software packages in Linux Centos
There is a common pattern in updating AWS software packages.
Example:
To remove java 1.7 and install java 1.8:
sudo yum install java-1.8.0
Say "y" on all prompts and then remove old JDK, for example:
sudo yum remove java-1.7.0-openjdk
You can also install current default Java version:
sudo yum install Java
To configure Tomcat we will need the JAVA_HOME directory at
/usr/lib/jvm/jre
The Tomcat service must be run by the Tomcat user, which we create below.
1. Create a new tomcat group:
sudo groupadd tomcat
2. Then create a new tomcat user.
sudo useradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat
3. Install Tomcat
The most common Tomcat version is Tomcat 8.5, which is located in Linux - extras
sudo amazon-linux-extras install tomcat8.5
You can also install the latest version:
Find the latest version of Tomcat at the Tomcat Downloads page and copy the link to the "tar.gz".
3.1. First download the latest binary distribution to your home directory.
cd ~
wget {direct link to the latest tar.gz}
For example:
wget http://mirror.pekalatechnology.com/apache/tomcat/tomcat-9/v9.0.0.M13/bin/apache-tomcat-9.0.0.M13.tar.gz
3.2 Create the /opt/tomcat directory and extract the the archive:
sudo mkdir /opt/tomcat
sudo tar xvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1
3.3. Update tomcat user permissions
Was it clear so far?
cd /opt/tomcat
sudo chgrp -R tomcat conf
sudo chmod g+rwx conf
sudo chmod g+r conf/*
sudo chown -R tomcat webapps/ work/ temp/ logs/
3.4. Set up a Systemd file, but first check if you have to create a directory structure.
sudo vi /etc/systemd/system/tomcat.service
Copy and Paste in the script below.
/etc/systemd/system/tomcat.service
# Systemd unit file for tomcat
[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
Save this script and exit.
3.5. Run Systemd to load the Tomcat unit file:
sudo systemctl daemon-reload
3.6. Start the Tomcat service with the systemctl :
sudo systemctl start tomcat
3.7. To enable the Tomcat service on server boot, run:
sudo systemctl enable tomcat
3.8. Test in a browser:
http://yourServer:8080