Apache and rLucee doesn't play well with virtual host rewrites

I’m using the default Apache connector, so there are a bunch of
ProxyPassMatch directives at the end of the httpd.conf along with hooks for
the Perl module.

I’m having an issue though, where I want to use a redirect on a particular
virtual host to direct people away from an older version :
redirectmatch /landing/.* /website/

Because mod_proxy always trumps mod_redirect, this redirect only works for
non-.cfm files :-/ .cfm requests still go to Lucee, which in this case
triggers a file not found error because it’s an old site and we removed the
files (and wouldn’t want them run anyway).

I can work around this for now by adding
ProxyPassMatch ^/landing.* !
to the main Apache config, but this isn’t a good fix - in future in other
virtual hosts we may want CFML content in a folder called landing.
Adding it just to the virtual host doesn’t help, because it’s still picked
up by the global proxy.

I think this would be fixed if Lucee used mod_rewrite with it’s proxy
ability, instead of mod_proxy directly, because the virtual host’s rewrite
rules would be invoked.

Is there some deeper inner reason why mod_proxy is used rather than
mod_rewrite ? Maybe to do with the Perl module ?

Is there some deeper inner reason why mod_proxy is used rather than
mod_rewrite ? Maybe to do with the Perl module ?

Nope. Use whatever works in your environment. The only thing the perl module does is modify the incoming request header for extensions that it handles. Use whatever connection method works for you.

Note that Paul Klinkinberg has been making some significant updates to the mod_cfml modules, including significant speed improvements to the valve, as well as a native C-module for Apache (mod_perl will no longer be required), and it’s faster as well.

-Jordan----- Original Message -----
From: “Tom Chiverton” <@Tom_Chiverton>
To: lucee@googlegroups.com
Sent: Friday, May 22, 2015 3:22:49 AM
Subject: [Lucee] Apache and rLucee doesn’t play well with virtual host rewrites

I’m using the default Apache connector, so there are a bunch of
ProxyPassMatch directives at the end of the httpd.conf along with hooks for
the Perl module.

I’m having an issue though, where I want to use a redirect on a particular
virtual host to direct people away from an older version :
redirectmatch /landing/.* /website/

Because mod_proxy always trumps mod_redirect, this redirect only works for
non-.cfm files :-/ .cfm requests still go to Lucee, which in this case
triggers a file not found error because it’s an old site and we removed the
files (and wouldn’t want them run anyway).

I can work around this for now by adding
ProxyPassMatch ^/landing.* !
to the main Apache config, but this isn’t a good fix - in future in other
virtual hosts we may want CFML content in a folder called landing.
Adding it just to the virtual host doesn’t help, because it’s still picked
up by the global proxy.

I think this would be fixed if Lucee used mod_rewrite with it’s proxy
ability, instead of mod_proxy directly, because the virtual host’s rewrite
rules would be invoked.

Is there some deeper inner reason why mod_proxy is used rather than
mod_rewrite ? Maybe to do with the Perl module ?


You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/ee83a4a3-d201-44ec-b31b-6f503fcb46e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Should the install be changed to use mod_rewrite by default instead then ?
I’ll try updating our Apache this weekend, as I had other work planned
anyway.On 22 May 2015 at 20:15, Jordan Michaels <@Jordan_Michaels> wrote:

Is there some deeper inner reason why mod_proxy is used rather than
mod_rewrite ? Maybe to do with the Perl module ?

Nope. Use whatever works in your environment. The only thing the perl
module does is modify the incoming request header for extensions that it
handles. Use whatever connection method works for you.

Note that Paul Klinkinberg has been making some significant updates to the
mod_cfml modules, including significant speed improvements to the valve, as
well as a native C-module for Apache (mod_perl will no longer be required),
and it’s faster as well.

-Jordan

----- Original Message -----
From: “Tom Chiverton” <@Tom_Chiverton>
To: lucee@googlegroups.com
Sent: Friday, May 22, 2015 3:22:49 AM
Subject: [Lucee] Apache and rLucee doesn’t play well with virtual host
rewrites

I’m using the default Apache connector, so there are a bunch of
ProxyPassMatch directives at the end of the httpd.conf along with hooks for
the Perl module.

I’m having an issue though, where I want to use a redirect on a particular
virtual host to direct people away from an older version :
redirectmatch /landing/.* /website/

Because mod_proxy always trumps mod_redirect, this redirect only works for
non-.cfm files :-/ .cfm requests still go to Lucee, which in this case
triggers a file not found error because it’s an old site and we removed the
files (and wouldn’t want them run anyway).

I can work around this for now by adding
ProxyPassMatch ^/landing.* !
to the main Apache config, but this isn’t a good fix - in future in other
virtual hosts we may want CFML content in a folder called landing.
Adding it just to the virtual host doesn’t help, because it’s still picked
up by the global proxy.

I think this would be fixed if Lucee used mod_rewrite with it’s proxy
ability, instead of mod_proxy directly, because the virtual host’s rewrite
rules would be invoked.

Is there some deeper inner reason why mod_proxy is used rather than
mod_rewrite ? Maybe to do with the Perl module ?


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/ee83a4a3-d201-44ec-b31b-6f503fcb46e7%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to a topic in the
Google Groups “Lucee” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/lucee/tJt1c4FwnMg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/1745806787.2217696.1432322158048.JavaMail.zimbra%40viviotech.net
.
For more options, visit https://groups.google.com/d/optout.


Tom

So it looks like it’s not quite as simple as replaceing the proxypass block
with

RewriteEngine On
ProxyPreserveHost On
ProxyPassReverse / http://127.0.0.1:8888/
RewriteRule ^/(.+.cf[cm])(/.)?$ http://127.0.0.1:8888/$1$2 [P,QSA]
RewriteRule ^/(.+.cfml)(/.
)?$ http://127.0.0.1:8888/$1$2 [P,QSA]

because this just serves the bare CFML templates. I’m not sure why, because
if you place the same directives inside the VirtualHost, it works great !

Any other Apache users know why this should be ?On Friday, May 22, 2015 at 11:22:49 AM UTC+1, Tom Chiverton wrote:

I’m using the default Apache connector, so there are a bunch of
ProxyPassMatch directives at the end of the httpd.conf along with hooks for
the Perl module.

I’m having an issue though, where I want to use a redirect on a particular
virtual host to direct people away from an older version :
redirectmatch /landing/.* /website/

Because mod_proxy always trumps mod_redirect, this redirect only works for
non-.cfm files :-/ .cfm requests still go to Lucee, which in this case
triggers a file not found error because it’s an old site and we removed the
files (and wouldn’t want them run anyway).

I can work around this for now by adding
ProxyPassMatch ^/landing.* !
to the main Apache config, but this isn’t a good fix - in future in other
virtual hosts we may want CFML content in a folder called landing.
Adding it just to the virtual host doesn’t help, because it’s still picked
up by the global proxy.

I think this would be fixed if Lucee used mod_rewrite with it’s proxy
ability, instead of mod_proxy directly, because the virtual host’s rewrite
rules would be invoked.

Is there some deeper inner reason why mod_proxy is used rather than
mod_rewrite ? Maybe to do with the Perl module ?

Doh, of course rewrite rules don’t inherit. But if the server config does

ProxyPreserveHost On
ProxyPassReverse / http://127.0.0.1:8888/

<Directorymatch /wwwroot/clients/>
RewriteEngine On
RewriteOptions Inherit
RewriteRule ^/(.+.cf[cm])(/.
)?$ http://127.0.0.1:8888/$1$2 [P,QSA]
RewriteRule ^/(.+.cfml)(/.*)?$ http://127.0.0.1:8888/$1$2 [P,QSA]

Then Lucee returns a 404 error for the webroot, twice e.g.

/wwwroot/clients/r/roadrunner/wwwroot/clients/r/roadrunner/website/index.cfm

instead of
/wwwroot/clients/r/roadrunner/website/index.cfm

could this be something in the CFML Perl module ? Seems unlikely…

Tom

Tom,

why not just do your redirect with mod_rewrite instead

RewriteEngine on
RewriteRule “^/landing/(.*)$” “/website/$1” [R=302,L]On 25 May 2015 at 13:21, Tom Chiverton <@Tom_Chiverton> wrote:

Doh, of course rewrite rules don’t inherit. But if the server config does

ProxyPreserveHost On
ProxyPassReverse / http://127.0.0.1:8888/

<Directorymatch /wwwroot/clients/>
RewriteEngine On
RewriteOptions Inherit
RewriteRule ^/(.+.cf[cm])(/.
)?$ http://127.0.0.1:8888/$1$2 [P,QSA]
RewriteRule ^/(.+.cfml)(/.*)?$ http://127.0.0.1:8888/$1$2 [P,QSA]

Then Lucee returns a 404 error for the webroot, twice e.g.

/wwwroot/clients/r/roadrunner/wwwroot/clients/r/roadrunner/website/index.cfm

instead of
/wwwroot/clients/r/roadrunner/website/index.cfm

could this be something in the CFML Perl module ? Seems unlikely…

Tom


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/1d09cefb-c5e5-483b-98f4-7cdbd0ffb244%40googlegroups.com
https://groups.google.com/d/msgid/lucee/1d09cefb-c5e5-483b-98f4-7cdbd0ffb244%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.