You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jean-Marc Jacquot <je...@investis.com> on 2005/06/01 12:47:07 UTC

[users@httpd] Apache2 Action/Handler problem

Hi there,

I coulnd't find anything related to my problem either in the ml archive 
or by googling so here am I.

We've recently upgraded our PHP development host from Apache 1.3 to 
Apache 2.0 in order to validate that our application would run on it.

Our application need for some part, to make use of the Action/Handler 
system of Apache.

The following two lines are used in httpd.conf

AddHandler pdf .pdf
Action pdf /cgi-bin/handlepdf.pl

The expected result is that when you call an url pointing to a .pdf 
file, it call the handler the script instead of returning the file. BTW, 
the script is working fine when I call it directly so it's not that it's 
not recognised as Script.

This was perfectly working under Apache 1.3 but isn't under Apache 2.0 
(Tested with last available release 2.0.54)

I would bet for an bug in the mod_actions module in the Apache2 branch 
but before posting a bug report, I'm following the process to post here 
in case someone already had the problem.

Regards, Jean-Marc.

---------------------------------------------------------------------
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] Apache2 Action/Handler problem

Posted by Joshua Slive <js...@gmail.com>.
On 6/2/05, Jean-Marc Jacquot <je...@investis.com> wrote:
> Joshua,
> 
> Thank you very much for this information and also for the suggestion,
> I've been able to solve my problem with it.
> 
> I think that the information regarding the change in mod_actions should
> be in the documentation. Does anyone reading this list has the
> possibility to do it quickly or should I post a bug report to suggest it  ?

If you look at the 2.1 docs:
http://httpd.apache.org/docs-2.1/mod/mod_actions.html#action
you'll see that Action has been changed to allow either behavior.

This should be documented in the upgrading docs in 2.0, but there has
been an ongoing discussion about whether the behavior should be
changed back, or whether the 2.1 behavior should be backported, so
nobody every bothered documenting the current state.

Joshua.

---------------------------------------------------------------------
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] Apache2 Action/Handler problem

Posted by Jean-Marc Jacquot <je...@investis.com>.
Joshua,

Thank you very much for this information and also for the suggestion, 
I've been able to solve my problem with it.

I think that the information regarding the change in mod_actions should 
be in the documentation. Does anyone reading this list has the 
possibility to do it quickly or should I post a bug report to suggest it  ?

Regards, Jean-Marc.

Joshua Slive wrote:
> On 6/1/05, Jean-Marc Jacquot <je...@investis.com> wrote:
> 
>>AddHandler pdf .pdf
>>Action pdf /cgi-bin/handlepdf.pl
>>
>>The expected result is that when you call an url pointing to a .pdf
>>file, it call the handler the script instead of returning the file. BTW,
>>the script is working fine when I call it directly so it's not that it's
>>not recognised as Script.
> 
> 
> What exactly happens when you try this?  What is in the error and access logs?
> 
> There is one notable difference in Action in 2.0: it won't map files
> that don't exist.  If that is what you are trying to do, you should
> instead use something like
> AliasMatch .*\.pdf$ /usr/local/apache2/cgi-bin/handlepdf.pl
> 
> Joshua.
> 
> ---------------------------------------------------------------------
> 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
> 
> 


---------------------------------------------------------------------
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] Apache2 Action/Handler problem

Posted by Joshua Slive <js...@gmail.com>.
On 6/1/05, Jean-Marc Jacquot <je...@investis.com> wrote:
> AddHandler pdf .pdf
> Action pdf /cgi-bin/handlepdf.pl
> 
> The expected result is that when you call an url pointing to a .pdf
> file, it call the handler the script instead of returning the file. BTW,
> the script is working fine when I call it directly so it's not that it's
> not recognised as Script.

What exactly happens when you try this?  What is in the error and access logs?

There is one notable difference in Action in 2.0: it won't map files
that don't exist.  If that is what you are trying to do, you should
instead use something like
AliasMatch .*\.pdf$ /usr/local/apache2/cgi-bin/handlepdf.pl

Joshua.

---------------------------------------------------------------------
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