Feature #47
closedSupport for cgi-bin style directories.
Description
It would be nice if there was support for cgi-bin style directories where all the executable files are treated as cgi's independent of the extension.
E.g. for mailman the cgi's are stored under /usr/lib/cgi-bin/mailman/ and are called "listinfo", "admin", "confirm", ... Currently it isn't possible to run them as cgi's without adding them one by one.
-- gst
Updated by Anonymous over 19 years ago
I achieved this using the following configuration. It seems to work although there may be other effects that I have missed as I have only tested it in my particular application:
$HTTPurl =~ "/cgi-bin/.*$" {
cgi-assign ( "" => "" )
}
This seems to work providing that the shell can determine how to execute the file (the script must contain a shbang line at the top).
-- Patrick Brennan
Updated by Anonymous over 19 years ago
Thinking about my above comment a little more. In my case the files being executed a binaries. It is likely that (although I haven't checked) that lighttpd uses exec (or a variant) to execute cgi files. This means that the shell is not involved and my technique would only work with binary executables. Feel free to test this (I don't have time at the moment) and append a comment here for all to read.
-- Patrick Brennan
Updated by Anonymous over 19 years ago
Further to the above, it seems to work for perl files as well. Maybe I'm missing something important (or maybe I've inadvertantly discovered a feature) but it seems to work for me.
-- Patrick Brennan
Updated by Anonymous over 19 years ago
Just small caveat, lighttpd will attempt to execute any directories under the cgi-bin pattern match (if a user specifies them as a URL). This results in a 500 Server Error. I doesn't seem to have any other detrimental effects, so I am ignoring it for the time being.
-- Patrick Brennan
Updated by marc about 19 years ago
The following would work:
cgi-assign ( "/cgi-bin/perl/" => "/usr/bin/perl", "/cgi-bin/python/" => "/usr/bin/python", "/cgi-bin/bash/" => "/bin/bash", )
If you can seperate your scripts into different directories...
Updated by moo about 19 years ago
- Status changed from New to Fixed
- Resolution set to fixed
cgi-assign ( "/cgi-bin/" => "" )
Updated by moo about 19 years ago
cgi.assign = ("/cgi-bin/" => "")
i was misleaded by u guys :)
Also available in: Atom