You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by nocturnal <no...@swehack.se> on 2006/04/07 15:31:07 UTC

[users@httpd] Using an Alias as second argument to Action

Hi

I'm using Action on a handler created by AddHandler and it works just 
fine but Action takes a virtual path as second argument so the file must 
be in the web root directory for the vhost. I'd like to use a predefined 
Alias pointing to a global place in the file system for the Action. This 
is an example of what i'm doing right now.

<VirtualHost ip:port>
<Directory /web/root>
AddHandler php-v4 .php
Action php-v4 /cgi-bin/program.cgi
</Directory>
</VirtualHost>

This works but requires us to put the binary executable file in each web 
root directory for each vhost. This is what we want to do but it 
produces 500 errors.

Alias /cgi-bin /usr/home/cgi-bin
<VirtualHost ip:port>
<Directory /web/root>
AddHandler php-v4 .php
Action php-v4 /cgi-bin/program.cgi
</Directory>
</VirtualHost>

I'm using Apache HTTPD 2.2.0 for all of this.
-- 



Med vänliga hälsningar

Stefan Midjich aka nocturnal
[Swehack] http://swehack.se


---------------------------------------------------------------------
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] Using an Alias as second argument to Action

Posted by Joshua Slive <jo...@slive.ca>.
On 4/7/06, nocturnal <no...@swehack.se> wrote:
> Hi
>
> I'm using Action on a handler created by AddHandler and it works just
> fine but Action takes a virtual path as second argument so the file must
> be in the web root directory for the vhost. I'd like to use a predefined
> Alias pointing to a global place in the file system for the Action. This
> is an example of what i'm doing right now.
>
> <VirtualHost ip:port>
> <Directory /web/root>
> AddHandler php-v4 .php
> Action php-v4 /cgi-bin/program.cgi
> </Directory>
> </VirtualHost>
>
> This works but requires us to put the binary executable file in each web
> root directory for each vhost. This is what we want to do but it
> produces 500 errors.
>
> Alias /cgi-bin /usr/home/cgi-bin
> <VirtualHost ip:port>
> <Directory /web/root>
> AddHandler php-v4 .php
> Action php-v4 /cgi-bin/program.cgi
> </Directory>
> </VirtualHost>
>
> I'm using Apache HTTPD 2.2.0 for all of this.

And what is in the error log?

In general, I don't see the point in the complication of Action when
you can simply do
AliasMatch (.*)\.php$ /usr/home/cgi-bin/program.cgi/$1
(although this may require small changes in your script).

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