Difference between revisions of "Tomcat on n-9-22"

From DISI
Jump to: navigation, search
(Created page with "=Introduction= The Tomcat server runs on n-9-22. I used the guide at this link https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-apache-tomcat-7-0-on-rhel-6-centos...")
 
 
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
Written by Jennifer Young on July 11, 2019
 +
 
=Introduction=
 
=Introduction=
The Tomcat server runs on n-9-22.  I used the guide at this link https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-apache-tomcat-7-0-on-rhel-6-centos-6.html to setup Tomcat.
+
The Tomcat server runs on n-9-22 on port 8080.
  
 
==What if n-9-22 is restarted / rebooted?==
 
==What if n-9-22 is restarted / rebooted?==
 +
Tomcat should automatically start up whenever n-9-22 reboots.  To check if tomcat is running, you can use
 +
    ps -ef | grep tomcat
  
 +
If Tomcat is not running, start it using
 +
    service tomcat9 start
 +
 +
==Where to get information if the server is currently running?==
 +
The Tomcat server runs on n-9-22 on port 8080.  If the server is currently running, you can access the Tomcat GUI with links to the official documentation for the currently installed version and links to the manager app and more at the following link:
 +
    http://10.20.9.22:8080/
 +
Since this link is on the private network, you must be logged in using the SSH tunnel to access it.
 +
 +
From here you can click the button Manager App to access the manager page, or simply go to
 +
    http://10.20.9.22:8080/manager/html
 +
 +
The user name is admin.  The password is the usual password.
 +
This page allows you to start and stop applications individually and deploy new applications.
 +
 +
For more detailed information about Tomcat, the official documentation for the currently installed version is available here:
 +
    http://10.20.9.22:8080/docs/
 +
If the server, is offline, look for the documentation for Tomcat 9.0.17.  This was the most recent version of Tomcat at the time of installation.
 +
 +
The current public version of SmallWorld is
 +
    /sw-ws
 +
 +
Click the stop button to stop SmallWorld and the start button to start it.  Do not click undeploy unless you want to start SmallWorld with new source in the form of a new .war file.
  
 
==Install and Set Up on TomCat==
 
==Install and Set Up on TomCat==
Line 30: Line 56:
  
 
==How to Restart the TomCat Server==
 
==How to Restart the TomCat Server==
 +
 +
Login to n-9-22 as root and run the screen called tomcat.  You don't need to be in a screen to run this command, but I have the screen just to keep the tomcat commands in one place.
 +
 +
To restart, use
 +
 
     service tomcat9 restart
 
     service tomcat9 restart
 +
 +
To start and stop separately, use
 +
 +
  service tomcat9 start
 +
 +
  service tomcat9 stop

Latest revision as of 13:27, 12 July 2019

Written by Jennifer Young on July 11, 2019

Introduction

The Tomcat server runs on n-9-22 on port 8080.

What if n-9-22 is restarted / rebooted?

Tomcat should automatically start up whenever n-9-22 reboots. To check if tomcat is running, you can use

   ps -ef | grep tomcat

If Tomcat is not running, start it using

   service tomcat9 start

Where to get information if the server is currently running?

The Tomcat server runs on n-9-22 on port 8080. If the server is currently running, you can access the Tomcat GUI with links to the official documentation for the currently installed version and links to the manager app and more at the following link:

   http://10.20.9.22:8080/

Since this link is on the private network, you must be logged in using the SSH tunnel to access it.

From here you can click the button Manager App to access the manager page, or simply go to

   http://10.20.9.22:8080/manager/html

The user name is admin. The password is the usual password. This page allows you to start and stop applications individually and deploy new applications.

For more detailed information about Tomcat, the official documentation for the currently installed version is available here:

   http://10.20.9.22:8080/docs/

If the server, is offline, look for the documentation for Tomcat 9.0.17. This was the most recent version of Tomcat at the time of installation.

The current public version of SmallWorld is

   /sw-ws

Click the stop button to stop SmallWorld and the start button to start it. Do not click undeploy unless you want to start SmallWorld with new source in the form of a new .war file.

Install and Set Up on TomCat

Step 1: Check the CentOS version and Java version

SmallWorld currently runs on n-9-22, which runs CentOS 6.10. You can check the version of CentOS with the following command:

   cat /etc/centos-release

Check your current version of Java with the following command:

   java -version

If you do not have the correct version, install it using yum. Follow the steps on this tutorial https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-apache-tomcat-7-0-on-rhel-6-centos-6.html

Step 2: Create Tomcat Service Account

This must be done as a root user and has already been done for n-9-22.

   groupadd tomcat
   mkdir /opt/tomcat
   useradd -g tomcat -d /opt/tomcat tomcat

Step 3: Create Initialization Script to Control Apache TomCat

Download the latest version of Apache TomCat from the website https://tomcat.apache.org/download-90.cgi

   vi /etc/init.d/tomcat9

Copy the bash script from here https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-apache-tomcat-7-0-on-rhel-6-centos-6.html

How to Restart the TomCat Server

Login to n-9-22 as root and run the screen called tomcat. You don't need to be in a screen to run this command, but I have the screen just to keep the tomcat commands in one place.

To restart, use

   service tomcat9 restart

To start and stop separately, use

  service tomcat9 start
  service tomcat9 stop