You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lars Nielsen Lind <so...@tidtilforandring.dk> on 2006/11/15 00:22:02 UTC

Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Hi!

Which connector is the most relevant to use with Apache 2.2.3 and Tomcat 
5.5.20? Is it mod_jk or is it proxy?

And how do I use the most relevant with Apache 2.2.3 and Tomcat 5.5.20? 
(compile and implementation samples wanted if possible).

Thanks,

Lars Nielsen Lind




---------------------------------------------------------------------
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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by mi...@trollope.org.
On Thu, Nov 16, 2006 at 03:13:48PM +0100, Rainer Jung wrote:

> I didn't want to shoot at you, and yes, mod_jk documentation could be 
> much better.

> Concerning the docs: Documentation contribution will be welcome. We try 
> to add all new things in there, but parts of the documentation are 
> indeed rudimentary.

> Concerning Apache 2.2: There is no known problem special to Apache 2.2 
> with mod_jk. You set it up exactly the same way, as you do with Apache 
> 2.0. Of course, during build time, you have to use apxs from an 
> installed Apache 2.2, so the binary module will be different. But 
> features and configuration are exactly the same.

Of course, it goes almost without saying that the reason I'm looking
for documentation is that I don't know how to do it.  ;-)

As far as producing documentation goes, I am willing to offer my time
to write up or help write tutorials and how-to's related to Tomcat and
even Apache (though that is a bit far from my normal channels of
usage).  As a part of my job, I write implementation documents for my
company's software, so I have experience in that area.  What I am
short on is what you might call "research" time.

So, if you (anybody) have partially completed documentation or notes
on a how-to, I can help you get that properly finished.  And, I'm glad
to do so.

Thanks.

mp

-- 
Michael Powe		michael@trollope.org		Naugatuck CT USA
"The liberty I contend for is more than toleration.  The very idea of
toleration is despicable; it supposes that some have a pre-eminence
above the rest to grant indulgence; whereas all should be equally
free, Jews, Turks, Pagans and Christians.  Test Oaths and established
creeds should be avoided as the worst of evils." -- Baptist minister
John Leland (1754-1841)

Re: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Nov 16, 2006, at 9:13 AM, Rainer Jung wrote:

> Hi Michael,
>
> I didn't want to shoot at you, and yes, mod_jk documentation could  
> be much better.
>

Assuming it's up to date :)


---------------------------------------------------------------------
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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Michael,

I didn't want to shoot at you, and yes, mod_jk documentation could be 
much better.

Concerning the docs: Documentation contribution will be welcome. We try 
to add all new things in there, but parts of the documentation are 
indeed rudimentary.

Concerning Apache 2.2: There is no known problem special to Apache 2.2 
with mod_jk. You set it up exactly the same way, as you do with Apache 
2.0. Of course, during build time, you have to use apxs from an 
installed Apache 2.2, so the binary module will be different. But 
features and configuration are exactly the same.

Regards,

Rainer

michael@trollope.org wrote:
> On Wed, Nov 15, 2006 at 11:25:20PM +0100, Rainer Jung wrote:
> 
>>michael@trollope.org schrieb:
> 
> 
>>>On Wed, Nov 15, 2006 at 12:22:02AM +0100, Lars Nielsen Lind wrote:
>>
>>>Everything I have read says that mod_jk will not work with 2.2.  What
>>>little information is available says use the proxy modules.
> 
> 
>>There is no known problem concerniong usage of mod_jk in combination
>>with Apache 2.2. Grab mod_jk 1.2.19 and build it against apache 2.2
>>using the same flags as for 2.0. This will work.
> 
> 
> All I can say is that I googled around extensively, trying to learn
> how to set up Tomcat 5.5 with Apache 2.2 as the front end, and found
> many sites saying to stay away from mod_jk, along with mailing list
> messages about the problems people were having with it.  It goes
> without saying, that when you have to depend on mailing list messages
> for documentation of any problem, you have a high likelihood of
> getting it wrong.  Especially when you are under the gun and trying to
> complete a project and not wanting to spend all this time figuring out
> how to do what ought to be quite straightforward.
> 
> The Apache Software Foundation produces some of the best and most
> useful software in the world.  They simultaneously produce some of the
> worst user documentation for that software.  If you want to achieve a
> shortlived feeling of amazement, go to http://www.apache.org and
> search for the expression mod_jk.  You'll get four hits for
> mod_proxy.  Now search for "mod_jk" (with quotation marks).  You'll
> get two mailing list messages from the httpd mailing list.  I can but
> shake my head.
> 
> 
>>>Then, there are about a zillion ways to proxy and next to NO
>>>documentation on actually using them.  
> 
> 
>>If you want to use mod_proxy, it is important to know, that most
>>documentation for mod_proxy_balancer is contained in apaches
>>documentation page for mod_proxy, not on the page for
>>mod_proxy_balancer :)
> 
> 
> Well, good luck.  I wanted to set up Apache 2.2 with Tomcat 5.5, to
> proxy user directories (/home/user/public_html) with Apache to serve
> static content and Tomcat to serve JSP/servlets.  Nothing.
> Zip. Nada.  I know I'm not the only person that ever wanted to do
> this.  But I could not find documenation anywhere.  Hell, I'd buy the
> book if there was one available.
> 
> It really made me appreciate how well-organized other free software
> projects are, that do provide targeted documentation for their end
> users. 
> 
> Thanks.
> 
> mp
> 

---------------------------------------------------------------------
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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Joe Riopel <go...@gmail.com>.
I am not saying this is 100% correct, or the best documentation ever
but I wrote a small install guide for Apache 2.2 and Tomcat 5.5 with
mod_jk. I used the same steps on a RH7.3 box and a Slackware 10.2 box.

http://www.crankhouse.com/howto.php?f=modjk

On 11/16/06, Christopher Schultz <ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Michael,
>
> michael@trollope.org wrote:
> > All I can say is that I googled around extensively, trying to learn
> > how to set up Tomcat 5.5 with Apache 2.2 as the front end, and found
> > many sites saying to stay away from mod_jk, along with mailing list
> > messages about the problems people were having with it.
>
> I have no idea why so many people have problems with mod_jk. I have
> never had a single problem with it. It's stupid simple to install:
>
> 1. Download and untar (gnu tar!)
> 2. $cd native
> 3. ./configure --with-apxs=/path/to/apxs
> 4. make
> 5. make install (as root)
>
> It works for me every time. Setup is slightly more complex, because you
> need to have a "workers" file (but you can avoid that in recent versions
> of mod_jk) which trips some folks up.
>
> > It goes
> > without saying, that when you have to depend on mailing list messages
> > for documentation of any problem, you have a high likelihood of
> > getting it wrong.
>
> This list is highly active, and with Rainer Jung on the list (who knows
> more than anyone really should about mod_jk ;) ), you should always be
> able to get good advise.
>
> > Especially when you are under the gun and trying to
> > complete a project and not wanting to spend all this time figuring out
> > how to do what ought to be quite straightforward.
>
> Agreed. At this point, since it's been a few days, you have probably
> tried something already. What did you try and how did it go?
>
> > The Apache Software Foundation produces some of the best and most
> > useful software in the world.  They simultaneously produce some of the
> > worst user documentation for that software.
>
> I completely agree. Many software developers are simply terrible
> writers. It's not their fault, it's just the truth. Most folks who get
> into OSS are coders because, well, software is the name of the game.
> There aren't too many professors of literature on these projects ;)
>
> > If you want to achieve a
> > shortlived feeling of amazement, go to http://www.apache.org and
> > search for the expression mod_jk.  You'll get four hits for
> > mod_proxy.  Now search for "mod_jk" (with quotation marks).  You'll
> > get two mailing list messages from the httpd mailing list.  I can but
> > shake my head.
>
> Aah. I think the problem is that you were searching www.apache.org,
> instead of the Tomcat-related pages. Yes, mod_jk is an Apache httpd
> module, but it's a non-standard module (that is, it isn't bundled with
> the source or binary distributions). It should be considered a 3rd-party
> module.
>
> Essentially all information about mod_jk is available through the Tomcat
> website, not www.apache.org. Sorry about that. :(
>
> > Well, good luck.  I wanted to set up Apache 2.2 with Tomcat 5.5, to
> > proxy user directories (/home/user/public_html) with Apache to serve
> > static content and Tomcat to serve JSP/servlets.  Nothing.
> > Zip. Nada.  I know I'm not the only person that ever wanted to do
> > this.  But I could not find documentation anywhere.  Hell, I'd buy the
> > book if there was one available.
>
> I had the same experience. One of the engineers on my team decided to
> install all the latest versions of everything on his dev environment
> instead of matching production. That meant using Apache httpd 2.2
> instead 2.0, and he pointed out that somewhere, there was the wild-ass
> claim that mod_proxy_ajp was the way to connect to Tomcat in 2.2.
>
> Well, we looked for documentation on how to connect them and it just
> doesn't exist. Just a lot of people saying "yeah, yeah... use
> mod_proxy_ajp". mod_proxy_ajp has (or at least had) no documentation
> whatsoever and so you have to read all about mod_proxy. No problem. You
> read all about mod_proxy and it's all about proxying HTTP, not ajp13.
> So, on a hunch, I simply changed the example do something like this:
>
> Proxy /someURI ajp13://localhost/someOtherURI
>
> and it worked. Lucky guess without any indication from the mod_proxy
> documentation that this was even possible.
>
> After getting that simple thing set up, we tried some of our more exotic
> configuration settings. For instance, we have /most/ of our webapp's
> URIs going to one worker (Tomcat running our app), but some of them need
> to go to another worker (Cocoon running in a separate Tomcat instance).
> It appears that mod_proxy only supports blindly proxying everything in a
> particular URL space, so we were out of luck.
>
> Not to be beaten by mod_proxy, we came up with a solution that involved
> re-writing the URIs using mod_rewrite so that the URL was outside of the
> URI space of the webapp, and then proxying it appropriately. Something
> like this (forgive the completely incorrect syntax):
>
> RewriteRule /myApp/something/special -> /outside/something/special
>
> Proxy /myApp ajp13://localhost:8185/myApp
> Proxy /outside ajp13://localhost:8285/myApp
>
> Since we had like a dozen special URIs like this, we had re-writes all
> over the place. When we looked at the final configuration, we both
> nearly vomited and just went back to using mod_jk, which does patch
> matching.
>
> I hope this gives you some more insight into why I prefer mod_jk and why
> I think doesn't deserve the bogeyman reputation it has.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFXHVy9CaO5/Lv0PARAgSLAJ9eYM4vZjMrQXTY5HX7hDMmUHY9swCgrAgh
> N6+ycSaSQYeg7bhNbee0cQQ=
> =c+ce
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> 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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael,

michael@trollope.org wrote:
> All I can say is that I googled around extensively, trying to learn
> how to set up Tomcat 5.5 with Apache 2.2 as the front end, and found
> many sites saying to stay away from mod_jk, along with mailing list
> messages about the problems people were having with it.

I have no idea why so many people have problems with mod_jk. I have
never had a single problem with it. It's stupid simple to install:

1. Download and untar (gnu tar!)
2. $cd native
3. ./configure --with-apxs=/path/to/apxs
4. make
5. make install (as root)

It works for me every time. Setup is slightly more complex, because you
need to have a "workers" file (but you can avoid that in recent versions
of mod_jk) which trips some folks up.

> It goes
> without saying, that when you have to depend on mailing list messages
> for documentation of any problem, you have a high likelihood of
> getting it wrong.

This list is highly active, and with Rainer Jung on the list (who knows
more than anyone really should about mod_jk ;) ), you should always be
able to get good advise.

> Especially when you are under the gun and trying to
> complete a project and not wanting to spend all this time figuring out
> how to do what ought to be quite straightforward.

Agreed. At this point, since it's been a few days, you have probably
tried something already. What did you try and how did it go?

> The Apache Software Foundation produces some of the best and most
> useful software in the world.  They simultaneously produce some of the
> worst user documentation for that software.

I completely agree. Many software developers are simply terrible
writers. It's not their fault, it's just the truth. Most folks who get
into OSS are coders because, well, software is the name of the game.
There aren't too many professors of literature on these projects ;)

> If you want to achieve a
> shortlived feeling of amazement, go to http://www.apache.org and
> search for the expression mod_jk.  You'll get four hits for
> mod_proxy.  Now search for "mod_jk" (with quotation marks).  You'll
> get two mailing list messages from the httpd mailing list.  I can but
> shake my head.

Aah. I think the problem is that you were searching www.apache.org,
instead of the Tomcat-related pages. Yes, mod_jk is an Apache httpd
module, but it's a non-standard module (that is, it isn't bundled with
the source or binary distributions). It should be considered a 3rd-party
module.

Essentially all information about mod_jk is available through the Tomcat
website, not www.apache.org. Sorry about that. :(

> Well, good luck.  I wanted to set up Apache 2.2 with Tomcat 5.5, to
> proxy user directories (/home/user/public_html) with Apache to serve
> static content and Tomcat to serve JSP/servlets.  Nothing.
> Zip. Nada.  I know I'm not the only person that ever wanted to do
> this.  But I could not find documentation anywhere.  Hell, I'd buy the
> book if there was one available.

I had the same experience. One of the engineers on my team decided to
install all the latest versions of everything on his dev environment
instead of matching production. That meant using Apache httpd 2.2
instead 2.0, and he pointed out that somewhere, there was the wild-ass
claim that mod_proxy_ajp was the way to connect to Tomcat in 2.2.

Well, we looked for documentation on how to connect them and it just
doesn't exist. Just a lot of people saying "yeah, yeah... use
mod_proxy_ajp". mod_proxy_ajp has (or at least had) no documentation
whatsoever and so you have to read all about mod_proxy. No problem. You
read all about mod_proxy and it's all about proxying HTTP, not ajp13.
So, on a hunch, I simply changed the example do something like this:

Proxy /someURI ajp13://localhost/someOtherURI

and it worked. Lucky guess without any indication from the mod_proxy
documentation that this was even possible.

After getting that simple thing set up, we tried some of our more exotic
configuration settings. For instance, we have /most/ of our webapp's
URIs going to one worker (Tomcat running our app), but some of them need
to go to another worker (Cocoon running in a separate Tomcat instance).
It appears that mod_proxy only supports blindly proxying everything in a
particular URL space, so we were out of luck.

Not to be beaten by mod_proxy, we came up with a solution that involved
re-writing the URIs using mod_rewrite so that the URL was outside of the
URI space of the webapp, and then proxying it appropriately. Something
like this (forgive the completely incorrect syntax):

RewriteRule /myApp/something/special -> /outside/something/special

Proxy /myApp ajp13://localhost:8185/myApp
Proxy /outside ajp13://localhost:8285/myApp

Since we had like a dozen special URIs like this, we had re-writes all
over the place. When we looked at the final configuration, we both
nearly vomited and just went back to using mod_jk, which does patch
matching.

I hope this gives you some more insight into why I prefer mod_jk and why
I think doesn't deserve the bogeyman reputation it has.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFXHVy9CaO5/Lv0PARAgSLAJ9eYM4vZjMrQXTY5HX7hDMmUHY9swCgrAgh
N6+ycSaSQYeg7bhNbee0cQQ=
=c+ce
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by mi...@trollope.org.
On Wed, Nov 15, 2006 at 11:25:20PM +0100, Rainer Jung wrote:
> michael@trollope.org schrieb:

> > On Wed, Nov 15, 2006 at 12:22:02AM +0100, Lars Nielsen Lind wrote:
> 
> > Everything I have read says that mod_jk will not work with 2.2.  What
> > little information is available says use the proxy modules.

> There is no known problem concerniong usage of mod_jk in combination
> with Apache 2.2. Grab mod_jk 1.2.19 and build it against apache 2.2
> using the same flags as for 2.0. This will work.

All I can say is that I googled around extensively, trying to learn
how to set up Tomcat 5.5 with Apache 2.2 as the front end, and found
many sites saying to stay away from mod_jk, along with mailing list
messages about the problems people were having with it.  It goes
without saying, that when you have to depend on mailing list messages
for documentation of any problem, you have a high likelihood of
getting it wrong.  Especially when you are under the gun and trying to
complete a project and not wanting to spend all this time figuring out
how to do what ought to be quite straightforward.

The Apache Software Foundation produces some of the best and most
useful software in the world.  They simultaneously produce some of the
worst user documentation for that software.  If you want to achieve a
shortlived feeling of amazement, go to http://www.apache.org and
search for the expression mod_jk.  You'll get four hits for
mod_proxy.  Now search for "mod_jk" (with quotation marks).  You'll
get two mailing list messages from the httpd mailing list.  I can but
shake my head.

> > Then, there are about a zillion ways to proxy and next to NO
> > documentation on actually using them.  

> If you want to use mod_proxy, it is important to know, that most
> documentation for mod_proxy_balancer is contained in apaches
> documentation page for mod_proxy, not on the page for
> mod_proxy_balancer :)

Well, good luck.  I wanted to set up Apache 2.2 with Tomcat 5.5, to
proxy user directories (/home/user/public_html) with Apache to serve
static content and Tomcat to serve JSP/servlets.  Nothing.
Zip. Nada.  I know I'm not the only person that ever wanted to do
this.  But I could not find documenation anywhere.  Hell, I'd buy the
book if there was one available.

It really made me appreciate how well-organized other free software
projects are, that do provide targeted documentation for their end
users. 

Thanks.

mp

-- 
Michael Powe		michael@trollope.org		Naugatuck CT USA
"After I asked him what he meant, he replied that freedom consisted of
the unimpeded right to get rich, to use his ability, no matter what the
cost to others, to win advancement." -- Norman Thomas

Re: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by mi...@trollope.org.
On Thu, Nov 16, 2006 at 05:03:29PM +0100, Rainer Jung wrote:

> It's not the right list to discuss, but:

> As a user I would expect configuration info for load-balancing with
> mod_proxy_balancer on the mod_proxy_balancer page.

> The fact, that all configurations for the proxy balancer are done by
> attributes, and the only full size apache directives concerning
> mod_proxy_balancer are in fact handled by mod_proxy unfortunately
> leads to the result, that the doc is only on the mod_proxy page.

> The user doesn't yet know, that he wants to use ProxyPass, he only
> knows he wants to add load balancing and looks at the page of
> mod_proxy_balancer, because this component is supposed to implement
> the balancing. At this point the user usually hasn't read the code
> to find out, that the configs are in fact handled by mod_proxy
> itself :)

There are at least several underlying issues.  At the top of the list,
I would put that apache.org does not have an overall design of the
relationships between the various categories of information.
Basically, information is burped out into a category, based on
someone's assessment of where it belongs.  But, without a plan in
place to link that information to all the other categories to which it
would be relevant, those links are only made when it happens to occur
to that hypothetical "someone" that they should be in there.

At least, that is the way it appears to this "someone" from the
outside. 

apache.org is, fundamentally, a gigantic, unindexed reference manual.
If you need the technical information about a <directive>, you've got
it.  If you need to know which directive to use, it is not the best
first place to look.  Unfortunately, when you depend on third parties
to produce your user documentation, the most widely-read documentation
is going to be far behind the development (_Tomcat: The Definitive
Guide_, last updated 2003).

Yes, of course, there are all kinds of reasons why this turned out to
be this way.  I won't go on beating up on the ASF.  I just want the
this great software project and all its worthwhile subprojects to have
a web site that reflects the quality of the product.  And, in
particular, of course, to have the information I want when I want it!!
;-)

Thanks.

mp

-- 
Michael Powe		michael@trollope.org		Naugatuck CT USA


And your crybaby whiny opinion would be.....?

Re: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Jim,

It's not the right list to discuss, but:

As a user I would expect configuration info for load-balancing with 
mod_proxy_balancer on the mod_proxy_balancer page.

The fact, that all configurations for the proxy balancer are done by 
attributes, and the only full size apache directives concerning 
mod_proxy_balancer are in fact handled by mod_proxy unfortunately leads 
to the result, that the doc is only on the mod_proxy page.

The user doesn't yet know, that he wants to use ProxyPass, he only knows 
he wants to add load balancing and looks at the page of 
mod_proxy_balancer, because this component is supposed to implement the 
balancing. At this point the user usually hasn't read the code to find 
out, that the configs are in fact handled by mod_proxy itself :)

Regards,

Rainer

Jim Jagielski wrote:
> 
> On Nov 15, 2006, at 5:42 PM, Caldarale, Charles R wrote:
> 
>>> From: Rainer Jung [mailto:rainer.jung@kippdata.de]
>>> Subject: Re: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?
>>>
>>> If you want to use mod_proxy, it is important to know, that most
>>> documentation for mod_proxy_balancer is contained in apaches
>>> documentation page for mod_proxy, not on the page for
>>> mod_proxy_balancer :)
>>
>> "My brain 'urts!"  (Spoken with a thick Yorkshire accent :-)
>>
> 
> Why? Let's see, I want to use mod_proxy's ProxyPass. I should
> look someplace other than mod_proxy docs for that info :)
> 
> 
> ---------------------------------------------------------------------
> 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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Nov 15, 2006, at 5:42 PM, Caldarale, Charles R wrote:

>> From: Rainer Jung [mailto:rainer.jung@kippdata.de]
>> Subject: Re: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?
>>
>> If you want to use mod_proxy, it is important to know, that most
>> documentation for mod_proxy_balancer is contained in apaches
>> documentation page for mod_proxy, not on the page for
>> mod_proxy_balancer :)
>
> "My brain 'urts!"  (Spoken with a thick Yorkshire accent :-)
>

Why? Let's see, I want to use mod_proxy's ProxyPass. I should
look someplace other than mod_proxy docs for that info :)


---------------------------------------------------------------------
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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Rainer Jung [mailto:rainer.jung@kippdata.de] 
> Subject: Re: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?
> 
> If you want to use mod_proxy, it is important to know, that most
> documentation for mod_proxy_balancer is contained in apaches
> documentation page for mod_proxy, not on the page for 
> mod_proxy_balancer :)

"My brain 'urts!"  (Spoken with a thick Yorkshire accent :-)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Rainer Jung <ra...@kippdata.de>.
michael@trollope.org schrieb:
> On Wed, Nov 15, 2006 at 12:22:02AM +0100, Lars Nielsen Lind wrote:

> Everything I have read says that mod_jk will not work with 2.2.  What
> little information is available says use the proxy modules.

There is no known problem concerniong usage of mod_jk in combination
with Apache 2.2. Grab mod_jk 1.2.19 and build it against apache 2.2
using the same flags as for 2.0. This will work.

> Then, there are about a zillion ways to proxy and next to NO
> documentation on actually using them.  

If you want to use mod_proxy, it is important to know, that most
documentation for mod_proxy_balancer is contained in apaches
documentation page for mod_proxy, not on the page for mod_proxy_balancer :)


---------------------------------------------------------------------
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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by mi...@trollope.org.
On Wed, Nov 15, 2006 at 12:22:02AM +0100, Lars Nielsen Lind wrote:

> Which connector is the most relevant to use with Apache 2.2.3 and Tomcat 
> 5.5.20? Is it mod_jk or is it proxy?
> 
> And how do I use the most relevant with Apache 2.2.3 and Tomcat 5.5.20? 
> (compile and implementation samples wanted if possible).

Everything I have read says that mod_jk will not work with 2.2.  What
little information is available says use the proxy modules.

You should specify these modules to be built during the building of
Apache and then load them:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

Then, there are about a zillion ways to proxy and next to NO
documentation on actually using them.  I found this simple approach
works, as long as you are asking nothing more than shooting every
request through to Tomcat:

<Location / >
   ProxyPass ajp://localhost:8009/
</Location>

Thanks.

mp

-- 
Michael Powe		michael@trollope.org		Naugatuck CT USA
It goes against the grain of modern education to teach children to
program. What fun is there in making plans, acquiring discipline in
organizing thoughts, devoting attention to detail and learning to be
self-critical?  --Alan Perlis, Epigrams in Programming

Re: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Lars,

Lars Nielsen Lind schrieb:
> I have tried with mod_jk but can't make it work. I get this err msg in
> mod_jk.log:
> 
> [Wed Nov 15 00:32:34 2006] [16667:10448] [error]
> ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address
> localhost

mod_jk can not resolve the host name localhost, more precisely your
system can not resolve "localhost". Maybe it's missing in your
/etc/hosts. Can you ping localhost? Which address does it resolve to on
your host? You might try with the 192.168.1.231 from below as a quick
workaround.

Since it can not resolve localhost, your workers can not be initialized
and everything fails.

> And in my httpd.conf:
> 
> LoadModule jk_module modules/mod_jk.so
> 
> <IfModule jk_module>
>    AddModule mod_jk.c
> </IfModule>

Apache 2.0 and 2.2 no longer uses AddModule. Delete the last three lines.

> And I get an error saying something about AddModule mispelled etc.

Seee above.

Regards,

Rainer

---------------------------------------------------------------------
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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Lars Nielsen Lind <so...@tidtilforandring.dk>.
I will reply later tonight. I need to sleep. Worked all night with the 
problems and have been working today also :-)

Christopher Schultz skrev:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Lars,
>
> Lars Nielsen Lind wrote:
>   
>> I have tried with mod_jk but can't make it work. I get this err msg in
>> mod_jk.log:
>>
>> [Wed Nov 15 00:32:34 2006] [16667:10448] [error]
>> ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address
>> localhost
>>     
>
> This suggests a name resolution problem.
>
>   
>> And mod_jk this way:
>>
>> ./buildconf.sh
>> ./configure --with-apxs=/opt/apache-2.2.3/bin/apxs
>> --with-java-home=/opt/jdk1.5.0_09 --enable-jni
>>     
>
> I believe that the JNI connector is deprecated. Are you intending to run
> mod_jk with JNI? I'd like to see what the rest of the list thinks about
> that.
>
> mod_jk is telling you that it cannot resolve "localhost". What do you
> have in your /etc/resolv.conf? What about /etc/hosts? What happens if
> you "ping localhost"?
>
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFWxg59CaO5/Lv0PARAq4GAKC7cA94sm//4gFeQXYEGVCfjaKeWwCcCyeB
> 7r6GVV76ukecB3iww2jisHo=
> =wwWl
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> 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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Lars Nielsen Lind <so...@tidtilforandring.dk>.
Solved with mod_jk without JNI, and thanks for all the tips.

In my /etc/hosts there was this line:

::1   localhost.localdomain   localhost

And I added this line:

127.0.0.1   localhost.localdomain   localhost

and now I can ping localhost.




Christopher Schultz skrev:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Lars,
>
> Lars Nielsen Lind wrote:
>   
>> I have tried with mod_jk but can't make it work. I get this err msg in
>> mod_jk.log:
>>
>> [Wed Nov 15 00:32:34 2006] [16667:10448] [error]
>> ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address
>> localhost
>>     
>
> This suggests a name resolution problem.
>
>   
>> And mod_jk this way:
>>
>> ./buildconf.sh
>> ./configure --with-apxs=/opt/apache-2.2.3/bin/apxs
>> --with-java-home=/opt/jdk1.5.0_09 --enable-jni
>>     
>
> I believe that the JNI connector is deprecated. Are you intending to run
> mod_jk with JNI? I'd like to see what the rest of the list thinks about
> that.
>
> mod_jk is telling you that it cannot resolve "localhost". What do you
> have in your /etc/resolv.conf? What about /etc/hosts? What happens if
> you "ping localhost"?
>
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFWxg59CaO5/Lv0PARAq4GAKC7cA94sm//4gFeQXYEGVCfjaKeWwCcCyeB
> 7r6GVV76ukecB3iww2jisHo=
> =wwWl
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> 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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lars,

Lars Nielsen Lind wrote:
> I have tried with mod_jk but can't make it work. I get this err msg in
> mod_jk.log:
> 
> [Wed Nov 15 00:32:34 2006] [16667:10448] [error]
> ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address
> localhost

This suggests a name resolution problem.

> And mod_jk this way:
> 
> ./buildconf.sh
> ./configure --with-apxs=/opt/apache-2.2.3/bin/apxs
> --with-java-home=/opt/jdk1.5.0_09 --enable-jni

I believe that the JNI connector is deprecated. Are you intending to run
mod_jk with JNI? I'd like to see what the rest of the list thinks about
that.

mod_jk is telling you that it cannot resolve "localhost". What do you
have in your /etc/resolv.conf? What about /etc/hosts? What happens if
you "ping localhost"?

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFWxg59CaO5/Lv0PARAq4GAKC7cA94sm//4gFeQXYEGVCfjaKeWwCcCyeB
7r6GVV76ukecB3iww2jisHo=
=wwWl
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Lars Nielsen Lind <so...@tidtilforandring.dk>.
I have tried with mod_jk but can't make it work. I get this err msg in 
mod_jk.log:

[Wed Nov 15 00:32:34 2006] [16667:10448] [error] 
ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address localhost
[Wed Nov 15 00:32:34 2006] [16667:10448] [error] 
ajp_validate::jk_ajp_common.c (1934): invalid host and port localhost 8009
[Wed Nov 15 00:32:34 2006] [16667:10448] [error] 
wc_create_worker::jk_worker.c (158): validate failed for default
[Wed Nov 15 00:32:34 2006] [16667:10448] [error] 
build_worker_map::jk_worker.c (256): failed to create worker default
[Wed Nov 15 00:32:35 2006] [16668:10448] [error] 
ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address localhost
[Wed Nov 15 00:32:35 2006] [16668:10448] [error] 
ajp_validate::jk_ajp_common.c (1934): invalid host and port localhost 8009
[Wed Nov 15 00:32:35 2006] [16668:10448] [error] 
wc_create_worker::jk_worker.c (158): validate failed for default
[Wed Nov 15 00:32:35 2006] [16668:10448] [error] 
build_worker_map::jk_worker.c (256): failed to create worker default
[Wed Nov 15 00:34:14 2006] [16707:13840] [error] 
ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address localhost
[Wed Nov 15 00:34:14 2006] [16707:13840] [error] 
ajp_validate::jk_ajp_common.c (1934): invalid host and port localhost 8009
[Wed Nov 15 00:34:14 2006] [16707:13840] [error] 
wc_create_worker::jk_worker.c (158): validate failed for default
[Wed Nov 15 00:34:14 2006] [16707:13840] [error] 
build_worker_map::jk_worker.c (256): failed to create worker default
[Wed Nov 15 00:34:14 2006] [16708:13840] [error] 
ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address localhost
[Wed Nov 15 00:34:14 2006] [16708:13840] [error] 
ajp_validate::jk_ajp_common.c (1934): invalid host and port localhost 8009
[Wed Nov 15 00:34:14 2006] [16708:13840] [error] 
wc_create_worker::jk_worker.c (158): validate failed for default
[Wed Nov 15 00:34:14 2006] [16708:13840] [error] 
build_worker_map::jk_worker.c (256): failed to create worker default
[Wed Nov 15 00:35:10 2006] [16709:13840] [info]  jk_handler::mod_jk.c 
(2071): Could not find a worker for worker name=default
[Wed Nov 15 00:35:14 2006] [16710:13840] [info]  jk_handler::mod_jk.c 
(2071): Could not find a worker for worker name=default
[Wed Nov 15 00:35:16 2006] [16711:13840] [info]  jk_handler::mod_jk.c 
(2071): Could not find a worker for worker name=default

I have compiled Apache this way:

./configure --prefix=/opt/apache-2.2.3 --enable-ssl 
--with-ssl=/opt/openssl-0.9.8d --enable-proxy --enable-proxy-connect 
--enable-proxy-ajp --enable-so
make
make install

And mod_jk this way:

./buildconf.sh
./configure --with-apxs=/opt/apache-2.2.3/bin/apxs 
--with-java-home=/opt/jdk1.5.0_09 --enable-jni
make
make install

And in my httpd.conf:

LoadModule jk_module modules/mod_jk.so

<IfModule jk_module>
    AddModule mod_jk.c
</IfModule>

JkWorkerProperty    worker.list=default
JkWorkerProperty    worker.default.port=8009
JkWorkerProperty    worker.default.host=localhost
JkWorkerProperty    worker.default.type=ajp13

JkLogFile        /opt/apache-2.2.3/logs/mod_jk.log
JkLogLevel        info
JkLogStampFormat    "[%a %b %d %H:%M:%S %Y] "
JkRequestLogFormat    "%w %V %T"

JkOptions        +ForwardKeySize +ForwardURICompat +ForwardDirectories

<VirtualHost ...> (sample)
    JkAutoAlias    /opt/apache-tomcat-5.5.20/webapps/application
        JkMount        /*.jsp default
        JkMount        /servlet/* default
        JkMount        /cewolf/* default
        JkMount        /*.png default
</VirtualHost>

And I get an error saying something about AddModule mispelled etc.


And my server.xml:

<Host name="192.168.1.231" appBase="/opt/apache-tomcat-5.5.20/webapps" 
unpackWARs="true" autoDeploy="true" xmlValidation="false" 
xmlNamespaceAware="false">
    <Context path="/" debug="0" docBase="application" reloadable="true">
    </Context>
      </Host>


Maybe there is something wrong in the above?

Thanks,

Lars Nielsen Lind


Christopher Schultz skrev:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Lars,
>
> Lars Nielsen Lind wrote:
>   
>> Which connector is the most relevant to use with Apache 2.2.3 and Tomcat
>> 5.5.20? Is it mod_jk or is it proxy?
>>     
>
> It depends on who you are, really. You may use either mod_jk or
> mod_proxy_ajp to connect Apache httpd 2.2 to any version of Tomcat.
>
> There are several advantages of mod_proxy_ajp over mod_jk:
>
> 1. It comes bundled with Apache httpd. That means that you probably
>    don't have to compile and install it yourself.
> 2. It has a simpler configuration syntax.
>
> mod_jk offers one big advantages IMO:
>
> Rich configuration syntax allows for more exotic configuration options.
> My experience has been that it's easy to get yourself into a
> configuration where mod_proxy_ajp simply can't do the job without
> resorting to running every URL through mod_rewrite just to get it to
> work. In these cases, mod_jk configuration is cleaner.
>
> Once you decide which connector to use, then the configuration examples
> will make more sense.
>
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFWlFg9CaO5/Lv0PARAheoAKC7CsMP/lukunu5cH3wdNKI5RbgIwCeLV4h
> C44IwI9c4OiajOZ+RMHoJE4=
> =4S56
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> 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: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lars,

Lars Nielsen Lind wrote:
> Which connector is the most relevant to use with Apache 2.2.3 and Tomcat
> 5.5.20? Is it mod_jk or is it proxy?

It depends on who you are, really. You may use either mod_jk or
mod_proxy_ajp to connect Apache httpd 2.2 to any version of Tomcat.

There are several advantages of mod_proxy_ajp over mod_jk:

1. It comes bundled with Apache httpd. That means that you probably
   don't have to compile and install it yourself.
2. It has a simpler configuration syntax.

mod_jk offers one big advantages IMO:

Rich configuration syntax allows for more exotic configuration options.
My experience has been that it's easy to get yourself into a
configuration where mod_proxy_ajp simply can't do the job without
resorting to running every URL through mod_rewrite just to get it to
work. In these cases, mod_jk configuration is cleaner.

Once you decide which connector to use, then the configuration examples
will make more sense.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFWlFg9CaO5/Lv0PARAheoAKC7CsMP/lukunu5cH3wdNKI5RbgIwCeLV4h
C44IwI9c4OiajOZ+RMHoJE4=
=4S56
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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