Win-acme: Detect lock state of the <handlers> section

Created on 10 Sep 2017  路  4Comments  路  Source: win-acme/win-acme

Upgraded from v1.9.3 to Latest release v1.9.4.3
https://github.com/Lone-Coder/letsencrypt-win-simple/releases

IIS Detailed Error Information:
Config Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
Config File: \\?\C:\inetpub\wwwroot\.well-known\acme-challenge\web.config
Requested URL: http://example.com:80/.well-known/acme-challenge/CU_fyzbSrf5rzly0BZo1VMBH 0mPBjeYv9F8DrNnvb3w
Config source: <handlers>

Couldn't find any obvious solution at:
https://github.com/Lone-Coder/letsencrypt-win-simple/wiki/web.config
https://github.com/Lone-Coder/letsencrypt-win-simple/wiki/IIS-answer-file-issues

IIS seems to "Fly off the handle" with the new handler section introduced recently:
https://github.com/Lone-Coder/letsencrypt-win-simple/blame/master/letsencrypt-win-simple/Web_Config.xml

Is this simply an unintended regression or have the "system requirements" changed?
Previous web.config worked fine.

Have tested with Windows Server 2012 R2 (IIS 8.5), with basic features installed including Classic ASP with Client-Side/Server-Side Debugging and Send Errors to Browser enabled for troubleshooting:
https://jwcooney.com/2013/12/30/enabling-classic-asp-on-iis8-windows-server-2012/

PS> Get-WindowsFeature -Name Web* | Where Installed

Display Name                                            Name                       Install State
------------                                            ----                       -------------
[X] Web Server (IIS)                                    Web-Server                     Installed
    [X] Web Server                                      Web-WebServer                  Installed
        [X] Common HTTP Features                        Web-Common-Http                Installed
            [X] Default Document                        Web-Default-Doc                Installed
            [X] Directory Browsing                      Web-Dir-Browsing               Installed
            [X] HTTP Errors                             Web-Http-Errors                Installed
            [X] Static Content                          Web-Static-Content             Installed
            [X] HTTP Redirection                        Web-Http-Redirect              Installed
        [X] Health and Diagnostics                      Web-Health                     Installed
            [X] HTTP Logging                            Web-Http-Logging               Installed
            [X] Logging Tools                           Web-Log-Libraries              Installed
            [X] Request Monitor                         Web-Request-Monitor            Installed
        [X] Performance                                 Web-Performance                Installed
            [X] Static Content Compression              Web-Stat-Compression           Installed
        [X] Security                                    Web-Security                   Installed
            [X] Request Filtering                       Web-Filtering                  Installed
        [X] Application Development                     Web-App-Dev                    Installed
            [X] ASP                                     Web-ASP                        Installed
            [X] CGI                                     Web-CGI                        Installed
            [X] ISAPI Extensions                        Web-ISAPI-Ext                  Installed
    [X] FTP Server                                      Web-Ftp-Server                 Installed
    [X] Management Tools                                Web-Mgmt-Tools                 Installed
        [X] IIS Management Console                      Web-Mgmt-Console               Installed
        [X] IIS 6 Management Compatibility              Web-Mgmt-Compat                Installed
            [X] IIS 6 Metabase Compatibility            Web-Metabase                   Installed
testing

Most helpful comment

This is 1.9.5.0-beta3!

All 4 comments

Found a temporary workaround:

Check status:
https://stackoverflow.com/questions/14275397/check-if-configuration-section-is-locked-iis-7/29813610#29813610

PS> Get-WebConfigurationLock -PSPath "IIS:\" -Filter //system.webServer/handlers

LockType                      Value                         PSPath                        Location
--------                      -----                         ------                        --------
overrideMode                  Deny                          MACHINE/WEBROOT/APPHOST

Unlock:
https://stackoverflow.com/questions/9794985/iis-this-configuration-section-cannot-be-used-at-this-path-configuration-lock/13752745#13752745

%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/handlers
Unlocked section "system.webServer/handlers" at configuration path "MACHINE/WEBROOT/APPHOST".

Alternatively: Unlock using IIS Manager (GUI)
https://stackoverflow.com/questions/34199976/iis-config-error-this-configuration-section-cannot-be-used-at-this-path/35332431#35332431

More info:
https://blogs.iis.net/webtopics/troubleshooting-http-500-19-errors-in-iis-7 (Scenario 7)

This might be because you have not installed ASP.NET, which unlocks the section. Apparently, that is not a default feature of IIS. I would like to keep the section in because it seems to be the most common issue people have while deploying LEWS, but for the (rare?) cases where people use IIS without ASP.NET, we also cannot cause errors.

I guess that we should detect whether the section is locked and maybe even unlock it in cases where it is.

This is 1.9.5.0-beta3!

Finding this in beta3 made my night... and saved a bunch of work. Can confirm it is fixed for me. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dylanparry picture dylanparry  路  5Comments

Ivn78 picture Ivn78  路  4Comments

carrzkiss picture carrzkiss  路  4Comments

rickster2 picture rickster2  路  3Comments

Trapulo picture Trapulo  路  3Comments