dsccommunity / WebAdministrationDsc

This module contains DSC resources for deploying and configuring web servers and related components.
MIT License
162 stars 149 forks source link

xlisModule Uses wrong configuration key/value pairs when adding handler config #305

Open andy1547 opened 7 years ago

andy1547 commented 7 years ago

I'm using Windows Server 2012 R2 64Bit. I noticed that after the first successful run of the resource I was getting this error: _[[xIisModule]PHPModuleMapping] Adding fastCgi. Filename: Error: Cannot add duplicate collection entry of type 'application' with combined key attributes 'fullPath, arguments' respectively set to 'C:\PHP\php-cgi.exe, '

The cause of that error is that the handler mapping gets incorrectly added as a managed handler, instead of a module mapping due to a missing Module key/value pair. Renaming the 'Module' key to 'Modules' fixed the issue.

Current Hashtable used by Add-webconfiguration /system.webServer/handlers iis:\ for adding handler: @{ Name = $Name Path = $RequestPath Verb = $Verb -join ',' Module = $ModuleType ScriptProcessor = $Path } Producing this xml in applicationHost.config <add name="PHP-FastCGI" path="*.php" verb="*" scriptProcessor="C:\PHP\php-cgi.exe" />

It should be: @{ Name = $Name Path = $RequestPath Verb = $Verb -join ',' Modules = $ModuleType ScriptProcessor = $Path ResourceType = 'File' } Resulting in <add name="PHP-FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe" resourceType="File" />

Happy to submit a PR.

Devvox93 commented 7 years ago

Pull request for this is reviewed and approved.

johlju commented 6 years ago

@Devvox93 I can't you find a PR from you, either open or closed. You never sent in a PR? 🙂

Devvox93 commented 6 years ago

@johlju I actually meant PR #308. But seeing your latest comment there I will be implementing what I suggested. So no PR yet as I've been busy with other work, but in a few days I'll be able to implement as I suggested in #308 and create a new PR with a mention of this issue. :)

johlju commented 6 years ago

@Devvox93 awesome! I will help you getting it reviewed and merged.

Devvox93 commented 6 years ago

Thanks for taking this up @scottmckenzie. I've been crazy busy and it totally slipped my mind :/ Apologies to @johlju also

johlju commented 6 years ago

Yes, @scottmckenzie is doing a great job!

No worries @Devvox93, no need to apologize. We all are very busy 🙂