You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Khalil <kh...@comcast.net> on 2007/04/20 21:06:04 UTC

Connecting Tomcat 6.0.10 with Apache 2.2.4 using mod_jk-2.2.4

Hi,

I am trying to integrate Tomcat 6.0.10 with Apache 2.2.4 using mod_jk-2.2.4. The traffic seems to be flowing correctly to Tomcat on port 8080 from apache through the connector. Tomcat and Apache reside on the same machine.

I want to force apache to drop prot 8080. Since we're behined a firewall,  port 8080 is closed and also will be confusing to the users. 

I have read and re-read the docs on http://tomcat.apache.org/connectors-doc and googled for few hours now but I am just unable to do it. I must be missing something?

Here is what I have done:

I have placed these lines in apache's httpd.conf:

LoadModule jk_module modules/mod_jk.so
JkWorkersFile "C:\Program Files\Apache Software Foundation\Apache2.2\conf\workers.properties"
JkLogFile "C:\Program Files\Apache Software Foundation\Apache2.2\logs\mod_jk.log"
JkLogLevel info
<VirtualHost ip_address:80>
    JkMount /* loadbalancer
    JkMount /match2020 loadbalancer
    JkMount /match2020/* loadbalancer
</VirtualHost>

Workers.properties file looks like this:

worker.list=loadbalancer
# First tomcat server
# ------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=1

worker.loadbalancer.type=lb
worker.loadbalancer.sticky_session=1
worker.loadbalancer.balance_workers=tomcat1
#worker.loadbalancer.balance_workers=tomcat2, tomcat4, tomcat1, tomcat3

I added the following connector to server.xml in Tomcat

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" enableLookups="true"/>

Thanks

Ken

Re: Connecting Tomcat 6.0.10 with Apache 2.2.4 using mod_jk-2.2.4

Posted by Gaël Lams <la...@gmail.com>.
> My problem is I want to drop 8080 form the url. How do I do that?

If you don't need Apache (i.e you use it only to avoid having to use
port 8080 in the url) and assuming you have nothing else listening on
port 80, why don't use iptable to forward http request from port 80 to
port 8080?

You will find a thread in the archive's mailing list. Anyway, please
find below the 2 necessary lines:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT

Regards,

Gaël

Re: Connecting Tomcat 6.0.10 with Apache 2.2.4 using mod_jk-2.2.4

Posted by Khalil <kh...@comcast.net>.
Sorry for the confusion. I meant to say JK 1.2.22 which is packaged in a 
file called mod_jk-apache-2.2.4.so  which I downloaded form 
http://apache.osuosl.org/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.22/

My problem is I want to drop 8080 form the url. How do I do that?

----- Original Message ----- 
From: "Mladen Turk" <ml...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Friday, April 20, 2007 2:17 PM
Subject: Re: Connecting Tomcat 6.0.10 with Apache 2.2.4 using mod_jk-2.2.4


> Khalil wrote:
>> Hi,
>>
>> I am trying to integrate Tomcat 6.0.10 with Apache 2.2.4 using 
>> mod_jk-2.2.4.
>> I have read and re-read the docs on 
>> http://tomcat.apache.org/connectors-doc and googled
>
> If you did all that you claim you would read from:
> http://tomcat.apache.org/connectors-doc/news/20041100.html
> that JK2 is unsupported from year 2004.
>
> BTW, how did you load mod_jk-2.2.4 in apache 2.2.4 without making
> apache crash? I must admit I never try that, but hey, those binaries
> were out there before Apache 2.2 was created ;)
>
>>
>> LoadModule jk_module modules/mod_jk.so
>> JkWorkersFile "C:\Program Files\Apache Software 
>> Foundation\Apache2.2\conf\workers.properties"
>
> Those are directives for mod_jk 1.2.x
> Download the latest stable version from:
> http://tomcat.apache.org/download-connectors.cgi
>
> Regards,
> Mladen.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connecting Tomcat 6.0.10 with Apache 2.2.4 using mod_jk-2.2.4

Posted by Mladen Turk <ml...@gmail.com>.
Khalil wrote:
> Hi,
> 
> I am trying to integrate Tomcat 6.0.10 with Apache 2.2.4 using mod_jk-2.2.4.
> I have read and re-read the docs on http://tomcat.apache.org/connectors-doc and googled

If you did all that you claim you would read from:
http://tomcat.apache.org/connectors-doc/news/20041100.html
that JK2 is unsupported from year 2004.

BTW, how did you load mod_jk-2.2.4 in apache 2.2.4 without making
apache crash? I must admit I never try that, but hey, those binaries
were out there before Apache 2.2 was created ;)

> 
> LoadModule jk_module modules/mod_jk.so
> JkWorkersFile "C:\Program Files\Apache Software Foundation\Apache2.2\conf\workers.properties"

Those are directives for mod_jk 1.2.x
Download the latest stable version from:
http://tomcat.apache.org/download-connectors.cgi

Regards,
Mladen.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org