Re: CGI Scripts

From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 06/03/04

  • Next message: Dmitry Kulshitsky: "RE: Redirect to virtual directory"
    Date: Wed, 2 Jun 2004 20:51:20 -0700
    
    

    > HELP! I have a cgi script that executes fine if you
    > call it through a URL on every machine... except
    > one customer site where it prompts to be
    > downloaded. The facts:

    A URL is either downloadable or executes on the server. If you configure
    the URL to have "Scripts and Executables" execution permission, all URLs
    which have application mappings (like .ASP, .ASPX, .PL, etc) are executed as
    script by their respective script engines, and all URLs that are .COM, .EXE,
    .CGI, .ISA, .DLL are executed as binaries.

    If you make a request to the CGI script and you get the download dialog,
    either:
    1. The CGI script executed on the server and sent back a response that
    causes the browser to pop up the download dialog (which may or may not be
    the right thing -- depends on what your CGI script is doing)
    2. The CGI script did not execute on the server -- if the CGI script is
    scriptmapped, like .PL , then you have an effective execution permission of
    "None" on that URL. If the CGI script is an executable, like .EXE , then
    you doe not have execution permissions of "Scripts and Executables" on that
    URL.
    3. Something else is running on the server and modifying its behavior to be
    inconsistent... such as an ISAPI Filter that rewrites the URL/PhysicalPath
    such that scripts are sent as static files, or static files fail to be
    executed as script and thus sent as-is.

    > - I have been told that IIS will try and execute a
    > script first, then if unsuccessful, it will prompt you
    > to download it. If it runs on all other machines i
    > see no reason why it can't on this site.

    Whoever told you this is incorrect. For a given URL, IIS will EITHER allow
    it to be downloaded OR execute it as a script (or executable) on the server.
    IIS will NEVER do both. Custom Code on IIS may implement that behavior, but
    not IIS.

    Based on your description, I think that this customer probably has an ISAPI
    Filter that needs to be fixed.

    -- 
    //David
    IIS
    This posting is provided "AS IS" with no warranties, and confers no rights.
    //
    "Luke Openshaw" <luke@wakethegimp.org> wrote in message
    news:16d1901c4483e$0ddd36b0$a501280a@phx.gbl...
    HELP!  I have a cgi script that executes fine if you call
    it through a URL on every machine... except one customer
    site where it prompts to be downloaded.  The facts:
    - cgi script is sitting in cgi-bin directory with execute
    permissions
    - i have checked permissions EVERYWHERE.  I can't
    replicate the issue outside of their environment no
    matter how much fiddling with permissions i do, so i dont
    think this is the issue.
    - I have been told that IIS will try and execute a script
    first, then if unsuccessful, it will prompt you to
    download it.  If it runs on all other machines i see no
    reason why it can't on this site.
    - You can pingtest the script successfully.
    - It happens on more than one machine at this site
    - It is not Windows security updates.  I have checked
    - I have trawled google and rinsed the IIS management
    console for a solution but cannot find one.
    - at this stage i am waiting for the customer to test the
    url with a ? on the end to see if we can force
    execution.  this still will not answer the question as to
    why this is the only site on which this occurs.
    any help, suggestions, points in vaguely the right
    direction would be appreciated.
    cheers,
    Luke Openshaw
    

  • Next message: Dmitry Kulshitsky: "RE: Redirect to virtual directory"
    Loading