PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.info.servers.win > DOCUMENT_ROOT in IIS - IIS CGI locations?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.win Web servers for MS Windows and NT.

DOCUMENT_ROOT in IIS - IIS CGI locations?

Réponse
 
LinkBack Outils de la discussion
Vieux 29/08/2005, 16h24   #1
davidnwelton@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut DOCUMENT_ROOT in IIS - IIS CGI locations?

Hi,

Two questions:

Google seems to indicate that IIS does not have a DOCUMENT_ROOT
equivalent. Is that indeed true? Are there workarounds besides
manually adding that environmental variable (which is kind of out of
the question in this case...)?

My problem is that I need to know that information so that I can do
some local file system operations via a CGI. One other way of getting
that information is by telling users to locate the CGI in the document
root. Is that bad practice in IIS? I know that in Apache you probably
wouldn't want to do that...you'd put your CGI in a cgi-bin directory.

Any appreciated,
Thanks,
Dave

  Réponse avec citation
Vieux 31/08/2005, 12h35   #2
William Tasso
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: DOCUMENT_ROOT in IIS - IIS CGI locations?

davidnwelton@gmail.com <davidnwelton@gmail.com> wrote:

> Hi,
>
> Two questions:
>
> Google seems to indicate that IIS does not have a DOCUMENT_ROOT
> equivalent. Is that indeed true? Are there workarounds besides
> manually adding that environmental variable (which is kind of out of
> the question in this case...)?
>
> My problem is that I need to know that information so that I can do
> some local file system operations via a CGI.


Environment variables available to perl include: PATH_TRANSLATED - which
probably gives you sufficient info to calc the root.

> One other way of getting
> that information is by telling users to locate the CGI in the document
> root. Is that bad practice in IIS? I know that in Apache you probably
> wouldn't want to do that...you'd put your CGI in a cgi-bin directory.


IIS doesn't have the concept of a cgi-bin, although many programmers
create one, it isn't necessary - you can place your scripts wherever is
most convenient/logical in the context of your app.

I know of no reason why it would be bad practice to place perl scripts in
the site root.

--
William Tasso
  Réponse avec citation
Vieux 31/08/2005, 13h52   #3
Alan J. Flavell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: DOCUMENT_ROOT in IIS - IIS CGI locations?

On Wed, 31 Aug 2005, William Tasso wrote:

> IIS doesn't have the concept of a cgi-bin, although many programmers
> create one, it isn't necessary - you can place your scripts wherever
> is most convenient/logical in the context of your app.


Just for the record, you /can/ do the same with Apache if you want to.

> I know of no reason why it would be bad practice to place perl
> scripts in the site root.


In Apache, if you're not careful when you do this, it's possible
to accidentally serve-out the source code of your script instead of
executing it. That could be rather interesting to an intruder...

The benefit of having a script-aliased directory in Apache (of which
"cgi-bin" is the archetypical example), is that whatever you put in
there, Apache will try to execute it: if it is a script, then that
should be successful; if, for some reason, it's not a script, then
there will be an error reported; but the file contents will never be
served out as source code, from such a directory. This can be a
useful security measure.

But there's no need to follow that plan in Apache if you don't wish
to.

I don't know IIS myself, so I couldn't say whether it would be
possible to do anything similar with it.

best

  Réponse avec citation
Vieux 06/09/2005, 00h16   #4
William Tasso
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: DOCUMENT_ROOT in IIS - IIS CGI locations?

Alan J. Flavell <flavell@ph.gla.ac.uk> wrote:

> On Wed, 31 Aug 2005, William Tasso wrote:
>
>> IIS doesn't have the concept of a cgi-bin, although many programmers
>> create one, it isn't necessary - you can place your scripts wherever
>> is most convenient/logical in the context of your app.

>
> Just for the record, you /can/ do the same with Apache if you want to.


Aha - thanks for the note - didn't know that, but that does make sense.

>> I know of no reason why it would be bad practice to place perl
>> scripts in the site root.

>
> In Apache, if you're not careful when you do this, it's possible
> to accidentally serve-out the source code of your script instead of
> executing it. That could be rather interesting to an intruder...


Aye, and that behaviour is indeed possible with IIS - but hard to achieve
accidently. File types (extention name) are mapped to processes (either
at server or site level) so any undesired behaviour should be discovered
at configuration time.

> The benefit of having a script-aliased directory in Apache (of which
> "cgi-bin" is the archetypical example), is that whatever you put in
> there, Apache will try to execute it: if it is a script, then that
> should be successful; if, for some reason, it's not a script, then
> there will be an error reported; but the file contents will never be
> served out as source code, from such a directory. This can be a
> useful security measure.


Understood.

> But there's no need to follow that plan in Apache if you don't wish
> to.
>
> I don't know IIS myself, so I couldn't say whether it would be
> possible to do anything similar with it.


I've never tried, but it is possible to set directory security such that
files can only be executed by the IIS anonymous user, rather than read.

--
William Tasso
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h23.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10915 seconds with 12 queries