Installation Instruction of SEQOS WEB Application

Total Page:16

File Type:pdf, Size:1020Kb

Installation Instruction of SEQOS WEB Application

Installation Instruction of SEQOS WEB application on Linux (SEQOS 5.2.4) 13 June 2003

1. Introduction

This document contains complete instruction steps for the installation of SEQOS web application. It includes Basic system requirements & prerequisites, How to install & do the test run and Appendixes section for the detail instruction of the main installation instruction.

The appendix 4.4 is a section describing all application directories and its meaning.

2. Basic system requirements & prerequisites

2.1 Linux Redhat 7.3 or later

2.2 Redhat WWW Server installed

2.3 JAVA2 Platform, Standard Edition version 1.4 (j2sdk1.4.1_02) or later

2.4 Apache Tomcat 4.0 or later

2.5 SEQOS version 5.2.4 installed

3. How to install & do the test run

3.1 Make sure that SEQOS main program & database work correctly.

3.2 Install JAVA library (see appendixes 4.1 Installing JAVA library)

3.3 Activate Apache web server (see appendixes 4.5 Activate Apache web server)

3.4 Install Tomcat (see appendixes 4.2 Installing Tomcat)

3.5 Install FOP on top of Tomcat (see appendixes 4.6 Installing FOP)

3.6 Install SEQOS WEB JSP programs

3.6.1 Copy everything under “129.8.1.160/u/source/versions/source/5.2.2/seqosweb/" from SCO machine into "/usr/jakarta-tomcat-4.1.24/webapps/" on the destination Linux machine. After finished copying, there will be a “/usr/jakarta-tomcat-4.1.24/webapps/Seqos/" directory containing all relevant programs + images.

3.6.2 Set permission of /webapps/Seqos/temp/ to be writable by public access.

3.6.3 Restart Tomcat by running

$/usr/jakarta-tomcat-4.1.24/bin/shutdown.bat and then $/usr/jakarta-tomcat-4.1.24/bin/startup.bat

3.6.4 Change the working IP address and Port number in "/usr/jakarta-tomcat-4.1.24/webapps/Seqos/include/Connect.jsp" to be String hostIP = ""; int port = ;

3.6.5 Recompile the Connect.jsp file and associated program (from changing some code in 3.4.3) (see appendixes 4.3 Recompile the Connect.jsp file and associated program)

3.6 Test run SEQOS WEB JSP program. Open browser, type “http://:8080/Seqos” the main menu page will be displayed.

4. Appendixes.

4.1 Installing JAVA library

4.1.1 Copy JAVA installer into destination machine (into any temporary directory for general case use “/tmp/” ) (Note : for Concurrent environment, the installer can be copied from 129.8.1.159/usr/seqos/source/Jakarta/j2sdk-1_4_1_02-fcs-linux-i586.rpm)

4.1.2 On the destination machine, type

$rpm –-install /j2sdk-1_4_1_02-fcs-linux- i586.rpm

for example (if 4.1.1 uses “/tmp/”)

$rpm –-install /tmp/j2sdk-1_4_1_02-fcs-linux-i586.rpm

Note: Normally JAVA will be installed under /usr/java/ directory. To test JAVA running on Tomcat (generally not necessary), after finish installing JAVA and Tomcat, Open the browser and type “http://localhost:8080/examples/jsp/num/numguess.jsp”. enter something and test clicking "Submit". If no error appears that means the JAVA library has been installed correctly.

4.2 Installing Tomcat

4.2.1 Copy Tomcat zip file into destination machine (into any temporary directory for general case use “/tmp/” )

(Note : for Concurrent environment, the Tomcat zip file can be copied from 129.8.1.159/usr/seqos/source/Jakarta/jakarta-tomcat-4.1.24.zip)

4.2.2 On the destination machine, unzip the file into “/usr/” directory by type

$unzip /jakarta-tomcat-4.1.24.zip –d /usr

for example (if 4.2.1 use “/tmp/”)

$unzip /tmp/jakarta-tomcat-4.1.24.zip –d /usr

after unzipping, there will be a directory called “/usr/jakarta-tomcat-4.1.24/” containing all relevant programs of Tomcat.

Note: to test Tomcat alone (generally not necessary), after finish installing Tomcat, Open the browser and type “http://localhost:8080”. It will display the Tomcat welcome page. 4.2.3 Disable using cookie to keep session ID on the Tomcat server. By edit the “\conf\server.xml” file, search the wording “cookie” then set the relevant parameter value to disable as following.

 In Tomcat version 3.* change the code to be like this

 In Tomcat version 4.0 change the code to be like this

If there is no cookie setup existed in a file, add the following line

under “Host” tag by search the word below

The reason of doing this because enabling cookie to keep session ID causes JSP cannot manipulate session ID programmatically. Because SEQOS Web browser application needs a multithread (processes) for each login user sometimes, enabling cookie forces JSP to have only single thread for one user.

In contrast, disabling cookie and handling session id using URLencoding method provides JSP program can create the multithread process for each user programmatically. And also by using URLencoding method, there is no need that user’s web browser has to have a Cookie enable.

4.2.4 Set all Tomcat environment variables. There are 2 important environment variables, which are

 JAVA_HOME : to set this follows the steps below 1) Check if this variable has been set or not by typing command.

env

The result may come up looks like image below 2) If JAVA_HOME variable has not been set then type the command below to set it up

export JAVA_HOME=/usr/java/j2sdk1.4.1_02

Note : the directory may be up to the actual environment.

3) If JAVA_HOME variable has already been set, make sure that it pointed to the correct directory. If not check with server administrator first before changing it because this variable may be used for some other applications on the server.

4) To set this variable permanently (set every time machine reboot) , add the following line into $/usr/jakarta- tomcat-4.1.24/bin/setclasspath.sh by adding to the very first line of the file (after initial comment lines).

JAVA_HOME=/usr/java/j2sdk1.4.1_02

 TOMCAT_HOME : Normally this variable will be set up automatically once Tomcat is start up. So no need to set it as an environment variable. However to set it permanently, edit /root/.bash_profile add the following line.

CLASSPATH=.:/usr/jakarta-tomcat-4.1.24/common/lib/servlet.jar

and ..

PATH=$PATH:/usr/java/j2sdk1.4.1_02/bin 4.2.5 Restart Tomcat by running

$/usr/jakarta-tomcat-4.1.24/bin/shutdown.bat

Note : The result may looks slightly different if run on different platform or version.

and then

$/usr/jakarta-tomcat-4.1.24/bin/startup.bat

Note : The result may looks slightly different if run on different platform or version.

To set the startup script run every time the server reboot, put the startup command in /root/.bash_profile .

4.3 Recompile the Connect.jsp file and associated program

Description: Most of JSP programs basically don’t need to be recompiled when the code has been changed but some parts of JSP code need to be recompiled, especially the part that concerns about IP address identification of working database (in 3.4.3).

So installation of SEQOS WEB connecting to any database needs to change the IP identification of that database in “/usr/jakarta-tomcat-4.1.24/webapps/Seqos/include/Connect.jsp” file (see 3.4.3) and then recompile some relevant files as the following steps. How to recompile: To recompile the Connect.jsp file and associated program on the installed machine, simply refresh the concerning JSP program using the following steps

4.3.1 Open “/usr/jakarta-tomcat-4.1.24/webapps/Seqos/module/Login.jsp” file using any text editor program.

4.3.2 Change some codes by take out the line that say

<%@ include file="./include/Connect.jsp" %>

It sits on about the 4th line from the top. Then save the file.

4.3.3 Rename the file from "/usr/jakarta-tomcat-4.1.24/webapps/Seqos/include/Connect.jsp" into "/usr/jakarta-tomcat-4.1.24/webapps/Seqos/include/ConnectX.jsp"

4.3.4 Open the browser, type http://localhost:8080/Seqos You may get the front page with the error message (as image below or similar)

4.3.5 Open “/usr/jakarta-tomcat-4.1.24/webapps/Seqos/Login.jsp” file using any text editor program and change the code back to original as before step 4.3.2 by insert the 4th line that say

<%@ include file="./include/Connect.jsp" %>

Then save the file.

4.3.6 Switch to the browser, click on the ‘Refresh’ button on the browser You may get the other error message (displayed below or looks similar) 4.3.7 Rename the file in 4.3.3 back to original by rename from "/usr/jakarta-tomcat-4.1.24/webapps/Seqos/include/ConnectX.jsp" into "/usr/jakarta-tomcat-4.1.24/webapps/Seqos/include/Connect.jsp"

4.3.8 Switch to the browser, click on the ‘Refresh’ button on the browser, then all relevant JSP programs have already been recompiled, the browser will be displayed correctly as image below or similar.

4.3.9 Finish recompiling steps 4.4 The complete list of application directory

Seqos

Browser This directory contains all JSP programs that used in SEQOS web browser project. It also contains sub directory called “include” which contains all the shared files that only used in this project.

Image This directory contains all images used in both web browser and Customer Ordering/POD web application project.

Include This directory contains all shared file that used in both SEQOS web browser and Customer Ordering/POD web application project. The examples of shared file being used are Java script validation, data dictionary file, error trapping, HTML template header/footer/navigation bar, Page Initialisation and generic program used in various JSP pages.

Module This directory contains all JSP programs that used in and Customer Ordering/POD web application project.

Temp This directory contains all temporary files that used in the system. Initially it used to contain - logfile is it has been enabled - Created PDF files to display for reports

This directory permission must be set to writable for public access.

WEB-INF /Class/seqos/ This directory contains all JAVA Servlet file (*.class) that used in both SEQOS Web Browser and Customer Ordering/POD web application project.

Currently this directory contains both compiled and source code program in purpose of easy to maintain. When copy to user’s live system, delete all source programs which is *.java first.

/Class/com/ This directory contains JAVA utility libraries that used for special functionalities such as uploading file.

4.5 Activate Apache Web Server

Apache web server is a build-in feature in Redhat 7.3 so there is no need to install the software. However at the time of installing Redhat if HTTP is not activated then it has to be set after that.

4.5.1 Check if the machine is already activating Apache web server by typing command

netstat –vat | more

From above image, if the “http” line appeared means the Apache web server has already activated and ready to be used.

Note :Another way to test is to open web browser and go to the URL http://129.8.1.159/ (or IP address that has been setting) then the Apache welcome page will appears if it has been activated.

In case of the Apache web server has not been activated yet, there are 2 ways to set it activated 1) Activated temporary : by typing command

/usr/sbin/httpd &

This will manually start up Apache web server but every time the server reboots, this command has to be run again.

2) Activated permanently : by using above command put in the start up profile file of root user.

.. to be find out how from Kham ..

4.6 Installing FOP

FOP (Formatting Objects Processor) is used to create SEQOS reports as PDF format file. It is running on top of Apache Tomcat web server. To install follows below steps.

4.6.1 For Tomcat version 3, copy all files below from 129.8.1.159 machine to the destination machine under the same directory.

Under Directory : /usr/jakarta-tomcat-4.1.24/lib avalon-framework-cvs-20020315.jar batik.jar fop.jar xalan.jar

Under Directory : /usr/jakarta-tomcat-4.1.24/webapps fop.war

4.6.2 For Tomcat version 4,

- Copy all files below from 129.8.1.159 machine to the destination machine.

Source Directory : /usr/jakarta-tomcat- 4.1.24/common/lib avalon-framework-cvs-20020315.jar batik.jar fop.jar xalan.jar

Destination Directory : /usr//common/lib avalon-framework-cvs-20020315.jar batik.jar fop.jar xalan.jar

And copy /usr/jakarta-tomcat-4.1.24/webapps/fop.war To /usr//webapps/fop.war

Then restart Tomcat.

Recommended publications