Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Combining a custom action handler with Deflate

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Making mod_rewrite global  
Author Message
nospamohno

External


Since: Sep 24, 2004
Posts: 4



(Msg. 1) Posted: Fri Sep 24, 2004 8:45 pm
Post subject: Combining a custom action handler with Deflate
Archived from groups: alt>apache>configuration (more info?)

Howdy All,

I'm using Apache 2. I'm trying to combine a custom action handler with
the built in Apache DEFLATE filter. My goal is to have all files of MIME
type text/html processed by a custom cgi program that generates an HTML
page, and then have Apache compress the resulting HTML before sending it to
the web client.

Here's what I have in mind for my .htaccess file:

Action text/html /cgi-bin/testaction/custom.cgi
AddOutputFilterByType DEFLATE text/html


The custom cgi program works fine. I've no trouble in calling up web
pages that get processed by my cgi program.

When used with static HTML pages that do not receive cgi processing, the
compression works just fine.

When I combine the two, as shown above in my .htaccess example, the cgi
processing happens, but the compression does not. I get correct but
uncompressed HTML. The utility program generates a correct MIME type
header.

Does anyone have any idea as to why this isn't working?

Thanks,

MK

 >> Stay informed about: Combining a custom action handler with Deflate 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 2) Posted: Sat Sep 25, 2004 1:56 am
Post subject: Re: Combining a custom action handler with Deflate [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Mighty Krell" <nospamohno.RemoveThis@despammer.com> schreef in bericht
news:e3Z4d.2037$zG1.273@newsread3.news.pas.earthlink.net...
 > Action text/html /cgi-bin/testaction/custom.cgi
 > AddOutputFilterByType DEFLATE text/html
 > The custom cgi program works fine. I've no trouble in calling up web
 > pages that get processed by my cgi program.
 > When used with static HTML pages that do not receive cgi processing, the
 > compression works just fine.
 >
 > When I combine the two, as shown above in my .htaccess example, the cgi
 > processing happens, but the compression does not. I get correct but
 > uncompressed HTML. The utility program generates a correct MIME type
 > header.
What if you swap the two lines?
If that gives you compressed, but unprocessed result try
AddHandler mySSI .html
Action mySSI /cgi-bin/testaction/custom.cgi
AddOutputFilterByType DEFLATE text/html

Good luck ... do post results eitherway.

HansH<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Combining a custom action handler with Deflate 
Back to top
Login to vote
nospamohno

External


Since: Sep 24, 2004
Posts: 4



(Msg. 3) Posted: Sat Sep 25, 2004 9:13 pm
Post subject: Re: Combining a custom action handler with Deflate [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hello,

I've already tried both of those ideas. Neither of them change the
behavior of the system.

MK


"HansH" <hans.TakeThisOut@niet.op.het.net> wrote in message
news:cj21q3$q3$1@news.cistron.nl...
 > "Mighty Krell" <nospamohno.TakeThisOut@despammer.com> schreef in bericht
 > news:e3Z4d.2037$zG1.273@newsread3.news.pas.earthlink.net...
  > > Action text/html /cgi-bin/testaction/custom.cgi
  > > AddOutputFilterByType DEFLATE text/html
  > > The custom cgi program works fine. I've no trouble in calling up web
  > > pages that get processed by my cgi program.
  > > When used with static HTML pages that do not receive cgi processing,
the
  > > compression works just fine.
  > >
  > > When I combine the two, as shown above in my .htaccess example, the cgi
  > > processing happens, but the compression does not. I get correct but
  > > uncompressed HTML. The utility program generates a correct MIME type
  > > header.
 > What if you swap the two lines?
 > If that gives you compressed, but unprocessed result try
 > AddHandler mySSI .html
 > Action mySSI /cgi-bin/testaction/custom.cgi
 > AddOutputFilterByType DEFLATE text/html
 >
 > Good luck ... do post results eitherway.
 >
 > HansH
 >
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Combining a custom action handler with Deflate 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 4) Posted: Sat Sep 25, 2004 11:38 pm
Post subject: Re: Combining a custom action handler with Deflate [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Mighty Krell" <nospamohno.TakeThisOut@despammer.com> schreef in bericht
news:Gzi5d.3037$zG1.2688@newsread3.news.pas.earthlink.net...
 > "HansH" <hans.TakeThisOut@niet.op.het.net> wrote in message
 > news:cj21q3$q3$1@news.cistron.nl...
  > > "Mighty Krell" <nospamohno.TakeThisOut@despammer.com> schreef in bericht
  > > news:e3Z4d.2037$zG1.273@newsread3.news.pas.earthlink.net...
   > > > Action text/html /cgi-bin/testaction/custom.cgi
   > > > AddOutputFilterByType DEFLATE text/html
   > > > The custom cgi program works fine. I've no trouble in calling up web
   > > > pages that get processed by my cgi program.
   > > > When used with static HTML pages that do not receive cgi processing,
   > > > the compression works just fine.
   > > > When I combine the two, as shown above in my .htaccess example, the
cgi
   > > > processing happens, but the compression does not. I get correct but
   > > > uncompressed HTML. The utility program generates a correct MIME type
   > > > header.
  > > What if you swap the two lines?
  > > If that gives you compressed, but unprocessed result try
  > > AddHandler mySSI .html
  > > Action mySSI /cgi-bin/testaction/custom.cgi
  > > AddOutputFilterByType DEFLATE text/html
 > I've already tried both of those ideas. Neither of them change the
 > behavior of the system.
Last thing I can think off is setting a rewriterule -in httpd.conf- like
RewriteRule ^(/path/.*)$ /cgi-bin/testaction/custom.cgi?$1 [PT]

Awaiting next post...

HansH<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Combining a custom action handler with Deflate 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 5) Posted: Sat Sep 25, 2004 11:46 pm
Post subject: Re: Combining a custom action handler with Deflate [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Mighty Krell" <nospamohno RemoveThis @despammer.com> schreef in bericht
news:Gzi5d.3037$zG1.2688@newsread3.news.pas.earthlink.net...
 > "HansH" <hans RemoveThis @niet.op.het.net> wrote in message
 > news:cj21q3$q3$1@news.cistron.nl...
  > > "Mighty Krell" <nospamohno RemoveThis @despammer.com> schreef in bericht
  > > news:e3Z4d.2037$zG1.273@newsread3.news.pas.earthlink.net...
   > > > Action text/html /cgi-bin/testaction/custom.cgi
   > > > AddOutputFilterByType DEFLATE text/html
   > > > The custom cgi program works fine. I've no trouble in calling up web
   > > > pages that get processed by my cgi program.
   > > > When used with static HTML pages that do not receive cgi processing,
 > the
   > > > compression works just fine.
   > > >
   > > > When I combine the two, as shown above in my .htaccess example, the
cgi
   > > > processing happens, but the compression does not. I get correct but
   > > > uncompressed HTML. The utility program generates a correct MIME type
   > > > header.
  > > What if you swap the two lines?
  > > If that gives you compressed, but unprocessed result try
  > > AddHandler mySSI .html
  > > Action mySSI /cgi-bin/testaction/custom.cgi
  > > AddOutputFilterByType DEFLATE text/html
 > I've already tried both of those ideas. Neither of them change the
 > behavior of the system.
Have you tried changing load order of mod_actions and mod_deflate?

Last thing I can think off is setting a rewriterule -in httpd.conf- like
RewriteRule ^(/path/.*)$ /cgi-bin/testaction/custom.cgi?$1 [PT]

Awaiting next post...

HansH<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Combining a custom action handler with Deflate 
Back to top
Login to vote
nospamohno

External


Since: Sep 24, 2004
Posts: 4



(Msg. 6) Posted: Sat Sep 25, 2004 11:46 pm
Post subject: Re: Combining a custom action handler with Deflate [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"HansH" <hans RemoveThis @niet.op.het.net> wrote in message
news:cj4eh7$ng0$1@news.cistron.nl...
 >
 > "Mighty Krell" <nospamohno RemoveThis @despammer.com> schreef in bericht
 > news:Gzi5d.3037$zG1.2688@newsread3.news.pas.earthlink.net...
  > > "HansH" <hans RemoveThis @niet.op.het.net> wrote in message
  > > news:cj21q3$q3$1@news.cistron.nl...
   > > > "Mighty Krell" <nospamohno RemoveThis @despammer.com> schreef in bericht
   > > > news:e3Z4d.2037$zG1.273@newsread3.news.pas.earthlink.net...
   > > > > Action text/html /cgi-bin/testaction/custom.cgi
   > > > > AddOutputFilterByType DEFLATE text/html
   > > > > The custom cgi program works fine. I've no trouble in calling up
web
   > > > > pages that get processed by my cgi program.
   > > > > When used with static HTML pages that do not receive cgi
processing,
  > > the
   > > > > compression works just fine.
   > > > >
   > > > > When I combine the two, as shown above in my .htaccess example, the
 > cgi
   > > > > processing happens, but the compression does not. I get correct but
   > > > > uncompressed HTML. The utility program generates a correct MIME
type
   > > > > header.
   > > > What if you swap the two lines?
   > > > If that gives you compressed, but unprocessed result try
   > > > AddHandler mySSI .html
   > > > Action mySSI /cgi-bin/testaction/custom.cgi
   > > > AddOutputFilterByType DEFLATE text/html
  > > I've already tried both of those ideas. Neither of them change the
  > > behavior of the system.
 > Have you tried changing load order of mod_actions and mod_deflate?
 >
 > Last thing I can think off is setting a rewriterule -in httpd.conf- like
 > RewriteRule ^(/path/.*)$ /cgi-bin/testaction/custom.cgi?$1 [PT]
 >
 > Awaiting next post...
 >
 > HansH
 >

I have no control over the load order of the modules. If that makes a
difference, I'll file a bug report with Apache.

I don't want to use mod_rewrite. I simply want to know how to combine a
simple Action with a built-in Apache output filter.

MK<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Combining a custom action handler with Deflate 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 7) Posted: Sun Sep 26, 2004 1:31 am
Post subject: Re: Combining a custom action handler with Deflate [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Mighty Krell" <nospamohno.DeleteThis@despammer.com> schreef in bericht
news:_wj5d.3076$zG1.192@newsread3.news.pas.earthlink.net...
 > "HansH" <hans.DeleteThis@niet.op.het.net> wrote in message
 > news:cj4eh7$ng0$1@news.cistron.nl...
  > > "Mighty Krell" <nospamohno.DeleteThis@despammer.com> schreef in bericht
  > > news:Gzi5d.3037$zG1.2688@newsread3.news.pas.earthlink.net...
   > > > "HansH" <hans.DeleteThis@niet.op.het.net> wrote in message
   > > > news:cj21q3$q3$1@news.cistron.nl...
  > > Have you tried changing load order of mod_actions and mod_deflate?
 > I have no control over the load order of the modules.
As in it is not your server or because all files of a folder are include in
the (alphabatical) order of its filesystem?

 > If that makes a difference, I'll file a bug report with Apache.
Why, it is rather common to have two modules one eating the others tail,
that made mod_alias and mod_rewrite a famous couple -even after being
properly ordered- Sad.

Another couple is mod_*_cache and mod_proxy, if you want to cache your
proxied request too you have to load mod_*_cache first. Mod_dav has to be
loaded after mod_auth* to be able to use that authentication mechanisme.

Coincidently in the given examples the alphabetic ordering happens to work
out fine...

  > > Last thing I can think off is setting a rewriterule -in httpd.conf- like
  > > RewriteRule ^(/path/.*)$ /cgi-bin/testaction/custom.cgi?$1 [PT]
 > I don't want to use mod_rewrite.
 > I simply want to know how to combine a simple Action with a
 > built-in Apache output filter.
Getting pragmatic ... well, if there is no hurry, enjoy.

Final thought, your reallife script isn't by chance 'nph-' prefixed, is it?

HansH<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Combining a custom action handler with Deflate 
Back to top
Login to vote
nospamohno

External


Since: Sep 24, 2004
Posts: 4



(Msg. 8) Posted: Sun Sep 26, 2004 1:31 am
Post subject: Re: Combining a custom action handler with Deflate [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hello Hans,

The cgi program does not generate nph headers.

MK

"HansH" <hans.DeleteThis@niet.op.het.net> wrote in message
news:cj4kmj$uat$1@news.cistron.nl...
 > "Mighty Krell" <nospamohno.DeleteThis@despammer.com> schreef in bericht
 > news:_wj5d.3076$zG1.192@newsread3.news.pas.earthlink.net...
  > > "HansH" <hans.DeleteThis@niet.op.het.net> wrote in message
  > > news:cj4eh7$ng0$1@news.cistron.nl...
   > > > "Mighty Krell" <nospamohno.DeleteThis@despammer.com> schreef in bericht
   > > > news:Gzi5d.3037$zG1.2688@newsread3.news.pas.earthlink.net...
   > > > > "HansH" <hans.DeleteThis@niet.op.het.net> wrote in message
   > > > > news:cj21q3$q3$1@news.cistron.nl...
   > > > Have you tried changing load order of mod_actions and mod_deflate?
  > > I have no control over the load order of the modules.
 > As in it is not your server or because all files of a folder are include
in
 > the (alphabatical) order of its filesystem?
 >
  > > If that makes a difference, I'll file a bug report with Apache.
 > Why, it is rather common to have two modules one eating the others tail,
 > that made mod_alias and mod_rewrite a famous couple -even after being
 > properly ordered- Sad.
 >
 > Another couple is mod_*_cache and mod_proxy, if you want to cache your
 > proxied request too you have to load mod_*_cache first. Mod_dav has to be
 > loaded after mod_auth* to be able to use that authentication mechanisme.
 >
 > Coincidently in the given examples the alphabetic ordering happens to work
 > out fine...
 >
   > > > Last thing I can think off is setting a rewriterule -in httpd.conf-
like
   > > > RewriteRule ^(/path/.*)$ /cgi-bin/testaction/custom.cgi?$1 [PT]
  > > I don't want to use mod_rewrite.
  > > I simply want to know how to combine a simple Action with a
  > > built-in Apache output filter.
 > Getting pragmatic ... well, if there is no hurry, enjoy.
 >
 > Final thought, your reallife script isn't by chance 'nph-' prefixed, is
it?
 >
 > HansH
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Combining a custom action handler with Deflate 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Combining two rewrite rules - stuck :| - Hello I'm trying to combine: RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://poff\.sixbit\.org.*$ [NC] RewriteCond %{REQUEST_FILENAME} .*\.(jpg|gif|png|jpeg)$ RewriteRule \.(jpg|gif|png|jpeg)$..

Configuring a 413 error handler does not work - Using Apache 1.3.27, I have set the LimitRequestBody to 15 MB (15728640). When I upload a file that is larger than that, I get back the standard 413 Apache error message as expected. Now, I want to have a custom 413 error page. So I put in the..

reverse proxy setup...still getting "No protocol handler .. - I am trying to enable reverse proxy.. I have done the following: 1) Activate the following Modules: LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule proxy_ftp_module..

Action Handlers not working - I am trying to get action handlers on my web server, but no matter what I do, it seems to be completely disregarding the Action directive (serving the files as if there were no Action directive at all). Here is the virtual hosts configuration:..

Question about relative pathes in 'Action' - Hi! I'm actually trying to launch a CGI script automatically whenever a certain file type is requested. So my .htaccess looks right now like this: options -indexes AddHandler launchon-ext .ext Action launchon-ext /l_ext.cgi This works quite good. My....
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]