Link to home
Start Free TrialLog in
Avatar of LeanMoreTryMore
LeanMoreTryMore

asked on

Apache Web Server connect to Tomcat

We have a client want their web application to be run on Apache Web server with tomcat as a middle tier. I need to report to my manager about this.
I have tried and successfully installed Apached and Apache Tomcat. Both works BUT I follow some document to connect Tomcat to Apache, it DOES NOT WORK.

Are there any installer I can use?
I go through the Apache document but it still does not work..I think I must miss somthing..

ALSO.

Let's say if I can connect Tomcat to Apache, where do I deploy my web application?
at the moment, my application is located $TOMCAT_HOMR/webappl/HR folder.

I dont know how it work.


Please help

The version i use for Apache Server is Apache 2.0.53 (win)
Apache Tomcat 5.59



Avatar of rama_krishna580
rama_krishna580
Flag of United States of America image

Hi,

Complete instructions are available at
tomcat/tomcat-4.1-doc/jk2/index.html">http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/index.html

Here's a (minimal) configuration example.
It dispatches all requests for the 'examples' context
to Tomcat.
My setup is Apache 1.3.x/Tomcat 4.0.x on RH7.2. The
example should also be valid for your setup.

1. In httpd.conf, tell Apache to load the module:
LoadModule jk_module modules/mod_jk.so

2. In httpd.conf, configure mod_jk:
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:$S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /examples/* worker1

3. Configure workers for mod_jk in
/etc/httpd/conf/workers.properties

worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=9009
worker.worker1.lbfactor=1
worker.worker1.local_worker=1

4. In server.xml, configure Tomcat to talk to mod_jk:
<Service name="Tomcat-Standalone">
   <!-- this is the HTTP connector which was configured
        in the server.xml that came with Tomcat
   -->
  <Connector className="org.apache.catalina........ />

  <!-- This makes Tomcat talk to mod_jk -->
  <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
             port="9009"
             address="127.0.0.1" />

  <Engine........

If you don't want to access Tomcat directly via HTTP, you
can comment out the entry for the HttpConnector.

After a restart of Tomcat and Apache, Apache should
dispatch requests for the 'examples' context to Tomcat.

R.K
Avatar of LeanMoreTryMore
LeanMoreTryMore

ASKER

Is our web application reside in the $TOMCAT_HOME/webapp or in $APACHE_HOME?
Refer to your tomcat connector setting,

Is the port 9009 a Apache port?
address = 127.0.0.1  <=== Let's say i want to install apache web server on my pc, the address is my PC address, isn't it?
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial