Configuration / Integrating Tomcat and Apache Web server or Apache HTTP server on Windows

By nmrmohanraj

The version I used is –

1.    Java version “1.5.0_15″

2.    Apache2.2

3.    Apache-tomcat-6.0.16

4.    Tomcat-connectors-1.2.27-src.zip

5.    Apache Tomcat Connectors 1.2.27 for WIN32

Please follow the following step to configure successfully

1)   Installing Apache –

a.     Download “apache_2.2.10-win32-x86-openssl-0.9.8i.msi”

b.    Just simple wizard – follow next button

c.     Type http://localhost/ in browser

                                          i.    You will get “it works!”

                                         ii.    Ref :

2)   Installing Tomcat

a.     Download “apache-tomcat-6.0.16.zip”

b.    Just unzip it

c.     Goto TOMCAT_HOME/bin and run or double click startup.bat

                                          i.    For ex : C:\apache-tomcat-6.0.16\bin

d.    Type http://localhost:8080/ in browser

                                          i.    You will get

                                         ii.    Ref:

3)   Stop both servers now

a.     Stopping apache

                                          i.    Right click apache service icon

                                         ii.    And click “Open Apache Monitor

                                        iii.    Click Stop button.

b.    Stopping tomcat

                                          i.    Press “Ctrl^C” in the tomcat console

4)   Download “Tomcat-connectors-1.2.27-src.zip” and unzip it.

a.     Copy the following files from “C:\tomcat-connectors-1.2.27-src\conf

                                          i.    uriworkermap.properties

                                         ii.    workers.properties

                                        iii.    workers.properties.minimal

b.    Paste in here – “C:\apache-tomcat-6.0.16\conf”

5)   Download “mod_jk-1.2.27-httpd-2.2.10.so” from the following path

a.     Path : http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.27/

b.    Ref:

c.     Rename from “mod_jk-1.2.27-httpd-2.2.10.so” to “mod_jk.so

d.    Copy “mod_jk.so” and paste in here – “C:\Program Files\Apache Software Foundation\Apache2.2\modules”

6)   Configure Apache

a.     Open “httpd.conf” from “C:\Program Files\Apache Software Foundation\Apache2.2\conf”

b.    Add the following code snippet at the end of the file “httpd.conf”

LoadModule jk_module “C:/Program Files/Apache Software Foundation/Apache2.2/modules/mod_jk.so”

 

JkWorkersFile “C:/apache-tomcat-6.0.16/conf/workers.properties”

JkLogFile “C:/apache-tomcat-6.0.16/conf/from_apache_mod_jk.log”

JkLogLevel info

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

 

# Send servlet for context /examples to worker named ajp13

JkMount /examples ajp13

# Send JSPs for context /examples/* to worker named ajp13

JkMount /examples/* ajp13

7)   Configure Tomcat

a.     Open “server.xml” from “C:\apache-tomcat-6.0.16\conf\server.xml”

b.    Add the following inside “<Server>” element

  <Listener className=”org.apache.jk.config.ApacheConfig” modJk=”C:/Program Files/Apache Software Foundation/Apache2.2/modules/mod_jk.so” />

c.     Add the following between “<Host>”  “</Host>”

<Listener className=”org.apache.jk.config.ApacheConfig” modJk=”C:/Program Files/Apache Software Foundation/Apache2.2/modules/mod_jk.so” />

8)    Start tomcat

9)   Wait sometime 5 or 10 seconds

10)                 Start apache

a.     Start apache

                                          i.    Right click apache service icon

                                         ii.    And click “Open Apache Monitor

                                        iii.    Click Start button.

11) Type “http://localhost/examples/

a.     Ref:

b.    Click “Servlets examples

 

 

                                    

Leave a Reply