Register   Login   About   Study   Enterprise   Share
AI / Internet Technology University (AITU)
Fast Login - available after registration







|

Top Links: >> 80. Technology >> Internet Technology Summit Program >> 5. Mobile and Cloud Technology >> 5.2. AWS Cloud Technology >> 5.2.1. AWS Cloud Setting with Java, Tomcat, MySQL and Route 53
Current Topic: 5.2.1.1. Update AWS Java and other software packages in Linux Centos
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

Topic Graph | Check Your Progress | Propose QnA | Have a question or comments for open discussion?
<br/>/etc/systemd/system/tomcat.service
<br/># Systemd unit file for tomcat
<br/>[Unit]
<br/>Description=Apache Tomcat Web Application Container
<br/>After=syslog.target network.target
<br/>
<br/>[Service]
<br/>Type=forking
<br/>
<br/>Environment=JAVA_HOME=/usr/lib/jvm/jre
<br/>Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
<br/>Environment=CATALINA_HOME=/opt/tomcat
<br/>Environment=CATALINA_BASE=/opt/tomcat
<br/>Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
<br/>Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
<br/>
<br/>ExecStart=/opt/tomcat/bin/startup.sh
<br/>ExecStop=/bin/kill -15 $MAINPID
<br/>
<br/>User=tomcat
<br/>Group=tomcat
<br/>
<br/>[Install]
<br/>WantedBy=multi-user.target
<br/>


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


Topic Graph | Check Your Progress | Propose QnA | Have a question or comments for open discussion?

Have a suggestion? - shoot an email
Looking for something special? - Talk to me
Read: IT of the future: AI and Semantic Cloud Architecture | Fixing Education
Do you want to move from theory to practice and become a magician? Learn and work with us at Internet Technology University (ITU) - JavaSchool.com.

Technology that we offer and How this works: English | Spanish | Russian | French

Internet Technology University | JavaSchool.com | Copyrights © Since 1997 | All Rights Reserved
Patents: US10956676, US7032006, US7774751, US7966093, US8051026, US8863234
Including conversational semantic decision support systems (CSDS) and bringing us closer to The message from 2040
Privacy Policy