Re: Aliases/Rewrites (was: ajp12 vs ajp13 mod_jk.conf-auto

2001-02-16 Thread Mel Martinez


--- Jan Labanowski [EMAIL PROTECTED] wrote:
 It is my (and others) experience that mod_jk has to
 be loaded BEFORE
 mod_rewrite for it to act responsibly. In your case
 the mod_rewrite is 
 linked statically, i.e., loaded before mod_jk. I
 would suggest to
 make both mod_jk and mod_rewrite DSO, and load/add
 module mod_jk before
 mod_rewrite. Remember to comment out the 
   # LoadModule jk_module libexec/mod_jk.so  
 in mod_jk.conf
 

Ya know, I'm almost 100% positive I tried this before
to no affect, but being in a mad dash to fix things, I
may spoiled that test by simultaneously changing
something else.  At any rate, with mod_jk loaded
before mod_rewrite (in my case, I am able to simply
perform the include of mod_jk.conf-auto before I do
any rewrites) it seems to work.  I also had a stupid
syntax error in my rewrite expression so maybe that
was it.

Amazin' how much time one can spend fixin' somethin'
that ain't broke...

Mel


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Aliases/Rewrites (was: ajp12 vs ajp13 mod_jk.conf-auto

2001-02-15 Thread Mel Martinez

Filip,

--- Filip Hanik [EMAIL PROTECTED] wrote:
  Now, if I could just get someone to tell me why
 apache
  Alias and Rewrites are not working with tomcat...
 
 tell us what you are trying to do and send us some
 sample config files and
 how your environment is setup. is becomes much
 easier than to answer the
 question above, because alias works very well for me
 :)
 

Well, actually, I've twice posted detailed
descriptions of what I'm trying to accomplish on this
topic and gotten zero replies, but here goes another
attempt...

I'm using Apache 1.3.14 and tomcat 3.2.1 with
mod_jk.c.  I don't know if the latter is the 'latest'
version of mod_jk.c - I grabbed it from the tomcat
download site two weeks ago.  I am running this on
WinNT using downloaded binary versions of the relevant
software.

I have setup my application ("myapp") as a directory
inside the webapps/ directory, complete with WEB-INF
subdirectory and such.

I have apache configured to apply an alias or a
rewrite rule to a reqest:
#--
IfModule !mod_rewrite.c
LoadModule rewrite_module
n:/opt/local/apache/modules/ApacheModuleRewrite.dll
/IfModule

RewriteEngine On
RewriteLog log/apache_logs/rewrites.log
RewriteLogLevel 9
RewriteOptions inherit
RewriteRule ^/myapp/(.*)/common/(.*) /myapp/common/$2
#-


I can tell from the rewrites.log that it is indeed
getting applied:

 (2) init rewrite engine with requested uri
/myapp/folder1/common/mypage.jsp
 (3) applying pattern '^/myapp/(.*)/common/(.*)' to
uri '/myapp/folder1/common/mypage.jsp'
 (2) rewrite /myapp/folder1/common/mypage.jsp -
/myapp/common/mypage.jsp
 (2) local path result: /myapp/common/mypage.jsp
 (1) go-ahead with /myapp/common/mypage.jsp [OK]

The idea here is simple: the request

/myapp/folder1/common/mypage.jsp

should result in a request for

/myapp/common/mypage.jsp

The rewrite rule works great.  This works great for
static stuff (i.e. html) served up by Apache. 

The *problem* is that Tomcat is not getting the
translated request, it is getting the original one:

/myapp/folder1/common/mypage.jsp
 
Since no file in that path actually exists, naturally
it returns a file not found error.  Tomcat DOES
happily find, compile and execute requests for
servlets and jsp pages that are in paths that do exist
such as

/myapp/folder1/myother.jsp

I have apache configured to send requests to tomcat
via ajp13 by including mod_jk.conf-auto just after the
above rewrite rule:

# include configuration for tomcat servlet engine:
#
Include n:/opt/demo/conf/mod_jk.conf-auto
#

I've configured server.xml very minimally, no custom
contexts or anything.  About the only thing changed
here is I've enabled ajp13 and then setup
workers.properties to map requests to it.  I doubt any
of this is relevant because I see the exact same
behavior even with 'raw' server.xml and
worker.properties files.

Note that I get the same behavior if I use an Alias
instead of a rewrite:

#--
Alias (.*)/myapp/(.*)/common/(.*) $1/myapp/common/$3
#--

This rewrites static requests served by Apache, but
just like with rewrites, gets ignored by tomcat.

That's pretty much it.

Any suggestions as to what is (or is not) going on?

Basically, what I want to happen is that, after a
rewrite rule has been applied, that Tomcat should be
processing the modified URL, not the original.

Thanks in advance for any help!

Mel


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Aliases/Rewrites (was: ajp12 vs ajp13 mod_jk.conf-auto

2001-02-15 Thread Jan Labanowski

It is my (and others) experience that mod_jk has to be loaded BEFORE
mod_rewrite for it to act responsibly. In your case the mod_rewrite is 
linked statically, i.e., loaded before mod_jk. I would suggest to
make both mod_jk and mod_rewrite DSO, and load/add module mod_jk before
mod_rewrite. Remember to comment out the 
  # LoadModule jk_module libexec/mod_jk.so  
in mod_jk.conf

Jan


On Thu, 15 Feb 2001, Mel Martinez wrote:

 Filip,
 
 --- Filip Hanik [EMAIL PROTECTED] wrote:
   Now, if I could just get someone to tell me why
  apache
   Alias and Rewrites are not working with tomcat...
  
  tell us what you are trying to do and send us some
  sample config files and
  how your environment is setup. is becomes much
  easier than to answer the
  question above, because alias works very well for me
  :)
  
 
 Well, actually, I've twice posted detailed
 descriptions of what I'm trying to accomplish on this
 topic and gotten zero replies, but here goes another
 attempt...
 
 I'm using Apache 1.3.14 and tomcat 3.2.1 with
 mod_jk.c.  I don't know if the latter is the 'latest'
 version of mod_jk.c - I grabbed it from the tomcat
 download site two weeks ago.  I am running this on
 WinNT using downloaded binary versions of the relevant
 software.
 
 I have setup my application ("myapp") as a directory
 inside the webapps/ directory, complete with WEB-INF
 subdirectory and such.
 
 I have apache configured to apply an alias or a
 rewrite rule to a reqest:
 #--
 IfModule !mod_rewrite.c
 LoadModule rewrite_module
 n:/opt/local/apache/modules/ApacheModuleRewrite.dll
 /IfModule
 
 RewriteEngine On
 RewriteLog log/apache_logs/rewrites.log
 RewriteLogLevel 9
 RewriteOptions inherit
 RewriteRule ^/myapp/(.*)/common/(.*) /myapp/common/$2
 #-
 
 
 I can tell from the rewrites.log that it is indeed
 getting applied:
 
  (2) init rewrite engine with requested uri
 /myapp/folder1/common/mypage.jsp
  (3) applying pattern '^/myapp/(.*)/common/(.*)' to
 uri '/myapp/folder1/common/mypage.jsp'
  (2) rewrite /myapp/folder1/common/mypage.jsp -
 /myapp/common/mypage.jsp
  (2) local path result: /myapp/common/mypage.jsp
  (1) go-ahead with /myapp/common/mypage.jsp [OK]
 
 The idea here is simple: the request
 
 /myapp/folder1/common/mypage.jsp
 
 should result in a request for
 
 /myapp/common/mypage.jsp
 
 The rewrite rule works great.  This works great for
 static stuff (i.e. html) served up by Apache. 
 
 The *problem* is that Tomcat is not getting the
 translated request, it is getting the original one:
 
 /myapp/folder1/common/mypage.jsp
  
 Since no file in that path actually exists, naturally
 it returns a file not found error.  Tomcat DOES
 happily find, compile and execute requests for
 servlets and jsp pages that are in paths that do exist
 such as
 
 /myapp/folder1/myother.jsp
 
 I have apache configured to send requests to tomcat
 via ajp13 by including mod_jk.conf-auto just after the
 above rewrite rule:
 
 # include configuration for tomcat servlet engine:
 #
 Include n:/opt/demo/conf/mod_jk.conf-auto
 #
 
 I've configured server.xml very minimally, no custom
 contexts or anything.  About the only thing changed
 here is I've enabled ajp13 and then setup
 workers.properties to map requests to it.  I doubt any
 of this is relevant because I see the exact same
 behavior even with 'raw' server.xml and
 worker.properties files.
 
 Note that I get the same behavior if I use an Alias
 instead of a rewrite:
 
 #--
 Alias (.*)/myapp/(.*)/common/(.*) $1/myapp/common/$3
 #--
 
 This rewrites static requests served by Apache, but
 just like with rewrites, gets ignored by tomcat.
 
 That's pretty much it.
 
 Any suggestions as to what is (or is not) going on?
 
 Basically, what I want to happen is that, after a
 rewrite rule has been applied, that Tomcat should be
 processing the modified URL, not the original.
 
 Thanks in advance for any help!
 
 Mel
 
 
 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35 
 a year!  http://personal.mail.yahoo.com/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 

Jan K. Labanowski|phone: 614-292-9279,  FAX: 614-292-7168
Ohio Supercomputer Center|Internet: [EMAIL PROTECTED] 
1224 Kinnear Rd, |http://www.ccl.net/chemistry.html
Columbus, OH 43212-1163  |http://www.osc.edu/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: ajp12 vs ajp13 mod_jk.conf-auto

2001-02-14 Thread Coetmeur, Alain



 -Message d'origine-
 De: Mel Martinez [mailto:[EMAIL PROTECTED]]
 Date: mardi 13 fvrier 2001 23:33
 : [EMAIL PROTECTED]
 Objet: ajp12 vs ajp13  mod_jk.conf-auto
 
 
 Question:
 
 what determines whether ajp12 or ajp13 will be
 specified for a jkmount statement in the
 auto-generated mod_jk.conf-auto file?
 
 I.E., it always generates statements like:
 
 JkMount /myapp/servlet/* ajp12
 JkMount /myapp/*.jsp ajp12
 
 I've even tried disabling all reference to ajp12 from
 server.xml and workers.properties but that had no
 effect.
 
 Is the only way to force the use of Ajp13 to manually
 edit the mod_jk.conf file?

as told here you can tweak things, but
the most clean is to use
a separate my-mod_jk.conf include file
that you derivate from the generated mod_jk.conf-auto

if you really want all to be automatic
add a conversion script (sed or perl script) 
to generate the my-mod_jk.conf from the .conf-auto

with cocoon and HTTPS I had to tweak 
thos .conf-auto much more and
nothing is better than manual config when things are stable...

changing the ajp12 alias to point to ajp13 is
really anti-documentation...
on unix try something like

#!/bin/sh
launch_tomcat
sleep 5 # wait for tomcat to generate the .conf-auto
sed -e 's/ajp12/ajp13/g' conf/mod_jk.conf-auto conf/my-mod_jk.conf
launch_apache


don't forget to adapt apache conf/httpd.conf to include
the my-mod_jk.conf instead of the conf-auto


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




ajp12 vs ajp13 mod_jk.conf-auto

2001-02-13 Thread Mel Martinez

Question:

what determines whether ajp12 or ajp13 will be
specified for a jkmount statement in the
auto-generated mod_jk.conf-auto file?

I.E., it always generates statements like:

JkMount /myapp/servlet/* ajp12
JkMount /myapp/*.jsp ajp12

I've even tried disabling all reference to ajp12 from
server.xml and workers.properties but that had no
effect.

Is the only way to force the use of Ajp13 to manually
edit the mod_jk.conf file?

Should I even be worrying about this?

Thanks,

mel

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: ajp12 vs ajp13 mod_jk.conf-auto

2001-02-13 Thread Filip Hanik

yes,
the JkMount command looks like this

JkMount context workername

so the autogenerated ajp12 is just the worker name "ajp12"

in the workers.properties file you can change the protocol that the worker
is using.
the property file has the following format

worker.workername.propertyname=value
worker.ajp12.port=8007
worker.ajp12.host=localhost
worker.ajp12.type=ajp13

so just change the last line to use ajp13. now you have to modify server.xml
to start a ajp13 connector on the port 8007 and change the port for ajp12.

the nice thing with the autogenerated file is that your webapps can be
dynamic.
but if you need to do a lot of fancy stuff, you should create your own file
for the mod_jk configuration.

try playing around with it, and if you have a specific problem let me know
and I can help you out.

Filip

~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
[EMAIL PROTECTED]
www.filip.net
- Original Message -
From: "Mel Martinez" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 2:32 PM
Subject: ajp12 vs ajp13  mod_jk.conf-auto


 Question:

 what determines whether ajp12 or ajp13 will be
 specified for a jkmount statement in the
 auto-generated mod_jk.conf-auto file?

 I.E., it always generates statements like:

 JkMount /myapp/servlet/* ajp12
 JkMount /myapp/*.jsp ajp12

 I've even tried disabling all reference to ajp12 from
 server.xml and workers.properties but that had no
 effect.

 Is the only way to force the use of Ajp13 to manually
 edit the mod_jk.conf file?

 Should I even be worrying about this?

 Thanks,

 mel

 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35
 a year!  http://personal.mail.yahoo.com/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: ajp12 vs ajp13 mod_jk.conf-auto

2001-02-13 Thread Mel Martinez

Thanks, Filip.

I'll try the changes you suggested.

Now, if I could just get someone to tell me why apache
Alias and Rewrites are not working with tomcat...


Mel



--- Filip Hanik [EMAIL PROTECTED] wrote:
 yes,
 the JkMount command looks like this
 
 JkMount context workername
 
 so the autogenerated ajp12 is just the worker name
 "ajp12"
 
 in the workers.properties file you can change the
 protocol that the worker
 is using.
 the property file has the following format
 
 worker.workername.propertyname=value
 worker.ajp12.port=8007
 worker.ajp12.host=localhost
 worker.ajp12.type=ajp13
 
 so just change the last line to use ajp13. now you
 have to modify server.xml
 to start a ajp13 connector on the port 8007 and
 change the port for ajp12.
 
 the nice thing with the autogenerated file is that
 your webapps can be
 dynamic.
 but if you need to do a lot of fancy stuff, you
 should create your own file
 for the mod_jk configuration.
 
 try playing around with it, and if you have a
 specific problem let me know
 and I can help you out.
 
 Filip
 
 ~
 Namaste - I bow to the divine in you
 ~
 Filip Hanik
 Software Architect
 [EMAIL PROTECTED]
 www.filip.net
 - Original Message -
 From: "Mel Martinez" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, February 13, 2001 2:32 PM
 Subject: ajp12 vs ajp13  mod_jk.conf-auto
 
 
  Question:
 
  what determines whether ajp12 or ajp13 will be
  specified for a jkmount statement in the
  auto-generated mod_jk.conf-auto file?
 
  I.E., it always generates statements like:
 
  JkMount /myapp/servlet/* ajp12
  JkMount /myapp/*.jsp ajp12
 
  I've even tried disabling all reference to ajp12
 from
  server.xml and workers.properties but that had no
  effect.
 
  Is the only way to force the use of Ajp13 to
 manually
  edit the mod_jk.conf file?
 
  Should I even be worrying about this?
 
  Thanks,
 
  mel
 
  __
  Do You Yahoo!?
  Get personalized email addresses from Yahoo! Mail
 - only $35
  a year!  http://personal.mail.yahoo.com/
 
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, email:
 [EMAIL PROTECTED]
 
 
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, email:
 [EMAIL PROTECTED]
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: ajp12 vs ajp13 mod_jk.conf-auto

2001-02-13 Thread Filip Hanik

 Now, if I could just get someone to tell me why apache
 Alias and Rewrites are not working with tomcat...

tell us what you are trying to do and send us some sample config files and
how your environment is setup. is becomes much easier than to answer the
question above, because alias works very well for me :)

Filip

~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
[EMAIL PROTECTED]
www.filip.net
- Original Message -
From: "Mel Martinez" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 3:11 PM
Subject: Re: ajp12 vs ajp13  mod_jk.conf-auto


 Thanks, Filip.

 I'll try the changes you suggested.

 Now, if I could just get someone to tell me why apache
 Alias and Rewrites are not working with tomcat...


 Mel



 --- Filip Hanik [EMAIL PROTECTED] wrote:
  yes,
  the JkMount command looks like this
 
  JkMount context workername
 
  so the autogenerated ajp12 is just the worker name
  "ajp12"
 
  in the workers.properties file you can change the
  protocol that the worker
  is using.
  the property file has the following format
 
  worker.workername.propertyname=value
  worker.ajp12.port=8007
  worker.ajp12.host=localhost
  worker.ajp12.type=ajp13
 
  so just change the last line to use ajp13. now you
  have to modify server.xml
  to start a ajp13 connector on the port 8007 and
  change the port for ajp12.
 
  the nice thing with the autogenerated file is that
  your webapps can be
  dynamic.
  but if you need to do a lot of fancy stuff, you
  should create your own file
  for the mod_jk configuration.
 
  try playing around with it, and if you have a
  specific problem let me know
  and I can help you out.
 
  Filip
 
  ~
  Namaste - I bow to the divine in you
  ~
  Filip Hanik
  Software Architect
  [EMAIL PROTECTED]
  www.filip.net
  - Original Message -
  From: "Mel Martinez" [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, February 13, 2001 2:32 PM
  Subject: ajp12 vs ajp13  mod_jk.conf-auto
 
 
   Question:
  
   what determines whether ajp12 or ajp13 will be
   specified for a jkmount statement in the
   auto-generated mod_jk.conf-auto file?
  
   I.E., it always generates statements like:
  
   JkMount /myapp/servlet/* ajp12
   JkMount /myapp/*.jsp ajp12
  
   I've even tried disabling all reference to ajp12
  from
   server.xml and workers.properties but that had no
   effect.
  
   Is the only way to force the use of Ajp13 to
  manually
   edit the mod_jk.conf file?
  
   Should I even be worrying about this?
  
   Thanks,
  
   mel
  
   __
   Do You Yahoo!?
   Get personalized email addresses from Yahoo! Mail
  - only $35
   a year!  http://personal.mail.yahoo.com/
  
  
 
 -
   To unsubscribe, e-mail:
  [EMAIL PROTECTED]
   For additional commands, email:
  [EMAIL PROTECTED]
  
  
 
 
 
 -
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, email:
  [EMAIL PROTECTED]
 


 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35
 a year!  http://personal.mail.yahoo.com/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]