You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joe <jo...@sgweb.com.sg> on 2003/05/30 13:21:55 UTC

Need Help in clearing my doubts

Hi all, 

I have a question on running Apache and Tomcat with the use of mod_jk
connector. With all the guide I have gathered from the web. Below are my
configuration:

Red Hat 8.0
Apache 2.0.46 Using Port 80
Tomcat 4.1.24 Using Port 8080
J2SDK 1.4.1

I have no problem running these two applications. However, I cannot
seems to access the default 'example' folder that comes with tomcat on
port 80. Accessing it on port 8080 has no problem for me. 

Please note that all my configuration is done with the help of the
following url:

http://www.johnturner.com/howto/rh72-howto.html

According to one of the mail which I have received, I saw him putting
this in apache : httpd.conf:

========================================================================
====
  JkWorkersFile
/home/gmh2441/uPortal/Tomcat_4-0-4/conf/workers.properties
  JkLogFile /home/gmh2441/uPortal/Tomcat_4-0-4/logs/mod_jk.log
  JkLogLevel debug
  JkOptions +ForwardDirectories
  Alias /examples /home/gmh2441/uPortal/Tomcat_4-0-4/webapps/examples
  <Directory "/home/gmh2441/uPortal/Tomcat_4-0-4/webapps/examples">
        Options Indexes FollowSymLinks
  </Directory>          
  <Location "/examples/WEB-INF/">
    AllowOverride None
    deny from all
  </Location>  
========================================================================
====

I tried putting the same thing into my httpd.conf, and now accessing the
example folder on port 80 works!. 

My question is :

1) Based on the above config, it is asking apache to 're-direct' this
folder to the tomcat container and thus run on it. In that case, is
apache pushing all the jobs to tomcat instead?. What if some of the
files in this folder contains some html and is tomcat or apache
processing it??

2) Secondly, if I were to have more folders which I need to publish on
the web, does it mean that I have to add or of it on this config file in
order for it to work?

3) I would appreciate if there are some kind soul could give me some URL
on how to utilize apache tomcat to process both static and jsp content.

Thanks in advance,
Joe








---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Need Help in clearing my doubts

Posted by John Turner <to...@johnturner.com>.
On Fri, 30 May 2003 19:21:55 +0800, Joe <jo...@sgweb.com.sg> wrote:

> http://www.johnturner.com/howto/rh72-howto.html
>
> According to one of the mail which I have received, I saw him putting
> this in apache : httpd.conf:
>
> ========================================================================
> ====
> JkWorkersFile
> /home/gmh2441/uPortal/Tomcat_4-0-4/conf/workers.properties
> JkLogFile /home/gmh2441/uPortal/Tomcat_4-0-4/logs/mod_jk.log
> JkLogLevel debug
> JkOptions +ForwardDirectories
> Alias /examples /home/gmh2441/uPortal/Tomcat_4-0-4/webapps/examples
> <Directory "/home/gmh2441/uPortal/Tomcat_4-0-4/webapps/examples">
> Options Indexes FollowSymLinks
> </Directory>          <Location "/examples/WEB-INF/">
> AllowOverride None
> deny from all
> </Location>  
> ========================================================================
> ====
>
> I tried putting the same thing into my httpd.conf, and now accessing the
> example folder on port 80 works!.

Well, you must have more than that in your httpd.conf, like a JkMount 
statement.

>
> My question is :
>
> 1) Based on the above config, it is asking apache to 're-direct' this
> folder to the tomcat container and thus run on it. In that case, is
> apache pushing all the jobs to tomcat instead?. What if some of the
> files in this folder contains some html and is tomcat or apache
> processing it??

What Apache sends to Tomcat is governed by the JkMount statment.  If you 
have:

JkMount /* ajp13

then everything goes to Tomcat making Apache fairly redundant.  If, on the 
other hand, you have:

JkMount /*.jsp ajp13
JkMount /servlet/* ajp13

then only JSP and requests with /servlet in the URL go to Tomcat.

>
> 2) Secondly, if I were to have more folders which I need to publish on
> the web, does it mean that I have to add or of it on this config file in
> order for it to work?

Yes.  Every "folder" (aka Context, aka web application) needs at least a 
JkMount statement...the other stuff is security to keep people from making 
direct requests into WEB-INF, etc. and aliasing to allow Apache to find 
static content that it needs.

>
> 3) I would appreciate if there are some kind soul could give me some URL
> on how to utilize apache tomcat to process both static and jsp content.

This is covered in the HOWTO, it is driven by the JkMount statement.

John


-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Need Help in clearing my doubts

Posted by John Turner <to...@johnturner.com>.
Thanks for the kind words.  I can tell you that I just tried Apache 2.0.45 
(from source), Tomcat 4.1.24, mod_jk 2.0.3 (from source...latest), and Red 
Hat 9.0, and everything worked fine, with only one snag, but that was a 
building Apache snag, not a mod_jk snag.

I will update my HOWTO soon, but as fas I can tell, nothing has changed 
even though Apache has revved up a couple, as has Red Hat and Tomcat.

John

On Fri, 30 May 2003 07:56:16 -0500, Geralyn M Hollerman 
<gm...@louisiana.edu> wrote:

> Joe wrote:
>> According to one of the mail which I have received, I saw him putting
>> this in apache : httpd.conf:
>>
>> ========================================================================
>> ====
>> JkWorkersFile
>> /home/gmh2441/uPortal/Tomcat_4-0-4/conf/workers.properties
>> JkLogFile /home/gmh2441/uPortal/Tomcat_4-0-4/logs/mod_jk.log
>> JkLogLevel debug
>> JkOptions +ForwardDirectories
>> Alias /examples /home/gmh2441/uPortal/Tomcat_4-0-4/webapps/examples
>> <Directory "/home/gmh2441/uPortal/Tomcat_4-0-4/webapps/examples">
>> Options Indexes FollowSymLinks
>> </Directory>
>> <Location "/examples/WEB-INF/">
>> AllowOverride None
>> deny from all
>> </Location>
>> ========================================================================
>> ====
>>
>> I tried putting the same thing into my httpd.conf, and now accessing the
>> example folder on port 80 works!.
>
> Joe,
> 'gmh2441' is me! That was an effort of mine, based on something I'd read
> - I've been to John Turner's site and tried his HOW-TO, but since we
> weren't using the exact same versions, I wasn't sure whether it would
> work or not. What I have read since, in an Apache-Tomcat book at a local
> bookstore, was that I needed that <Directory> entry in there. It works
> for you? That's GREAT! It didn't for me - but then again, there may've
> been something else unintended in there - I'll have to look again. I can
> get static files to display, but I can't get .jsps or .class files to
> execute - I see from my apache log that every request gets a 400 (bad
> request) response.
>
>
>> My question is :
>>
>> 1) Based on the above config, it is asking apache to 're-direct' this
>> folder to the tomcat container and thus run on it. In that case, is
>> apache pushing all the jobs to tomcat instead?. What if some of the
>> files in this folder contains some html and is tomcat or apache
>> processing it??
>
> I think there was a "JkMount" directive after all that - I believe that
> would decide which files go to Apache and which to Tomcat.
>
>> 2) Secondly, if I were to have more folders which I need to publish on
>> the web, does it mean that I have to add or of it on this config file in
>> order for it to work?
>
> Try this URL for the answer to this - it's a sample mod_jk.conf file
> from John Turner.
>
> http://www.johnturner.come/howto/mod_jk_conf.html
>
> Basically, if I understand your question right, the answer is yes.
>
>> 3) I would appreciate if there are some kind soul could give me some URL
>> on how to utilize apache tomcat to process both static and jsp content.
>
> Well, for starters, John Turner's site (http://www.johnturner.com) was
> excellent; there were some answers at the apache site
> (http://jakarta.apache.org/tomcat/); some more good advice at
> http://www.serverwatch.com/tutorials; and at
> http://www.oreillynet.com/pub/a/onjava/2002/11/20/tomcat.html. There was
> also something I found useful, about mod_jk2, at
> http://www.pubbitch.org/jboss/mod_jk2.html. But the main thing I found
> was that about every site I went to, I had to REALLY look around to find
> what I needed - and more often than not, I had to settle for a partial
> answer to any question I had.
>
> HTH!
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Thanks to John and Geralyn

Posted by joe <jo...@sgweb.net>.
Hi john and geralyn, thanks for the warmly and prompt reply. I think now at
least i know what is going on.However, i'm still unsure of the following
things:

1) Based on John wonderful's Howto, i think you are using both mod_jk.so and
mod_jk-2.0.43.so. I was wondering is it a typo or this should be the way.
Kind of confused here when i saw version appearing on it.

2) I had tried downloading mod_jk2 source connector from jakarta website but
i have problem building the connectors. I tried to build by first modifying
the workers.properties to suits my configuration and then followed by
invoking 'ant' command on it. It gave me this error, saying
/usr/local/tomcat-jk2-connector/coyote/.... not found. My check with the
folder is that there isn't such a folder named coyote. What should be the
proper way to build mod-jk2? or can i just use the binary version available
on apache website which is meant for apache 2.0.42, wherelse i'm using
2.0.46?

Regards,
Joe


----- Original Message ----- 
From: "Geralyn M Hollerman" <gm...@louisiana.edu>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, May 30, 2003 8:56 PM
Subject: Re: Need Help in clearing my doubts


> Joe wrote:
> > According to one of the mail which I have received, I saw him putting
> > this in apache : httpd.conf:
> >
> > ========================================================================
> > ====
> >   JkWorkersFile
> > /home/gmh2441/uPortal/Tomcat_4-0-4/conf/workers.properties
> >   JkLogFile /home/gmh2441/uPortal/Tomcat_4-0-4/logs/mod_jk.log
> >   JkLogLevel debug
> >   JkOptions +ForwardDirectories
> >   Alias /examples /home/gmh2441/uPortal/Tomcat_4-0-4/webapps/examples
> >   <Directory "/home/gmh2441/uPortal/Tomcat_4-0-4/webapps/examples">
> >         Options Indexes FollowSymLinks
> >   </Directory>
> >   <Location "/examples/WEB-INF/">
> >     AllowOverride None
> >     deny from all
> >   </Location>
> > ========================================================================
> > ====
> >
> > I tried putting the same thing into my httpd.conf, and now accessing the
> > example folder on port 80 works!.
>
> Joe,
> 'gmh2441' is me! That was an effort of mine, based on something I'd read
> - I've been to John Turner's site and tried his HOW-TO, but since we
> weren't using the exact same versions, I wasn't sure whether it would
> work or not. What I have read since, in an Apache-Tomcat book at a local
> bookstore, was that I needed that <Directory> entry in there. It works
> for you? That's GREAT! It didn't for me - but then again, there may've
> been something else unintended in there - I'll have to look again. I can
> get static files to display, but I can't get .jsps or .class files to
> execute - I see from my apache log that every request gets a 400 (bad
> request) response.
>
>
> > My question is :
> >
> > 1) Based on the above config, it is asking apache to 're-direct' this
> > folder to the tomcat container and thus run on it. In that case, is
> > apache pushing all the jobs to tomcat instead?. What if some of the
> > files in this folder contains some html and is tomcat or apache
> > processing it??
>
> I think there was a "JkMount" directive after all that - I believe that
> would decide which files go to Apache and which to Tomcat.
>
> > 2) Secondly, if I were to have more folders which I need to publish on
> > the web, does it mean that I have to add or of it on this config file in
> > order for it to work?
>
> Try this URL for the answer to this - it's a sample mod_jk.conf file
> from John Turner.
>
> http://www.johnturner.come/howto/mod_jk_conf.html
>
> Basically, if I understand your question right, the answer is yes.
>
> > 3) I would appreciate if there are some kind soul could give me some URL
> > on how to utilize apache tomcat to process both static and jsp content.
>
> Well, for starters, John Turner's site (http://www.johnturner.com) was
> excellent; there were some answers at the apache site
> (http://jakarta.apache.org/tomcat/); some more good advice at
> http://www.serverwatch.com/tutorials; and at
> http://www.oreillynet.com/pub/a/onjava/2002/11/20/tomcat.html. There was
> also something I found useful, about mod_jk2, at
> http://www.pubbitch.org/jboss/mod_jk2.html. But the main thing I found
> was that about every site I went to, I had to REALLY look around to find
> what I needed - and more often than not, I had to settle for a partial
> answer to any question I had.
>
> HTH!
>
> -- 
> Lynn Hollerman.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Need Help in clearing my doubts

Posted by Geralyn M Hollerman <gm...@louisiana.edu>.
Joe wrote:
> According to one of the mail which I have received, I saw him putting
> this in apache : httpd.conf:
> 
> ========================================================================
> ====
>   JkWorkersFile
> /home/gmh2441/uPortal/Tomcat_4-0-4/conf/workers.properties
>   JkLogFile /home/gmh2441/uPortal/Tomcat_4-0-4/logs/mod_jk.log
>   JkLogLevel debug
>   JkOptions +ForwardDirectories
>   Alias /examples /home/gmh2441/uPortal/Tomcat_4-0-4/webapps/examples
>   <Directory "/home/gmh2441/uPortal/Tomcat_4-0-4/webapps/examples">
>         Options Indexes FollowSymLinks
>   </Directory>
>   <Location "/examples/WEB-INF/">
>     AllowOverride None
>     deny from all
>   </Location>
> ========================================================================
> ====
> 
> I tried putting the same thing into my httpd.conf, and now accessing the
> example folder on port 80 works!.

Joe,
'gmh2441' is me! That was an effort of mine, based on something I'd read
- I've been to John Turner's site and tried his HOW-TO, but since we
weren't using the exact same versions, I wasn't sure whether it would
work or not. What I have read since, in an Apache-Tomcat book at a local
bookstore, was that I needed that <Directory> entry in there. It works
for you? That's GREAT! It didn't for me - but then again, there may've
been something else unintended in there - I'll have to look again. I can
get static files to display, but I can't get .jsps or .class files to
execute - I see from my apache log that every request gets a 400 (bad
request) response.


> My question is :
> 
> 1) Based on the above config, it is asking apache to 're-direct' this
> folder to the tomcat container and thus run on it. In that case, is
> apache pushing all the jobs to tomcat instead?. What if some of the
> files in this folder contains some html and is tomcat or apache
> processing it??

I think there was a "JkMount" directive after all that - I believe that
would decide which files go to Apache and which to Tomcat.

> 2) Secondly, if I were to have more folders which I need to publish on
> the web, does it mean that I have to add or of it on this config file in
> order for it to work?

Try this URL for the answer to this - it's a sample mod_jk.conf file
from John Turner.

http://www.johnturner.come/howto/mod_jk_conf.html

Basically, if I understand your question right, the answer is yes.
 
> 3) I would appreciate if there are some kind soul could give me some URL
> on how to utilize apache tomcat to process both static and jsp content.

Well, for starters, John Turner's site (http://www.johnturner.com) was
excellent; there were some answers at the apache site
(http://jakarta.apache.org/tomcat/); some more good advice at
http://www.serverwatch.com/tutorials; and at
http://www.oreillynet.com/pub/a/onjava/2002/11/20/tomcat.html. There was
also something I found useful, about mod_jk2, at
http://www.pubbitch.org/jboss/mod_jk2.html. But the main thing I found
was that about every site I went to, I had to REALLY look around to find
what I needed - and more often than not, I had to settle for a partial
answer to any question I had.

HTH!

-- 
Lynn Hollerman.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org