You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Petr Hracek <ph...@gmail.com> on 2010/04/21 12:24:41 UTC

[users@httpd] Running script from configuration file of Apache2

Hello *,

I would like to ask you on the one interesting think:
I need to proxy the requests to the specified url to a dynamically generated
address.
Instead of:
<Location "/CAP/">
    ProxyPass  http://192.0.2.25:8080/CBAdmin/
    ProxyPassReverse    http://192.0.2.25:8080/CBAdmin/
    ProxyPassReverseCookiePath /CBAdmin /CAP
    Order Allow,Deny
    Allow from all
</Location>

There should be something like that instead of IP address there will
be a script like generate_forward_address

I think that the mod_macro is not helpful here. I also cannot use
RewriteRule [P] which has more possibilities because I need the
ProxyPassReverse as well.

Do you have any idea how to solve it?


-- 
Best Regards / S pozdravem
Petr Hracek

Re: [users@httpd] Running script from configuration file of Apache2

Posted by alin vasile <al...@yahoo.com>.
only if you don't have rewrite rules that force proxy ([P])




________________________________
From: Petr Hracek <ph...@gmail.com>
To: users@httpd.apache.org
Sent: Wed, April 21, 2010 4:41:43 PM
Subject: Re: [users@httpd] Running script from configuration file of Apache2

OK. Thanks but for the clarification on the
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
in section Forward Proxies and Reverse Proxyies is mentioned:

A reverse proxy is activated using the ProxyPass directiveor the [P] flag to the RewriteRule directive.  It is not necessary to turn ProxyRequests on in order to configure a reverse proxy.

Does it mean that Rewrite Rule has to be mentioned always?

BR
Petr

2010/4/21 Tom Evans <te...@googlemail.com>

On Wed, Apr 21, 2010 at 2:21 PM, Petr Hracek <ph...@gmail.com> wrote:
>>
>> Is there any possibility how to work without RewriteRule
>>> with turn on RewriteRule?
>>>
>>> thank you in advance
>>> Petr
>>>
>
>No, not really.
>
>
>>Cheers
>
>>Tom
>
>>---------------------------------------------------------------------
>>The official User-To-User support forum of the Apache HTTP Server Project.
>>See http://httpd.apache.org/userslist.html> for more info.
>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Best Regards / S pozdravem
Petr Hracek



      

RE: [users@httpd] mod_disk_cache causing corrupted output on server side includes?

Posted by Geoff Millikan <gm...@t1shopper.com>.
It's a bummer not to be able to use mod_disk_cache, it's such a good tool.
Would love a solution on this.

> -----Original Message-----
> Sent: Friday, June 11, 2010 8:50 AM
> To: users@httpd.apache.org
> Subject: RE: [users@httpd] mod_disk_cache causing corrupted 
> output on server side includes?
> 
> > Interesting... what other modules did you load?  Looking for 
> > possible sources of memory corruption.
> 
> Why memory corruption?  Everything is being served from disk...
>  
> > The uncached results to the client, they are ok?  
> 
> Yes.
> 
> > E.g. is the cache polluted on the way in, 
> > or on the way out?  Simulated load would 
> > help determine this.
> 
> Just the pages in cache are bad.  The whole page isn't bad, 
> just the section
> where the server-side-include should be (see screenshot):
> https://issues.apache.org/bugzilla/attachment.cgi?id=25524
> 
> Thanks,
> 
> Geoff Millikan
> 
> "Most people say that is it is the intellect which makes a 
> great scientist.
> They are wrong: it is character." -Albert Einstein
> 
> "If you can't explain it simply, you don't understand it well enough"
> -Albert Einstein
> 
> 

RE: [users@httpd] mod_disk_cache causing corrupted output on server side includes?

Posted by Geoff Millikan <gm...@t1shopper.com>.
> Interesting... what other modules did you load?  Looking for 
> possible sources of memory corruption.

Why memory corruption?  Everything is being served from disk...
 
> The uncached results to the client, they are ok?  

Yes.

> E.g. is the cache polluted on the way in, 
> or on the way out?  Simulated load would 
> help determine this.

Just the pages in cache are bad.  The whole page isn't bad, just the section
where the server-side-include should be (see screenshot):
https://issues.apache.org/bugzilla/attachment.cgi?id=25524

Thanks,

Geoff Millikan

"Most people say that is it is the intellect which makes a great scientist.
They are wrong: it is character." -Albert Einstein

"If you can't explain it simply, you don't understand it well enough"
-Albert Einstein


Re: [users@httpd] mod_disk_cache causing corrupted output on server side includes?

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 6/10/2010 4:00 PM, Geoff Millikan wrote:
>>> Just in case your filesystem doesn't support them, have you tried
>>> disabling sendfile and mmap?
>>
>> Since all our files are being read directly off the drive 
>> (we're not using a NFS or CIFS mount) this shouldn't 
>> be an issue (at least on RedHat Enterprise
>> Linux).  But we'll give it a shot and report back.
> 
> Nope, that didn't help.  Within 2 hours the *.shtml web pages have binary
> data where the server side includes should be.  The cache worked great for
> the first 90 minutes or so.

Interesting... what other modules did you load?  Looking for possible sources
of memory corruption.

The uncached results to the client, they are ok?  E.g. is the cache polluted
on the way in, or on the way out?  Simulated load would help determine this.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_disk_cache causing corrupted output on server side includes?

Posted by Geoff Millikan <gm...@t1shopper.com>.
> > Just in case your filesystem doesn't support them, have you tried
> > disabling sendfile and mmap?
> 
> Since all our files are being read directly off the drive 
> (we're not using a NFS or CIFS mount) this shouldn't 
> be an issue (at least on RedHat Enterprise
> Linux).  But we'll give it a shot and report back.

Nope, that didn't help.  Within 2 hours the *.shtml web pages have binary
data where the server side includes should be.  The cache worked great for
the first 90 minutes or so.

Bug report untouched after 7 days:
https://issues.apache.org/bugzilla/show_bug.cgi?id=49385


RE: [users@httpd] mod_disk_cache causing corrupted output on server side includes?

Posted by Geoff Millikan <gm...@t1shopper.com>.
> Just in case your filesystem doesn't support them, have you tried
> disabling sendfile and mmap?

Since all our files are being read directly off the drive (we're not using a
NFS or CIFS mount) this shouldn't be an issue (at least on RedHat Enterprise
Linux).  But we'll give it a shot and report back.

http://kbase.redhat.com/faq/docs/DOC-4857

Maybe the issue is htcacheclean is corrupting the included files?  Nope.  We
turned it off and still had the problem.  Maybe the corruption is happening
when the cache is getting rebuilt (because CacheMaxExpire or
CacheLastModifiedFactor had been exceeded).  Nope.  We set everything very
high (CacheDefaultExpire 2592000 and CacheLastModifiedFactor 30) so that the
first cached page would be preserved and not altered (the initial cached
page is not corrupted) however within a few hours the server side include
pages served out of the cache had binary data in them again.  It's
impossible to trace when the corruption is happening and what's causing it.
So mod_disk_cache is not useable for us, we've had to turn it off.

Re: [users@httpd] mod_disk_cache causing corrupted output on server side includes?

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 6/9/2010 7:14 PM, Geoff Millikan wrote:
> Submitted bug report 6 days ago but no movement.  Tips?

Just in case your filesystem doesn't support them, have you tried
disabling sendfile and mmap?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_disk_cache causing corrupted output on server side includes?

Posted by Geoff Millikan <gm...@t1shopper.com>.
Submitted bug report 6 days ago but no movement.  Tips?

https://issues.apache.org/bugzilla/show_bug.cgi?id=49385

Thanks!
 

> -----Original Message-----
> From: Geoff Millikan
> Sent: Thursday, June 03, 2010 2:25 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] mod_disk_cache causing corrupted 
> output on server side includes?
> 
> Dear List,
> 
> It appears that when mod_disk_cache reads server side 
> includes to create its final cached web page, it sometimes 
> corrupts the included file.
> 
> I think the issue may be that the included file is getting 
> DEFLATEd and Apache is intermittently forgetting to ungzip it 
> prior to putting it into the parent page.
> 
> Any other thoughts?
> 
> Thanks,
> 
> http://www.t1shopper.com/
> 
> Details: The parent web page is called "index.shtml" and the 
> child file is getting included like this:
> <!--#include virtual="/dir/include/my_html_file.html" -->
> 
> Everything else on the page looks fine but where the 
> my_html_file.html should be we see binary output in the 
> source code like this:
> í\énÛHþÜ|á]åâu?-SìA½¡!ŸÄoÿ›IÅÇsØß'±"’ÿ ¼ñ*dLXúIpV.n§Œ 
> ©äÉb®H&Ùˆð˜I
> 
> If I restart Apache, the problem remains. But the problem 
> goes away if I delete the cache on the web server. So the 
> cache must have gotten corrupted. I can refresh the page many 
> times after that and the page is fine. This good page is kept 
> in cache for about 30 days because of the config settings (below).
> 
> 
> LoadModule deflate_module modules/mod_deflate.so
> DeflateCompressionLevel 1
> DeflateMemLevel 9
> DeflateWindowSize 15
> SetEnvIfNoCase Request_URI \
> \.(?:gif|jpe?g|png|ico)$ no-gzip dont-vary
> #Header append Vary User-Agent env=!dont-vary
> 
> 
> LoadModule disk_cache_module modules/mod_disk_cache.so
> CacheRoot /var/httpd/proxy/
> CacheEnable disk /
> CacheDisable /i
> CacheMaxFileSize 500000
> CacheMinFileSize 1000
> CacheDirLevels 2
> CacheDirLength 2
> CacheIgnoreCacheControl Off
> CacheIgnoreNoLastMod On
> CacheIgnoreHeaders Set-Cookie
> CacheLastModifiedFactor 0.1
> CacheMaxExpire 172800
> CacheDefaultExpire 86400 
> 
> http://mail-archives.apache.org/mod_mbox/httpd-users/201004.mbox/%3C9E388FA64DD04B3591A47DD9847026E1@rabbithill%3E
> 
> 
> 

[users@httpd] mod_disk_cache causing corrupted output on server side includes?

Posted by Geoff Millikan <gm...@t1shopper.com>.
Dear List,

It appears that when mod_disk_cache reads server side includes to create its final cached web page, it sometimes corrupts the included file.

I think the issue may be that the included file is getting DEFLATEd and Apache is intermittently forgetting to ungzip it prior to putting it into the parent page.

Any other thoughts?

Thanks,

http://www.t1shopper.com/

Details: The parent web page is called "index.shtml" and the child file is getting included like this:
<!--#include virtual="/dir/include/my_html_file.html" -->

Everything else on the page looks fine but where the my_html_file.html should be we see binary output in the source code like this:
í\énÛHþÜ|á]åâu?-SìA½¡!ŸÄoÿ›IÅÇsØß'±"’ÿ ¼ñ*dLXúIpV.n§Œ ©äÉb®H&Ùˆð˜I

If I restart Apache, the problem remains. But the problem goes away if I delete the cache on the web server. So the cache must have gotten corrupted. I can refresh the page many times after that and the page is fine. This good page is kept in cache for about 30 days because of the config settings (below).


LoadModule deflate_module modules/mod_deflate.so
DeflateCompressionLevel 1
DeflateMemLevel 9
DeflateWindowSize 15
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png|ico)$ no-gzip dont-vary
#Header append Vary User-Agent env=!dont-vary


LoadModule disk_cache_module modules/mod_disk_cache.so
CacheRoot /var/httpd/proxy/
CacheEnable disk /
CacheDisable /i
CacheMaxFileSize 500000
CacheMinFileSize 1000
CacheDirLevels 2
CacheDirLength 2
CacheIgnoreCacheControl Off
CacheIgnoreNoLastMod On
CacheIgnoreHeaders Set-Cookie
CacheLastModifiedFactor 0.1
CacheMaxExpire 172800
CacheDefaultExpire 86400 

http://mail-archives.apache.org/mod_mbox/httpd-users/201004.mbox/%3C9E388FA64DD04B3591A47DD9847026E1@rabbithill%3E



Re: [users@httpd] mod_disk_cache causing corrupted output on server side includes?

Posted by Jeff Trawick <tr...@gmail.com>.
On Wed, Apr 21, 2010 at 1:00 PM, Geoff Millikan <gm...@t1shopper.com> wrote:
> You can see the corrupted/binary garbled mess on the page at the link here:
> http://www.t1shopper.com/tools/calculate/index.shtml
>
> The scrambled mess is outputted right at the server side include like this:
> <!--#include virtual="/tools/calculate/filesizedescription.html" -->
>
> Everything else on the page looks fine, it's only the included file that's mangled like this:
>  í\énÛH þ Ü|á]åâu?- SìA½¡!ŸÄoÿ›IÅÇsØß '±"’ÿ  ¼ñ*dL XúIp V.n§Œ ©ä Éb®H&Ùˆð˜ I
>
> If you look at the same page at the link below, everything is fine.
> http://www.t1shopper.com/tools/calculate/
>
> If I restart Apache, the problem remains but if I delete the disk_cache the problem goes away.
> shell> rm -rf /var/httpd/proxy/*
>
> Why is mod_disk_cache screwing this include up?

I don't think this is a configuration issue; open a bug report at
https://issues.apache.org/bugzilla/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] mod_disk_cache causing corrupted output on server side includes?

Posted by Geoff Millikan <gm...@t1shopper.com>.
Dear List,

You can see the corrupted/binary garbled mess on the page at the link here:
http://www.t1shopper.com/tools/calculate/index.shtml

The scrambled mess is outputted right at the server side include like this:
<!--#include virtual="/tools/calculate/filesizedescription.html" -->	

Everything else on the page looks fine, it's only the included file that's mangled like this:
í\énÛHþÜ|á]åâu?-SìA½¡!ŸÄoÿ›IÅÇsØß'±"’ÿ ¼ñ*dLXúIpV.n§Œ ©äÉb®H&Ùˆð˜I

If you look at the same page at the link below, everything is fine.
http://www.t1shopper.com/tools/calculate/

If I restart Apache, the problem remains but if I delete the disk_cache the problem goes away.
shell> rm -rf /var/httpd/proxy/*

Why is mod_disk_cache screwing this include up?

Thanks,

http://www.t1shopper.com/


CacheRoot /var/httpd/proxy/
CacheEnable disk /
CacheDisable /i
CacheMaxFileSize 500000
CacheMinFileSize 1000
CacheDirLevels 2
CacheDirLength 2
CacheIgnoreCacheControl Off
CacheIgnoreNoLastMod On
CacheIgnoreHeaders Set-Cookie
CacheLastModifiedFactor 0.1
CacheMaxExpire 172800
CacheDefaultExpire 86400

Re: [users@httpd] Running script from configuration file of Apache2

Posted by Eric Covener <co...@gmail.com>.
On Wed, Apr 21, 2010 at 9:41 AM, Petr Hracek <ph...@gmail.com> wrote:
> OK. Thanks but for the clarification on the
> http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
> in section Forward Proxies and Reverse Proxyies is mentioned:
>
> A reverse proxy is activated using the ProxyPass directive or the [P] flag
> to the RewriteRule directive. It is not necessary to turn ProxyRequests on
> in order to configure a reverse proxy.
>
> Does it mean that Rewrite Rule has to be mentioned always?

No, that's why it says "or".

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Running script from configuration file of Apache2

Posted by Petr Hracek <ph...@gmail.com>.
OK. Thanks but for the clarification on the
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
in section Forward Proxies and Reverse Proxyies is mentioned:

A reverse proxy is activated using the
ProxyPass<http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass>directive
* or *the [P] flag to the
RewriteRule<http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule>directive.
It is
*not* necessary to turn
ProxyRequests<http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxyrequests>on
in order to configure a reverse proxy.

Does it mean that Rewrite Rule has to be mentioned always?

BR
Petr
2010/4/21 Tom Evans <te...@googlemail.com>

> On Wed, Apr 21, 2010 at 2:21 PM, Petr Hracek <ph...@gmail.com> wrote:
> > Is there any possibility how to work without RewriteRule
> > with turn on RewriteRule?
> >
> > thank you in advance
> > Petr
> >
>
> No, not really.
>
> Cheers
>
> Tom
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Best Regards / S pozdravem
Petr Hracek

Re: [users@httpd] Running script from configuration file of Apache2

Posted by Tom Evans <te...@googlemail.com>.
On Wed, Apr 21, 2010 at 2:21 PM, Petr Hracek <ph...@gmail.com> wrote:
> Is there any possibility how to work without RewriteRule
> with turn on RewriteRule?
>
> thank you in advance
> Petr
>

No, not really.

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Running script from configuration file of Apache2

Posted by Petr Hracek <ph...@gmail.com>.
Is there any possibility how to work without RewriteRule
with turn on RewriteRule?

thank you in advance
Petr

2010/4/21 Tom Evans <te...@googlemail.com>

> On Wed, Apr 21, 2010 at 11:24 AM, Petr Hracek <ph...@gmail.com> wrote:
> > Hello *,
> >
> > I would like to ask you on the one interesting think:
> > I need to proxy the requests to the specified url to a dynamically
> generated
> > address.
> > Instead of:
> > <Location "/CAP/">
> >     ProxyPass  http://192.0.2.25:8080/CBAdmin/
> >     ProxyPassReverse    http://192.0.2.25:8080/CBAdmin/
> >     ProxyPassReverseCookiePath /CBAdmin /CAP
> >     Order Allow,Deny
> >     Allow from all
> > </Location>
> > There should be something like that instead of IP address there will
> > be a script like generate_forward_address
> >
> > I think that the mod_macro is not helpful here. I also cannot use
> > RewriteRule [P] which has more possibilities because I need the
> > ProxyPassReverse as well.
> >
> > Do you have any idea how to solve it?
> >
>
> That is incorrect; ProxyPassReverse does not require ProxyPass, and is
> more than happy to work with RewriteRule ... [P].
>
> You can't do it with scripts, but you should be able to do it with a
> RewriteRule, and multiple ProxyPassReverse, one for each backend you
> could redirect to.
>
> Actually you could do it with a script, using a program map to
> generate the rewrite. I've never used this myself, it looks like it
> might impact performance a bit to me.
>
> Cheers
>
> Tom
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Best Regards / S pozdravem
Petr Hracek

Re: [users@httpd] Running script from configuration file of Apache2

Posted by Tom Evans <te...@googlemail.com>.
On Wed, Apr 21, 2010 at 11:24 AM, Petr Hracek <ph...@gmail.com> wrote:
> Hello *,
>
> I would like to ask you on the one interesting think:
> I need to proxy the requests to the specified url to a dynamically generated
> address.
> Instead of:
> <Location "/CAP/">
>     ProxyPass  http://192.0.2.25:8080/CBAdmin/
>     ProxyPassReverse    http://192.0.2.25:8080/CBAdmin/
>     ProxyPassReverseCookiePath /CBAdmin /CAP
>     Order Allow,Deny
>     Allow from all
> </Location>
> There should be something like that instead of IP address there will
> be a script like generate_forward_address
>
> I think that the mod_macro is not helpful here. I also cannot use
> RewriteRule [P] which has more possibilities because I need the
> ProxyPassReverse as well.
>
> Do you have any idea how to solve it?
>

That is incorrect; ProxyPassReverse does not require ProxyPass, and is
more than happy to work with RewriteRule ... [P].

You can't do it with scripts, but you should be able to do it with a
RewriteRule, and multiple ProxyPassReverse, one for each backend you
could redirect to.

Actually you could do it with a script, using a program map to
generate the rewrite. I've never used this myself, it looks like it
might impact performance a bit to me.

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org