cgi pages not working from local IIS

1

I recently had my computer reimaged and reinstalled everything. Everything works except that from my localhost, if i browse a cgi page it throws

HTTP Error 500.0 - Internal Server Error The page cannot be displayed because an internal server error has occurred.

Module CgiModule

Notification ExecuteRequestHandler

Handler Perl script

Error Code 0x800700c1

Requested URL localhost:80/website1/index.cgi

Logon Method NTLM

I have Windows authentication enabled and everything else disabled. My ISAPI and CGI restriction shows everything is allowed. My Handler Mappings (at machine level) has *.cgi enabled with CGIModule (which runs \inetsrv\cgi.dll which exists). I dont know what else to check. Please advise.

Any idea how to correct/debug this? I have IIS 7.5 on windows 7.

perl
iis
iis-7.5
asked on Stack Overflow Jul 10, 2015 by Jap Evans

1 Answer

0

Finally this is what i did

  • Uninstall Perl if you have it installed already. (We will reinstall after we install IIS). Delete c:Perl if you have. Importantly, make a copy before you do.
  • Uninstall IIS if you have it installed already. (We will reinstall). Delete c:inetpub and c:\Windows\system32inetsrv. Make a copy before you do, just in case.
  • After uninstalling through control panel, execute the following uninstall command also for clean uninstall

    start /w pkgmgr /uu:IIS-WebServerRole;IIS-WebServerManagementTools;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-ASPNET;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-NetFxExtensibility;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-HttpTracing;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-Performance;IIS-HttpCompressionStatic;IIS-Security;IIS-RequestFiltering;IIS-WindowsAuthentication;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI

  • Restart the machine

  • Install IIS. Make sure to install CGI part in IIS before installing perl

  • Check if everything in IIS (other than CGI) works. You may have to register aspnet after IIS install.

    %windir%Microsoft.NETFramework64v4.0.30319aspnet_regiis.exe -i

  • Install Perl. When clicking Next, you should see a screen for 'Choose Setup Options' and have options like a) Add perl to the PATH environment variable b) Create .plx script mapping for perl ISAPI, c) create .pl script mapping for PERL etc. Check all of those options

  • Compare your backed up perl location and the new location (C:\Perl). Copy any missing files

  • Create application pool and virtual directory in IIS. In application pool, "Enable 32 bit application"

  • Add ISAPI and CGI restrictions in IIS. Do the following from command prompt.

    c:\Windows\System32\inetsrv>appcmd set config /section:isapiCgiRestriction /+"[path='C:perlbinperl.exe "%s %s"',description='Perl',allowed='True']"

answered on Stack Overflow Jul 21, 2015 by Jap Evans

User contributions licensed under CC BY-SA 3.0