ApacheTomcat - Jira

coldwaterphewServers

Nov 17, 2013 (3 years and 4 months ago)

71 views

Apache/Tomcat Installation


Table of Contents


Table of Contents

................................
................................
................................
.......

1

Apache Installation

................................
................................
................................
....

2

Apache Tomcat

................................
................................
................................
..........

8

Connecting Tomcat to Apache
................................
................................
.................

13

Geoserver (Tomcat Installation)

................................
................................
..............

16




Apache Installation


The following are instructions for installing Apache for a 32
-
bit windows operating
system.


Step 1: Download the Win32 Binary.

The W32 Binary for verson 2.2.4 can be downloaded from:

http://httpd.apache.org/download.cgi?Preferred=http%3A%2F%2Fmirror.inetc.co.uk
%2Fapache


Downloading the Wind32 Binary from the Apache website



Step 2: Install Apache

The installation instructio
ns can be found at:
http://httpd.apache.org/docs/2.2/platform/windows.html




double click on the msi file to begin installation.


Installation Screen 1



click on next



Installation Scr
een 2



accept the terms in the license agreement



click on next



Installation Screen 3



read the information about Apache HTTP Server if required



click on next



Installation Screen 4



enter the Network Domain
[what does this mean?]



enter the Server Name
[w
hat does this mean?]



enter the Administrator’s Email Address



check the option for installation for All Users on Port 80



click on Next



Installation Screen 5



select setup type as typical



click on next



Installation Screen 6



change the installation addre
ss if desired



click on next



Installation Screen 7



click on install



Installation Screen 8

Once installation is complete, the following screen appears.



click on Finish.



Apache is now installed as a service which will start up when the server is turn
ed on.

The service is named as ‘Apache2’


Step 3: Starting, Stopping & Checking the Apache Service


To check the server works



open an internet browser and enter the web address:

http://localhost

This should return a web pa
ge which contains the text ‘It works!’.

This web page is: index.html

which is found in the root folder of the Apache set up which is:

C:
\
Program Files
\
Apache Software Foundation
\
Apache2.2
\
htdocs

%Apache%
\
htdocs [is this correct?]


Location of the Apache Co
nfiguration File

C:
\
Program Files
\
Apache Software Foundation
\
Apache2.2
\
conf
\
httpd.conf

%Apache%
\
conf
\
httpd.conf
[is this correct?]


View Available Services

The services being run can be viewed using the Administrative Tools/Service option
on the start menu
.

If this is not visible, it can be turned on by clicking on the ‘Display Administrative
Tools’ option in the advanced start menu options



Method 1 for Starting, Restarting and Stopping the Apache Service.

The Apache service can be started and stopped f
rom the services window.



Method 2 for Starting, Restarting and Stopping the Apache Service.

Use the httpd.exe file via the command prompt.

The httpd.exe file is found at:

C:
\
Program Files
\
Apache Software Foundation
\
Apache2.2
\
bin
\
httpd.exe

%Apache%
\
bin
\
h
ttpd.exe
[is this correct?]


To start an installed Apache service

>httpd

n “Apache2”

k start

To stop an Apache service (2 options)

>httpd

n “Apache2”

k stop

>httpd

n “Apache2”

k shutdown

To restart an Apache service & force it to read the configurati
on file

>httpd

n “Apache2”

k restart






Apache Tomcat


Step 1: Check that JDK is installed

Install the Java SE Development Kit (JDK) if not already done so.

This is available to download from
http://java.sun.com/javase/downloads/index_jdk5.jsp

As of writing (March 2007) the latest version is JDK 5.0 Update 11.

The JDK contains the Java Runtime Environment (JRE) and command
-
line
development tools


Step 2: Download Apache Tomcat

Downloa
d the Windows Service Installer, apache
-
tomcat
-
5.5.20.exe, from:

http://tomcat.apache.org/download
-
55.cgi




Step 3: Install Apache Tomcat



double click on apache
-
tomcat
-
5.5.20.exe to begin the inst
allation


Installation Screen 1



click on next



Installation Screen 2



click on I Agree



Installation Screen 3



select the type of install as ‘Custom’



select all the optional components except for service



click on Next



Installation Screen 4



change the
installation folder if desired.



click on Next



Installation Screen 5



ensure that the port number is recorded as 8080



keep the user name as admin



make a note of the password chosen



click on Next



Installation Screen 6

The installer uses either the regis
try or the JAVA_HOME environment variable to
determine the base path of the Java Runtime Environment installed as part of the
JDK.



click on Install.



Installation Screen 7

Once installation is complete the following screen appears.



click on Finish.




S
tep 4: Starting, Stopping & Checking the Tomcat Service


The Apache Tomcat service can be started and stopped from the services window.




To check that Apache Tomcat works.

Open an internet browser and enter the web address:

http://localhost:8080

This should return the following web page:


This web page is:

index.jsp

which is found in the root folder of the Tomcat set up which is:

C:
\
Program Files
\
Apache Software Foundation
\
Tomcat 5.5
\
webapps
\
ROOT

%TOMCAT%
\
webapps
\
R
OOT [is this correct?]




Connecting Tomcat to Apache


STEP 1: Install the mod_jk module


[what is the mod_jk module?]




download the mod_jk module ‘mod_jk
-
apache
-
2.2.4.so’ from the JK 1.2 binary
releases section of:

http://tomcat.apache.org/download
-
connectors.cgi
?

mod_jk
-
apache
-
2.2.4.so is for Apache 2.2 and works with Apache 2.2.3 and later






rename mod_jk
-
apache
-
2.2.3 to mod_jk.so



move mod_jk.so into the
%APACHE%/modules

directory (C:
\
P
rogram
Files
\
Apache Software Foundation
\
Apache2.2
\
modules)


STEP 2: Update the Apache httpd.conf file

Update the Apache HTTP server httpd.conf file found at:

C:
\
Program Files
\
Apache Software Foundation
\
Apache2.2
\
conf
\

%APACHE%
\
conf
\


[what is the significa
nce of these alterations?]


Add the following lines to the end of the file.

The alterations to take note of are the last lines containing the commands JkMount.
These give the types of web addresses which the Apache service redirects to the
Tomcat service.

In this case, the web addresses redirected will be:

http://localhost/geoserver*

http://localhost/*jsp


# Load mod_jk module

LoadModule jk_module modules/mod_jk.so


# Where to find workers.properties

JkWorkersFile conf/workers.properties


# Where to put jk
shared memory

JkShmFile logs/mod_jk.shm


# Where to put jk logs

JkLogFile logs/mod_jk.log


# Set the jk log level [debug/error/info]

JkLogLevel info


# Select the timestamp log format

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "


# Send everything

for context /geoserver to worker named worker1 (ajp13)

JkMount /geoserver* worker1

# Send all .jsp files to worker1

JkMount /*jsp worker1


STEP 3: Create the workers.properties file



create a text file called workers.properties and place it in:

C:
\
Program

Files
\
Apache Software Foundation
\
Apache2.2
\
conf

%APACHE%
\
conf


[what is the workers.properties file?]




enter the following text into the workers.properties file:


# Define 1 real worker using ajp13


worker.list=worker1


# Set properties for worker1 (ajp
13)


worker.worker1.type=ajp13


worker.worker1.host=localhost


worker.worker1.port=8009


Step 4: Check that the appropriate requests are being directed from Apache to
Tomcat



copy index.jsp from

C:
\
Program Files
\
Apache Software Foundation
\
Tomcat 5.5
\
web
apps
\
ROOT to

C:
\
Program Files
\
Apache Software Foundation
\
Tomcat 5.5
\
webapps

%TOMCAT%
\
webapps
\
ROOT to %TOMCAT%
\
webapps


The reason that the index.jsp file needs to be copied to the webapps folder is that

the line ‘JkMount /*jsp worker1’ looks for the *jsp
file in the webapps folder, not the
webapps
\
ROOT folder.

The author has not found a way to direct Apache to the
\
ROOT folder though he
suspects that there is most definitely a way!

[Is there a way to direct the worker to the ROOT folder?]


The Apache Tomca
t webpage should now be visible through:

http://localhost/index.jsp



Geoserver (Tomcat Installation)


Step 1: Download the War file



download the War file from:

http://docs.codehaus.org/display/GEOS/Latest



Installation Instructions



ensure that the Apache Tomcat service is not running



copy geoserver.war to:

C:
\
Program Files
\
Apache Software Foundation
\
Tomcat 5.5
\
webapps

%TOMCAT%
\
webapps



start the Apa
che Tomcat service


The geoserver.war will extract all files into a folder geoserver within the webapps
folder.


GeoServer will now be available on:

http://localhost:8080/geoserver/


If Apache and Apache To
mcat have been successfully linked, GeoServer will also be
available on:

http://localhost/geoserver/