tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Wille" <robert.wi...@iarchives.com>
Subject Re: Apache w/ mod_jk and Tomcat 3.2.1 not handling URL rewriting
Date Tue, 05 Feb 2002 19:17:41 GMT
Actually, Apache does know how to hand servlet requests to Tomcat, just not
for URL's that have been rewritten. The first request sets a cookie and the
page contains URL's which have been rewritten (Tomcat does not yet know if
the browser supports cookies, so it must rewrite these URL's). When I follow
a link on that page, I'm following a rewritten URL. I get an error 404
because Apache/Tomcat is not handling the rewritten URL properly. After
getting the error, everything works, because subsequent requests contain the
cookie and therefore the URL's are not rewritten. Presumably, if the browser
did not support cookies, the error would continue to occur.

Therefore, every request is properly handled, including the static content,
except for the second request (which has the ;jsessionid=xxxxx in it, since
the servlet container does not yet know if the browser supports cookies or
not).

One other interesting thing. If I kill Tomcat, and then follow the link that
has been rewritten, I get a server error rather than a 404. Presumably
Apache is passing the request on to Tomcat, but has mangled it such that
Tomcat cannot resolve the URI.

I believe that my mod_jk.conf is correct, as my applications work correctly
after the cookie has been set and Tomcat is aware that my browser has
accepted the cookie. For what its worth, I have the following in my
mod_jk.conf:

JkMount /webapp/* ajp13

----- Original Message -----
From: "Robert Wille" <robert.wille@iarchives.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Monday, February 04, 2002 9:54 PM
Subject: Re: Apache w/ mod_jk and Tomcat 3.2.1 not handling URL rewriting


> Actually, Apache does know how to hand servlet requests to Tomcat, just
not
> for URL's that have been rewritten. The first request sets a cookie and
the
> page contains URL's which have been rewritten (Tomcat does not yet know if
> the browser supports cookies, so it must rewrite these URL's). When I
follow
> a link on that page, I'm following a rewritten URL. I get an error 404
> because Apache/Tomcat is not handling the rewritten URL properly. After
> getting the error, everything works, because subsequent requests contain
the
> cookie and therefore the URL's are not rewritten. Presumably, if the
browser
> did not support cookies, the error would continue to occur.
>
> Therefore, every request is properly handled, including the static
content,
> except for the second request (which has the ;jsessionid=xxxxx in it,
since
> the servlet container does not yet know if the browser supports cookies or
> not).
>
> One other interesting thing. If I kill Tomcat, and then follow the link
that
> has been rewritten, I get a server error rather than a 404. Presumably
> Apache is passing the request on to Tomcat, but has mangled it such that
> Tomcat cannot resolve the URI.
>
> I believe that my mod_jk.conf is correct, as my applications work
correctly
> after the cookie has been set and Tomcat is aware that my browser has
> accepted the cookie. For what its worth, I have the following in my
> mod_jk.conf:
>
> JkMount /webapp/* ajp13
>
> ----- Original Message -----
> From: "John Moore" <JohnMoore@PDSI-Software.COM>
> To: "'Tomcat Users List'" <tomcat-user@jakarta.apache.org>
> Sent: Monday, February 04, 2002 7:31 PM
> Subject: RE: Apache w/ mod_jk and Tomcat 3.2.1 not handling URL rewriting
>
>
> >
> > It sounds like apache is not configured to hand .jsp or /servlet
requests
> > back to tomcat.  From Tomcat 3.3 (sorry it's all I have around right
now).
> > If you mistakenly encoded your gif/.js references you will need to do a
> > rewrite of the URL so apache can pass by it.  I say it only because we
did
> > it once and having mod_rewrite enabled on Apache was a god-send!  Make
> sure
> > that you have the Include in your apache httpd.conf (e.g. Include
> > /opt/jakarta-tomcat-3.3/conf/auto/mod_jk.conf ).
> >
> >
> > { partial from mod_jk.conf for one application}
> >
> > JkMount /webstaff/*.jsp ajp13
> > JkMount /webstaff/servlet/* ajp13
> >
> > Alias /webstaff /opt/jakarta-tomcat-3.3/webapps/webstaff
> > <Directory "/opt/jakarta-tomcat-3.3/webapps/webstaff">
> >    AllowOverride All
> >    Options Indexes FollowSymLinks
> >    Order allow,deny
> >    Allow from all
> > </Directory>
> >
> > <Location "/webstaff/WEB-INF">
> >   AllowOverride None
> >   deny from all
> > </Location>
> >
> > <Location "/webstaff/META-INF">
> >   AllowOverride None
> >   deny from all
> > </Location>
> >
> > John Moore
> >
> > -----Original Message-----
> > From: Robert Wille [mailto:robert.wille@iarchives.com]
> > Sent: Monday, February 04, 2002 3:35 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Apache w/ mod_jk and Tomcat 3.2.1 not handling URL rewriting
> >
> >
> > I have a standalone Tomcat 3.2.1 installation I am trying to make work
> > through Apache with mod_jk and ajp13. Rewritten URL's (ones with
> > ;jsessionid= in them) give me a 404 error. Even when the browser has
> cookies
> > enabled, there is still a problem with the second request. Tomcat
doesn't
> > know whether the browser will accept cookies, so it sets the cookie and
> > rewrites the URL and I get the error. Any help would be greatly
> appreciated
> >
>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message