OT: question

Fairlight fairlite at fairlite.com
Fri Apr 9 16:41:36 PDT 2010


Four score and seven years--eh, screw that!  At about Fri, Apr 09, 2010 at
07:30:46PM -0400, Brian K. White blabbed on about:
> On 4/9/2010 5:58 PM, Richard Hane wrote:
>
> > Mark,
> >
> > Thank you.  I'll give them a try.
> >
> > I have been on many iis sites but still can not find out where to place
> > the cgi folder.  And is it called cgi-bin or cgi-win.  Pretty simple
> > questions you would think you could find on the Microsoft iis site but
> > alas, no.

Typically, there's a cgi-bin directory in the default server configuration.
The folder usually exists by default on a clean system, and I've never seen
it anywhere but c:/inetpub/cgi-bin/ in Windows Server 2003 systems (and I
think a Windows Server 2008 box too).

> The question is probably too simple to answer, meaning the thing you are
> asking about is not as simple as the question, and so the question is
> meaningless, and so there is no correct answer to it.
>
> For instance:  IIS probably does not do cgi at all for any directory
> until you specifically configure it to do so, and so there is no such
> place or directory. And when you do configure IIS to enable cgi, you
> probably have to specify the directory and you make it whatever you
> want. 

Wrong.  It not only comes configured to do it, it comes with a default user
for doing so, already attached to the directory.

Speaking of which, I don't have access right now to an IIS box, but as I
remember it, if you go into the IIS Manager and go to the default server,
open that up, and right click on cgi-bin, then you can hit Properties and
get the pathname.  There may even have been an open folder option there,
but I can't remember that much detail for sure.  I -do- remember finding
the local disk location for the directory via the IIS Manager properties
for the URI, however.

> And there is no "it", you can have as many different or as few active
> directories or individual files as you want, named anything, placed
> anywhere. There is really no reason to have a cgi-bin, and there are some
> reasons not-to.  For instance, I have cgi script named "statement.pdf"
> The file is not in cgi-bin nor in any other magic active directory. That
> specific file is active, while most of the other files in the same
> directory are plain static content. It is not a pdf file. It's a ksh
> script that creates and outputs pdf data on the fly, preceded by http
> headers including mime-type declaration for pdf. When the browser gets a
> url to that script like "http://server/statement.pdf?query_string_here"
> It looks to the browser like it's just downloading a static file named
> statement.pdf.

That's what $PATH_INFO is for:

http://somehost.com/cgi-bin/some_script/statement.pdf?query_string

some_script will be executed, and $PATH_INFO will contain /statement.pdf,
but the key thing is that (most, sane) browsers will take the path info
basename for their filename.

It's not necessary to name your script oddly to get download functionality
with the proper MIME type.

> By default IIS is not even installed, and when installed it starts out
> configured with no "active" services enabled, just static content. You
> have to actively enable cgi, and along the way doing that, you have to
> specify what files & directories will be active and what their names will
> be and where they will be on the real filesystem and what their web alias
> path will be. How exactly you do that configuring is described in the
> article.

And yet, every IIS installation I've ever seen has a cgi-bin already good
to go, stock.

mark->
-- 
Audio panton, cogito singularis,


More information about the Filepro-list mailing list