Project

General

Profile

Actions

Feature #47

closed

Support for cgi-bin style directories.

Added by Anonymous about 19 years ago. Updated about 17 years ago.

Status:
Fixed
Priority:
Low
Category:
mod_cgi
Target version:
-
ASK QUESTIONS IN Forums:

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

Actions #1

Updated by Anonymous over 18 years ago

second that.

-- bobo12

Actions #2

Updated by Anonymous over 18 years ago

second that.

-- bobo12

Actions #3

Updated by Anonymous about 18 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

Actions #4

Updated by Anonymous about 18 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

Actions #5

Updated by Anonymous about 18 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

Actions #6

Updated by Anonymous about 18 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

Actions #7

Updated by marc about 18 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...

Actions #8

Updated by moo about 18 years ago

  • Status changed from New to Fixed
  • Resolution set to fixed

cgi-assign ( "/cgi-bin/" => "" )
Actions #9

Updated by moo about 18 years ago


cgi.assign = ("/cgi-bin/" => "")

i was misleaded by u guys :)

Actions

Also available in: Atom