[JAVA] Install tomcat 5.5 on Amazon Linux.

Introduction

I have tomcat 5.5 installed on Amazon Linux.

Constitution

OS/MW version
Amazon Linux 2016.09
java 1.5.0_22
tomcat 5.5.36

Java installation

First, install java. However, since a different version of java is already installed on Amazon Linux this time, uninstall it first and then install the specified java this time.

**-Check existing jdk version **

You can check the already installed packages with yum list installed.

python


$ yum list installed |grep -i java
java-1.7.0-openjdk.x86_64                 1:1.7.0.121-2.6.8.1.69.amzn1 installed
javapackages-tools.noarch                 0.9.1-1.5.amzn1              installed
tzdata-java.noarch                        2016j-1.67.amzn1             installed

$ yum list installed |grep -i jdk
java-1.7.0-openjdk.x86_64                 1:1.7.0.121-2.6.8.1.69.amzn1 installed
**-Delete existing jdk **

python


$ sudo yum remove java-1.7.0-openjdk
---
It has been deleted:
  java-1.7.0-openjdk.x86_64 1:1.7.0.121-2.6.8.1.69.amzn1                                                                                             

Removed the dependency:
  aws-apitools-as.noarch 0:1.0.61.6-1.0.amzn1      aws-apitools-common.noarch 0:1.1.0-1.9.amzn1     aws-apitools-ec2.noarch 0:1.7.3.0-1.0.amzn1    
  aws-apitools-elb.noarch 0:1.0.35.0-1.0.amzn1     aws-apitools-mon.noarch 0:1.0.20.0-1.0.amzn1 

Due to the dependency, aws-apitools etc. will also be deleted.

** ・ Acquisition of jdk **

Download it from the following site and upload it to the server. Java SE 5.0 Downloads java-se-development-kit5.png

** ・ Install jdk **

Grant execute permission to the downloaded binary file and install it.

Grant execution authority


$ chmod +x jdk-1_5_0_22-linux-amd64-rpm.bin

Installation


$ sudo ./jdk-1_5_0_22-linux-amd64-rpm.bin

You will be asked if you agree, so enter yes and press enter.

Agree


Do you agree to the above license terms? [yes or no] 
yes
Unpacking...
Checksumming...
0
0
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP ([email protected]).
  inflating: jdk-1_5_0_22-linux-amd64.rpm  
Preparing...              ################################# [100%]
Updating/During installation...
   1:jdk-2000:1.5.0_22-fcs            ################################# [100%]
 
Done.

This completes the java installation.

install tomcat

Download tomcat from Apache Archives.

download


$ wget http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.36/bin/apache-tomcat-5.5.36.tar.gz
--2016-12-27 02:27:48--  http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.36/bin/apache-tomcat-5.5.36.tar.gz
archive.apache.org (archive.apache.org)Is inquiring to DNS... 163.172.17.199
archive.apache.org (archive.apache.org)|163.172.17.199|:Connecting to 80...Connected.
Sent a connection request via HTTP, waiting for a response... 200 OK
length: 9665826 (9.2M) [application/x-gzip]
`apache-tomcat-5.5.36.tar.gz'Saving in

apache-tomcat-5.5.36.tar.gz           100%[======================================================================>]   9.22M   185KB/s    in 87s     

2016-12-27 02:29:15 (109 KB/s) - `apache-tomcat-5.5.36.tar.gz'Save to[9665826/9665826]

Defrost


$ tar zxvf apache-tomcat-5.5.36.tar.gz 

Placement


$ sudo mv apache-tomcat-5.5.36 /usr/local/
** ・ Profile settings **

In the case of tomcat, after deploying the downloaded one, you need to set the environment variables required to execute it.

Environment variable settings


$ sudo vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.5.0_22
export TOMCAT_HOME=/usr/local/apache-tomcat-5.5.36
export CATALINA_HOME=/usr/local/apache-tomcat-5.5.36
export PATH=$PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/common/lib

Reading environment variables


$ source /etc/profile

Version confirmation


$ java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_22-b03, mixed mode)
** ・ Start tomcat **

The rest is started and completed.

start tomcat


$ /usr/local/apache-tomcat-5.5.36/bin/catalina.sh start
Using CATALINA_BASE:   /usr/local/apache-tomcat-5.5.36
Using CATALINA_HOME:   /usr/local/apache-tomcat-5.5.36
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-5.5.36/temp
Using JRE_HOME:        /usr/java/jdk1.5.0_22
Using CLASSPATH:       /usr/local/apache-tomcat-5.5.36/bin/bootstrap.jar

Verification


$ ps aux |grep tomcat
ec2-user  2784 15.0 23.4 986200 118108 pts/0   Sl   02:33   0:03 /usr/java/jdk1.5.0_22/bin/java -Djava.util.logging.config.file=/usr/local/apache-tomcat-5.5.36/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/apache-tomcat-5.5.36/common/endorsed -classpath /usr/local/apache-tomcat-5.5.36/bin/bootstrap.jar -Dcatalina.base=/usr/local/apache-tomcat-5.5.36 -Dcatalina.home=/usr/local/apache-tomcat-5.5.36 -Djava.io.tmpdir=/usr/local/apache-tomcat-5.5.36/temp org.apache.catalina.startup.Bootstrap start
ec2-user  2827  0.0  0.4 110472  2208 pts/0    S+   02:34   0:00 grep --color=auto tomcat

I was able to confirm that the process was running. Also, if you try to access 8080 with a browser, the default screen of tomcat will be displayed.

tomcat.png

stop tomcat

For the time being, we will also stop.

Stop


$ /usr/local/apache-tomcat-5.5.36/bin/catalina.sh stop
Using CATALINA_BASE:   /usr/local/apache-tomcat-5.5.36
Using CATALINA_HOME:   /usr/local/apache-tomcat-5.5.36
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-5.5.36/temp
Using JRE_HOME:        /usr/java/jdk1.5.0_22
Using CLASSPATH:       /usr/local/apache-tomcat-5.5.36/bin/bootstrap.jar

in conclusion

You can also start / stop tomcat with starup.sh and shutdown.sh under the same ʻapache-tomcat-5.5.36 / bin / `. Or rather, I think it's normal to do it there.

Start-up


$  /usr/local/apache-tomcat-5.5.36/bin/startup.sh 
Using CATALINA_BASE:   /usr/local/apache-tomcat-5.5.36
Using CATALINA_HOME:   /usr/local/apache-tomcat-5.5.36
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-5.5.36/temp
Using JRE_HOME:        /usr/java/jdk1.5.0_22
Using CLASSPATH:       /usr/local/apache-tomcat-5.5.36/bin/bootstrap.jar

Stop


$ /usr/local/apache-tomcat-5.5.36/bin/shutdown.sh 
Using CATALINA_BASE:   /usr/local/apache-tomcat-5.5.36
Using CATALINA_HOME:   /usr/local/apache-tomcat-5.5.36
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-5.5.36/temp
Using JRE_HOME:        /usr/java/jdk1.5.0_22
Using CLASSPATH:       /usr/local/apache-tomcat-5.5.36/bin/bootstrap.jar

Recommended Posts

Install tomcat 5.5 on Amazon Linux.
Install Homebrew on Amazon Linux 2
Install strongSwan 5.9.1 on Amazon Linux 2
Install Python Pillow on Amazon Linux
Install oracle java8 on amazon linux2
Install pyenv on EC2 (Amazon Linux)
[Note] Install Imagick on Amazon Linux2
I'll install Ruby on EC2 (Amazon Linux2) 2020
How to install Anisble on Amazon Linux 2
Install Python 3.8, Pip 3.8 on EC2 (Amazon Linux 2)
Install PHP 7 series on Amazon Linux 2 with Amazon Linux Extras
Install Minecraft on Arch Linux
Install Linux on your Chromebox
Install tomcat 9 on Cent OS 8
Install the JDK on Linux
Put jenv on Amazon Linux
Use sshpass on Amazon linux2
Compile and install MySQL-python for python2.7 on amazon linux
[AWS EC2] How to install Maven on Amazon Linux 2
Try installing OpenAM on Amazon Linux
Install CUDA on Linux Mint Mate 20
Install Arch Linux on DeskMini A300
How to install wkhtmltopdf (Amazon Linux2)
How to install VMware-Tools on Linux
[Note] Run Django on Amazon Linux 2
Run docker-compose on Amazon Linux2 on ARM64
Introduce Python 3.5.2 environment on Amazon Linux
Run cron on Amazon Linux (set on Linux)
Install LAMP on Amazon Linux 2 and build a WordPress environment.
Install scipy on Linux without internet connection
Install wsl2 and master linux on windows
Use Numpy, Scipy, scikit-learn on Amazon Linux
How to update php on Amazon linux 2
Install and launch k3s on Manjaro Linux
Build an LNPP environment on Amazon Linux 2
Install and Configure TigerVNC server on Linux
Learn sshd_config and authorized_keys (on Amazon Linux 2)
How to install packages on Alpine Linux
5 reasons to install Linux on your laptop.
Dockerfile: Install Docker on your Linux server
Install Mecab on Linux (CentOS) with brew
Run Keycloak on Amazon Linux 2 without Docker
How to install php7.4 on Linux (Ubuntu)
Install rJava on Linux in R3.6 environment.
Until you install Arch Linux on VMware
Linux "Install on / dev / sda" error resolution
Until you install Apache and Tomcat on Linux (CentOS) and deploy Java apps
A story I was addicted to trying to install LightFM on Amazon Linux
Install Python3 and Django on Amazon Linux (EC2) and run your web server
Install debian on linux on Arrows tab Q584 / H
Install Anydesk Linux version on Chromebook [Result NG]
[Note] Install wxPython 3.x on Linux Mint (Ubuntu)
How to install Camunda Modeler on Manjaro Linux
Install Tensorflow on Mac
Daemonizing processes on Linux
Install TensorFlow on Ubuntu
Install python on WSL
Install Faiss on CentOS 7
Install pyenv on mac
Install pip on Mavericks
Install Python on Pidora.