Uploaded by Fouad Barout

How to Install Apache Tomcat 8

advertisement
How to Install and Setup Apache Tomcat 8
on AIX 7.2
Introduction
Apache Tomcat is an open-source web server and servlet container developed by
the Apache Software Foundation (ASF). Tomcat implements several Java EE specifications
including Java Servlet, JavaServer Pages (JSP), Java EL, and WebSocket, and provides a "pure
Java" HTTP web server environment for Java code to run in. The latest stable Tomcat release
is 8.5 and in this article, we will see how to install and configure Tomcat 8.5 on AIX 7.2
Step 1: Install and Verify Java
Tomcat is completely written in Java hence to run it on AIX we need not to compile it again.
The only requirement is to have correct version of Java on AIX. To run Tomcat 8.5 we need
to have Java 7 or later on AIX.
If you don’t have Java 7 or later already on your AIX system then download and install it.
To install latest Java 8 on AIX please download IBM Java 8 for AIX from the following
location
https://www.ibm.com/developerworks/java/jdk/aix/service.html
Download 64bit version of Java Runtime Environment (JRE) and Development Kit (SDK)
Java8_64.jre.tar
Java8_64.sdk.tar
I used wget to download the Java JRE and SDK on my AIX system. For ease of use I have
installed yum from AIX toolbox and used yum to install wget.
Download/Copy Java8_64.jre.tar and Java8_64.sdk.tar to AIX system. Untar the files and
install them using installp command or SMITTY.
# tar -xvf Java8_64.jre.tar
# tar -xvf Java8_64.sdk.tar
# installp -agXYd . Java8_64.jre Java8_64.sdk
Sample Output
Verify Java 8 is installed using lslpp command. Add Java8 path
(/usr/java8_64/jre/bin:/usr/java8_64/bin) in your PATH environment variable and verify the
version of Java on the system using “java –version” command.
# lslpp -l | grep Java8
# java -version
Sample Output
Step 2: Download and Install Latest Tomcat
After installing and verifying Java8, download and install latest Tomcat. To download latest
Tomcat 8 please visit
http://Tomcat.apache.org/download-80.cgi
At the time this article is written most recent version of Tomcat available is 8.5.13.
Download the latest available Tomcat 8 on your system. I used wget to download apachetomcat-8.5.13.tar.gz
# wget http://redrockdigimark.com/apachemirror/tomcat/tomcat8/v8.5.13/bin/apache-tomcat-8.5.13.tar.gz
Sample Output
Unzip and untar the downloaded tomocat gzip file on the AIX system. As Tomcat is purely
written in Java it does not require any special install process. After untar the Tomcat is
available to run.
# gunzip apache-tomcat-8.5.13.tar.gz
# tar -xvf apache-tomcat-8.5.13.tar
Sample output
Now we are all set to start Tomcat webserver. Go to apache-tomcat-8.5.13/bin directory
and run ./startup.sh script to start Tomcat server.
# cd /opt/tomcat/apache-tomcat-8.5.13/bin
# ./startup.sh
Sample output
Now you can open Tomcat from your web browser. By default, Tomcat starts on port 8080.
So to open Tomcat using http://<aix system ip or hostname.domain>:8080
Step 3: Configuring Tomcat Web Management Interface
By default, you can access only default Tomcat web page. To access web management
interface “Server Status, Manager App and Host Manager” we need to add user with
manager-gui and admin-gui role to our Tomcat server. You can have two users for these two
roles or can create one single user to have both the roles. To add users, we need to edit
/opt/tomcat/conf/tomcat-users.xml file and add users with role in this file. In this example
only one user is created with both the roles.
# vi /opt/tomcat/apache-tomcat-8.5.13/conf/tomcat-users.xml
Sample output
Also, to access web interface we need to provide access to system from where the Tomcat
server is getting accessed, this is the system where you have opened web browser to access
Tomcat server. To add the system ip in access list edit the file /opt/tomcat/apache-tomcat8.5.13/webapps/manager/META-INF/context.xml and /opt/tomcat/apache-tomcat8.5.13/webapps/host-manager/META-INF/context.xml and add your system ip, for example
my system ip is 10.10.10.11
# vi /opt/tomcat/apache-tomcat-8.5.13/webapps/manager/METAINF/context.xml
# vi /opt/tomcat/apache-tomcat-8.5.13/webapps/hostmanager/META-INF/context.xml
Sample output
Now everything is setup. Restart Tomcat and access web interface. To restart shutdown and
start Tomcat server again.
# cd /opt/tomcat/apache-tomcat-8.5.13/bin
# ./shutdown.sh
# ./startup.sh
Sample output
Step 4: Access Tomcat Web Management Interface
Now we have created a user and provided access to the system for accessing web
management interface. Open the browser and enter your server's domain name or IP
address with port 8080. Default Tomcat page will be shown, click on Manager App or other
web management interface and it will ask username and password. Enter the username and
password provided in the tomcat-users.xml.
It will show you
Congratulation!!! you have setup Tomcat server on AIX. You can start deploying you Java
applications.
Download