?
Solved

Apache Web Server connect to Tomcat

Posted on 2005-05-11
4
Medium Priority
?
369 Views
Last Modified: 2010-04-20
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



0
Comment
Question by:LeanMoreTryMore
  • 2
4 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 14004264
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
0
 

Author Comment

by:LeanMoreTryMore
ID: 14007336
Is our web application reside in the $TOMCAT_HOME/webapp or in $APACHE_HOME?
0
 

Author Comment

by:LeanMoreTryMore
ID: 14023413
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?
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 total points
ID: 14024985
port 9009 is the internal port where web server (apache) and application server (tomcat) comunicate. so to answer your question: 9009 is tomcat's listen port
127.0.0.1 is localhost where to connect on 9009, for security reason this should always be localhost (127.0.0.1) which is not accessable from anywhere else (assuming apache and tomcat on same computer)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Integration Management Part 2
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question