- Notifications
You must be signed in to change notification settings - Fork148
This module contains DSC resources for deploying and configuring web servers and related components.
License
dsccommunity/WebAdministrationDsc
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This module contains DSC resources for the management and configuration of Microsoft Internet Information Services (IIS).
This project has adopted thisCode of Conduct.
For each merge to the branchmain
a preview release will bedeployed toPowerShell Gallery.Periodically a release version tag will be pushed which will deploy afull release toPowerShell Gallery.
Please check out common DSC Communitycontributing guidelines.
A full list of changes in each version can be found in thechange log.
The documentation can be found in theWebAdministration Wiki.The DSC resources schema files is used to automatically update thedocumentation on each PR merge.
You can review theExamples directory in the WebAdministration modulefor some general use scenarios for all of the resources that are in the module.
The resource examples are also available in theWebAdministration Wiki.
When configuring an IIS Application that uses PHP, you first need to register the PHP CGI module with IIS.The followingxPhp configuration downloads and installs the prerequisites for PHP, downloads PHP, registers the PHP CGI module with IIS and sets the system environment variable that PHP needs to run.
Note: This example is intended to be used as a composite resource, so it does not use Configuration Data.Please see theComposite Configuration Blog on how to use this configuration in another configuration.
# Composite configuration to install the IIS pre-requisites for PHPConfigurationIisPreReqs_php{param ( [Parameter(Mandatory=$true)] [Validateset("Present","Absent")] [String]$Ensure )foreach ($Featurein@("Web-Server","Web-Mgmt-Tools","web-Default-Doc",`"Web-Dir-Browsing","Web-Http-Errors","Web-Static-Content",`"Web-Http-Logging","web-Stat-Compression","web-Filtering",`"web-CGI","web-ISAPI-Ext","web-ISAPI-Filter")) { WindowsFeature"$Feature$Number" { Ensure=$Ensure Name=$Feature } }}# Composite configuration to install PHP on IISconfigurationxPhp{param ( [Parameter(Mandatory=$true)] [switch]$installMySqlExt, [Parameter(Mandatory=$true)] [string]$PackageFolder, [Parameter(Mandatory=$true)] [string]$DownloadUri, [Parameter(Mandatory=$true)] [string]$Vc2012RedistDownloadUri, [Parameter(Mandatory=$true)] [String]$DestinationPath, [Parameter(Mandatory=$true)] [string]$ConfigurationPath )# Make sure the IIS Prerequisites for PHP are present IisPreReqs_php Iis { Ensure="Present"# Removed because this dependency does not work in# Windows Server 2012 R2 and below# This should work in WMF v5 and above# DependsOn = "[File]PackagesFolder" }# Download and install Visual C Redist2012 from chocolatey.org Package vcRedist { Path=$Vc2012RedistDownloadUri ProductId="{CF2BEA3C-26EA-32F8-AA9B-331F7E34BA97}" Name="Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.61030" Arguments="/install /passive /norestart" }$phpZip=Join-Path$PackageFolder"php.zip"# Make sure the PHP archine is in the package folder xRemoteFile phpArchive { uri=$DownloadURI DestinationPath=$phpZip }# Make sure the content of the PHP archine are in the PHP path Archive php { Path=$phpZip Destination=$DestinationPath }if ($installMySqlExt ) {# Make sure the MySql extention for PHP is in the main PHP path File phpMySqlExt { SourcePath="$($DestinationPath)\ext\php_mysql.dll" DestinationPath="$($DestinationPath)\php_mysql.dll" Ensure="Present" DependsOn=@("[Archive]PHP") MatchSource=$true } }# Make sure the php.ini is in the Php folder File PhpIni { SourcePath=$ConfigurationPath DestinationPath="$($DestinationPath)\php.ini" DependsOn=@("[Archive]PHP") MatchSource=$true }# Make sure the php cgi module is registered with IIS IisModule phpHandler { Name="phpFastCgi" Path="$($DestinationPath)\php-cgi.exe" RequestPath="*.php" Verb="*" Ensure="Present" DependsOn=@("[Package]vcRedist","[File]PhpIni")# Removed because this dependency does not work in# Windows Server 2012 R2 and below# This should work in WMF v5 and above# "[IisPreReqs_php]Iis" }# Make sure the php binary folder is in the path Environment PathPhp { Name="Path" Value=";$($DestinationPath)" Ensure="Present" Path=$true DependsOn="[Archive]PHP" }}xPhp-PackageFolder"C:\packages"`-DownloadUri-DownloadUri"http://windows.php.net/downloads/releases/php-5.5.13-Win32-VC11-x64.zip"`-Vc2012RedistDownloadUri"http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe"`-DestinationPath"C:\php"`-ConfigurationPath"C:\MyPhp.ini"`-installMySqlExt$false
To manually install the module, download the source code from GitHub and unzipthe contents to the '$env:ProgramFiles\WindowsPowerShell\Modules' folder.
To install from the PowerShell gallery using PowerShellGet (in PowerShell 5.0)run the following command:
Find-Module-Name WebAdministrationDsc|Install-Module
To confirm installation, run the below command and ensure you see theDSC resources available:
Get-DscResource-Module WebAdministrationDsc
The minimum Windows Management Framework (PowerShell) version required is4.0 or higher.
Note: In the CI pipeline the resource are only tested on PowerShell 5.1,so PowerShell 4.0 support is best effort as this time.
About
This module contains DSC resources for deploying and configuring web servers and related components.
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.