aspose file tools*
The moose likes Tomcat and the fly likes Connection between tomcat and apache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Connection between tomcat and apache" Watch "Connection between tomcat and apache" New topic
Author

Connection between tomcat and apache

Medes Agri
Greenhorn

Joined: Jul 07, 2006
Posts: 11
Hi,

I am newbie at tomcat, I have installed it (5.5.17) under /usr/lib/ when i browse to http://localhost i get default apache page, and when i browse to htt://localhost:8080 I get default tomcat page and i can run the examples.

I have two problem, when i change the port to 80 in server.xml to get default tomcat page when you run http://localhost, it does not work it generate connection was refused....

somebody told me that i must create a connection between apache and tomcat I installed jakarta-tomcat-connectors-1.2.15 but when i run following commandos
> ./configure --with-apxs=/usr/bin/apxs2

after a while it generates following:

......
need to check for Perl first, apxs depends on it...
checking for perl... /usr/bin/perl
could not find /usr/bin/apxs2
configure: error: You must specify a valid --with-apxs path

but i know i have apxs2 under /usr/bin and i see it.

how i can solve my problem, thanks

i am newbe and need som description.
Pavel Kubal
Ranch Hand

Joined: Mar 13, 2004
Posts: 356
You need to install mod_jk plugin to Apache.

Than configure workers.properties in APACHE_HOME/conf

worker.list=ajp13

worker.ajp13.type=ajp13
worker.ajp13.host=localhost (probably)
worker.ajp13.port=8009

After that you have to configure httpd.conf in the same directory for redirecting jsp and servlet requests to Tomcat.

JkWorkersFile %APACHE_HOME%/conf/workers.properties
JkLogFile %APACHE_HOME%/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /servlets-examples/servlet/* ajp13w
JkMount /jsp-examples/*.jsp ajp13w

Take this only as an example.
Medes Agri
Greenhorn

Joined: Jul 07, 2006
Posts: 11
thanks , do you mean mod_jk connector, i used following link and install it

http://archive.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1.2.15/
 
jQuery in Action, 2nd edition
 
subject: Connection between tomcat and apache