I have tomcat 5.5 installed on Amazon Linux.
OS/MW | version |
---|---|
Amazon Linux | 2016.09 |
java | 1.5.0_22 |
tomcat | 5.5.36 |
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.
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
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.
Download it from the following site and upload it to the server. Java SE 5.0 Downloads
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.
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/
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)
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.
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
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