You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Richard Richter <ri...@bgs.sk> on 2001/07/03 11:44:47 UTC
Re: JkMount in httpd.conf
Hi Dim & all...
My troubles are gone. ;-) One of the biggest problem was too sophisticated
configuration... ;-) I let myself to be inspirated by Jason Koeninger - in fact,
when I configure something I also would like to know what's the effect -
exactly. Summary: mod_jk.conf-auto included in httpd.conf interfered with my
directives. I wiped it out (include) and then I inserted all directives just
inside my VirtualHost in httpd.conf... and IT STARTED RUN!!! :-)))
I wanna thank to Dim which helped me to "drift" in good configuration of tomcat
itself - and thank to Jason for his hint to not include mod_jk.conf-auto.
Sometimes it can be good. But it is better to do it yourself - really! E.g. I
was always wondering why ajp12 worker is asked when I mounted my ajp13 worker!
So just this include was a reason. :-)))
At last: Something out of this topic. "Re: reference material" - Dmitri wrote
something about look at mod_jk-howt and tomcat-apache-howto... so...
In these HTMLs (on the server - so called "latest documentation" or something
;-)) is mentioned ApJServMount... really often! This confused me always I read
it. Because both documents are in mod_jk section of documentation... In fact -
tomcat-apache-howto starts with mod_jk and config examples are with these
ApJServMounts... Hm? Is it historical reason? (Many times mentioned problem of
documentation to Tomcat?)
Oh - one another question:
For one webapp I have these lines inside VirtualHost in httpd.conf (virgo is
worker ;-)):
JkMount /*.jsp virgo # this is common for all webapps
JkMount /admin/* virgo # this is because of servlets
# Admin application
Alias /admin "/export/home/ias/jakarta-tomcat-3.2.1/webapps/admin"
<Directory "/export/home/ias/jakarta-tomcat-3.2.1/webapps/admin">
Options Indexes FollowSymLinks
</Directory>
<Location "/admin/WEB-INF/">
AllowOverride None
deny from all
</Location>
<Location "/admin/META-INF/">
AllowOverride None
deny from all
</Location>
This is copied from that mod_jk.conf-auto (only changed ajp12 for virgo, etc.) -
but I tried it without Alias and it runs... is that Alias needed? Isn't it
solved with JkMount?
And really last question :-)))...
When I have servlet short names (url-mappings):
http://host:port/admin/servlet/Class
and
http://host:port/admin/shortname
Where shortname is mapped to Class class ;-)... When in such a servlet is link
to image (eg. obligate "images/tomcat.gif"), one is good (shortname), but other
not (.../admin/servlet/images/tomcat.gif doesn't exist). Which way is obvious to
solve this problem?
- Have I use only shortnames?
- Have I use absolute link? (Works in both.)
- Have I use ../images link for Class? (First case.)
- Or have I configure alias remapping servlet/images to images? (I guess this is
configured in Tomcat, not in httpd.conf - because this URL part is solved by
Tomcat, hm?)
- Or something else? :-)))
So that's all...
Thanks for solved things or any future suggestion...
Richard "Virgo" Richter
> From: Dmitri Colebatch <di...@nuix.com.au>
> To: tomcat-user@jakarta.apache.org
> Subject: Re: JkMount in httpd.conf
> Date: Fri, 29 Jun 2001 08:52:16 +1000
>
> > The fact that two are too much wasn't known to me - you
> > know, example of web.xml is the only thing I have to learn from. ;-)))
> > This was web.xml of one of my mate in work - I was just trying to let it
> > run as admin of Tomcat ;-)...
> > Now I can see that I have to write it from scratch or something... ;-)
> Have you got a copy of the (2.2) spec? It has a reasonably readable (IMHO)
> overview of the web.xml dtd. Might clear up a few things. If you're
> interested in buying a book - my first introduction to servlets was
> O'Reilly's "Java Servlet Programming". Recommend it as a good intro,
> although having said that I cant remember it covering the web.xml in detail
> (not to say it doesn't).
>
> > So - after your last mail I woke up and I'm checking logs now... but all at
> > all - the only thing I see is in mod_jk.log well known two lines:
> Ahh yes - you'll need to edit your server.xml. Have a look for tc_log -
> there's a comment there saying put in path="logs/tomcat.log" to get more
> logging... do that. otherwise your logging is going to stdout (I think).
> Hopefully that will give you some more info. You can also crank up the debug
> levels in there.
>
> > Another "so" - so where is the differences between Apache-mod_jk-Tomcat and
> > standalone Tomcat? I mean differences in servlet processing. On
> > localhost:8080 everything runs perfectly and via virtual host of Apache and
> > mod_jk... only jsp. But - as I can see now - servlet request is redirected
> > - jk_uri_worker_map can't resolve it and Apache then sends obvious Not
> > found. Hm...
> I think it would be worth taking a few steps back and following the example
> to the letter. In the doco there's a good walk through of how to get it
> working using mod_jk.conf-auto. Have you been able to get it working without
> virtuals at the apache end?
>
> cheers
> dim
Richard Richter (richter@bgs.sk)
Application Programmer, Business Global Systems a. s.
Re: JkMount in httpd.conf
Posted by Dmitri Colebatch <di...@nuix.com.au>.
Hello again (o:
On Tue, 3 Jul 2001 19:44, Richard Richter wrote:
> At last: Something out of this topic. "Re: reference material" - Dmitri
> wrote something about look at mod_jk-howt and tomcat-apache-howto... so...
> In these HTMLs (on the server - so called "latest documentation" or
> something ;-)) is mentioned ApJServMount... really often! This confused me
> always I read it. Because both documents are in mod_jk section of
> documentation... In fact - tomcat-apache-howto starts with mod_jk and
> config examples are with these ApJServMounts... Hm? Is it historical
> reason? (Many times mentioned problem of documentation to Tomcat?)
Yes - its the old adapter between tomcat and apache. I wasn't sure whether
to point you at tomcat-apache-howto for those reasons. The doco goes into it
in mod_jk at the start (briefly). Thats all I know (o:
> Where shortname is mapped to Class class ;-)... When in such a servlet is
> link to image (eg. obligate "images/tomcat.gif"), one is good (shortname),
> but other not (.../admin/servlet/images/tomcat.gif doesn't exist). Which
> way is obvious to solve this problem?
> - Have I use only shortnames?
> - Have I use absolute link? (Works in both.)
> - Have I use ../images link for Class? (First case.)
> - Or have I configure alias remapping servlet/images to images? (I guess
> this is configured in Tomcat, not in httpd.conf - because this URL part is
> solved by Tomcat, hm?)
> - Or something else? :-)))
Yes. (o: The problem is a client side issue in that without an explicit
BASE HREF tag at the start of your html the browser will try and resolve all
references (links as well as images) relative to the current path. If the
current path is /admin/AdminServlet then an image ../images/foo.jpg should
look (in apache) for /images/foo.jpg. However as you change the request
path, this will affect the resolving of references. Your options are:
1. base href tag (html spec)
2. absolute paths (my preference)
3. make it work for the one you're going to use and not worry about the
other.
I prefer absolute paths because when you break a page up into components
(navbars being a typical example) then you can use them anywhere on your
site. Having said that, its not really a tomcat question so I'll stop there
(o:
cheers
dim