Bug 37290 - DirectoryIndex don't work in scriptaliased directory
Summary: DirectoryIndex don't work in scriptaliased directory
Status: REOPENED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_dir (show other bugs)
Version: 2.0.54
Hardware: Other other
: P2 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-28 15:37 UTC by Gabor M.
Modified: 2005-11-02 08:04 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor M. 2005-10-28 15:37:28 UTC
ScriptAlias /lists /usr/lib/cgi-bin/mailman
DirectoryIndex listinfo

log: attempt to invoke directory as script: /usr/lib/cgi-bin/mailman/
Comment 1 Joshua Slive 2005-10-28 19:03:53 UTC
This has always been true, and is easily worked-around using
Alias /lists /usr/lib/cgi-bin/mailman
<Directory /usr/lib/cgi-bin/mailman>
Options ExecCGI
SetHandler cgi-script
</Directory>

I'm not sure if there is a good reason for not allowing mod_autoindex to act on
ScriptAliased directories (it could be considered a security feature) or if it
is just a side-effect of the way ScriptAlias works.
Comment 2 Gabor M. 2005-11-02 09:52:16 UTC
(In reply to comment #1)
> This has always been true, and is easily worked-around using
> Alias /lists /usr/lib/cgi-bin/mailman
> <Directory /usr/lib/cgi-bin/mailman>
> Options ExecCGI
> SetHandler cgi-script
> </Directory>

[error] [client] attempt to invoke directory as script: /usr/lib/cgi-bin/mailman/
Comment 3 Joshua Slive 2005-11-02 16:38:03 UTC
Indeed, I believe that worked in 1.3 but SetHandler is more agressive in 2.x
(grabbing requests even when they don't map to files).  So you need to wrap the
SetHandler in <FilesMatch .+> ... </FilesMatch>.  (Or just map the extensions
you need using AddHandler.)
Comment 4 Paul Querna 2005-11-02 16:44:12 UTC
File Extensions?

We don't use no stinking file extensions!
Comment 5 Paul Querna 2005-11-02 16:46:19 UTC

*** This bug has been marked as a duplicate of 25435 ***
Comment 6 Gabor M. 2005-11-02 16:48:03 UTC
mailman use scripts without extensions :(
Comment 7 Joshua Slive 2005-11-02 17:04:16 UTC
I'm not sure that the original "bug" here is really a dupe.  ScriptAlias and
DirectoryIndex don't work together for a different reason than SetHandler and
DirectoryIndex don't work together.

And Zoltan, the <FilesMatch> trick will work regardless of whether or not the
files have extensions.  It is only AddHandler that requires extensions.