Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

IIS 10 handler mappings has to add remove on whitespace to enable ISAPI extensio restriction

$
0
0
<div class="vote">0down votefavorite<div class="favoritecount"></div></div> <div> <div class="post-text" itemprop="text">

I use batch to add IIS 10 handler mappings and enable ISAPI extension with following script. But there is one thing so strange, after configured that, it could not work, until I double click CGI-cig to add a whitespace either at the at of Request Path or Executable, then click OK. It will prompted "Do you want to allow this ISAPI extension? Click "Yes" to add the extension with an "Allowed" entry to the ISAPI and CGI Restrictions list or to update an existing extension entry to "Allowed" in the ISAPI and CGI Restriction list". I clicked Ok, then it works. While in my script, the last three lines did that exactly as this manual step. So strange, why?

Note: I have installed the following modules

Dism   /Online /Enable-Feature /FeatureName:IIS-DefaultDocument /All
Dism   /Online /Enable-Feature /FeatureName:IIS-FTPSvc /All
Dism   /Online /Enable-Feature /FeatureName:IIS-Metabase /All
Dism   /Online /Enable-Feature /FeatureName:IIS-IIS6ManagementCompatibility /All
Dism   /Online /Enable-Feature /FeatureName:IIS-ManagementConsole /All
DISM   /Online /Enable-Feature /FeatureName:netfx3 /All
Dism   /Online /Enable-Feature /FeatureName:IIS-NetFxExtensibility /All
Dism   /Online /Enable-Feature /FeatureName:IIS-NetFxExtensibility45 /All
Dism   /Online /Enable-Feature /FeatureName:IIS-ASP /All
Dism   /Online /Enable-Feature /FeatureName:IIS-ASPNET /All
Dism   /Online /Enable-Feature /FeatureName:IIS-ASPNET45 /All
Dism   /Online /Enable-Feature /FeatureName:IIS-CGI /All
Dism   /Online /Enable-Feature /FeatureName:IIS-ISAPIExtensions /All
Dism   /Online /Enable-Feature /FeatureName:IIS-ISAPIFilter /All
Dism   /Online /Enable-Feature /FeatureName:IIS-DirectoryBrowsing /All
Dism   /Online /Enable-Feature /FeatureName:IIS-HttpErrors /All
Dism   /Online /Enable-Feature /FeatureName:IIS-StaticContent /All
Dism   /Online /Enable-Feature /FeatureName:IIS-HttpLogging /All
Dism   /Online /Enable-Feature /FeatureName:IIS-RequestMonitor /All
Dism   /Online /Enable-Feature /FeatureName:IIS-BasicAuthentication /All
Dism   /Online /Enable-Feature /FeatureName:IIS-RequestFiltering /All


c:\windows\system32\inetsrv\appcmd.exe set config "Default Web Site/" /section:handlers /-[name='CGI_cgi']

c:\windows\system32\inetsrv\appcmd.exe set config "Default Web Site/" /section:handlers /+"[name='CGI_cgi',path='*.cgi',verb='GET,HEAD,POST,DEBUG,PUT,DELETE',modules='cgiModule',scriptProcessor='C:\Ruby193\bin\ruby.exe %u0022%s%u0022',resourceType='File',requireAccess='Script']"

c:\windows\system32\inetsrv\appcmd.exe set config "Default Web Site/" /section:handlers /-[name='CGI_rb']

c:\windows\system32\inetsrv\appcmd.exe set config "Default Web Site/" /section:handlers /+"[name='CGI_rb',path='*.rb',verb='GET,HEAD,POST,DEBUG,PUT,DELETE',modules='cgiModule',scriptProcessor='C:\Ruby193\bin\ruby.exe %u0022%s%u0022',resourceType='File',requireAccess='Script']"

c:\windows\system32\inetsrv\appcmd.exe set  config /section:isapiCgiRestriction /-"[path='C:\Ruby193\bin\ruby.exe %u0022%s%u0022']"

c:\windows\system32\inetsrv\appcmd.exe set  config /section:isapiCgiRestriction /+"[path='C:\Ruby193\bin\ruby.exe %u0022%s%u0022',allowed='True']" /commit:apphost

c:\windows\system32\inetsrv\appcmd.exe list config /section:isapiCgiRestriction
<div class="post-taglist">Can anyone tell me how to deal with this issue? Thank you!</div>

</div></div>

Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>