You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gary Wilson <gw...@plus.net> on 2005/05/09 19:19:10 UTC

[users@httpd] using CGI as DirectoryIndex with cgiwrap and rewriterules

Hi all!

I am having a small issue with a setup I am experimenting with.

I am using cgiwrap to provide my users with cgi functionality for PHP,
Perl etc (as there is a need for all CGI to run as the user who owns 
the file, hence no mod_php but running php and a CGI instead)

In order to ensure the wrappers work seamlessly, I use rewriterules to 
quietly rewrite the URLs to the wrapper, which in turn looks up the user
and runs their script - this works fine for all named scripts (i.e. 
where you specify the script filename on the URL).

I now need to support .php as a directoryindex, but the rewriterules
seem to go very strange for this case.

Following the rewritelog, I see the rules roll round in turn trying to 
add each of the directoryindex's specified in httpd.conf.  the last 
one it tries is .php, and the rules correctly generate a correct file 
path to the file, but at this point, the rewrite engine starts to 
go into a redirect state, where it them completely screws up what's
going on.

I think this is best explained if I provide both rewrite logs, the 
first for the url http://foo.username.bar.com/index.php (which work),
and then the second for just http://foo.username.bar.com/ (which relies
on apache adding the index.php from the directoryindex line in
httpd.conf):

Both logs are attatched to this mail.

the user is username and their local path to their data would be 
/files/home2/username/

Can anyone shed any light as to why the rewrite rules go so whacky when 
I let apache provide the filename via DirectoryIndex?

Thanks everyone!

Gary Wilson