Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved example Sample_xWebsite_StopDefault out from README.md #499

Merged
merged 5 commits into from
Oct 2, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
- Changes to Examples
- Created new folder structure for examples so that examples will be
placed in `/Examples/Resources/$resourceName` ([issue #483](https://github.com/PowerShell/xWebAdministration/issues/483))
- Moved examples out of Readme
- Moved examples from Readme.md to respective `/Examples/Resources/` folders. ([issue #486](https://github.com/PowerShell/xWebAdministration/issues/486))

## 2.8.0.0

Expand Down
34 changes: 34 additions & 0 deletions Examples/Resources/xWebSite/Sample_xWebsite_StopDefault.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<#
.SYNOPSIS
When configuring a new IIS server, several references recommend removing or stopping the default website for security purposes.
This example sets up your IIS web server by installing IIS Windows Feature.
After that, it will stop the default website by setting `State = Stopped`.
#>
Configuration Sample_xWebsite_StopDefault
{
param
(
# Target nodes to apply the configuration
[string[]]$NodeName = 'localhost'
)
# Import the module that defines custom resources
Import-DscResource -Module xWebAdministration
Node $NodeName
{
# Install the IIS role
WindowsFeature IIS
{
Ensure = "Present"
Name = "Web-Server"
}
# Stop the default website
xWebsite DefaultSite
{
Ensure = "Present"
Name = "Default Web Site"
State = "Stopped"
PhysicalPath = "C:\inetpub\wwwroot"
DependsOn = "[WindowsFeature]IIS"
}
}
}
37 changes: 0 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,43 +498,6 @@ xPhp -PackageFolder "C:\packages" `
-installMySqlExt $false
```

## Stopping the default website

When configuring a new IIS server, several references recommend removing or stopping the default website for security purposes.
This example sets up your IIS web server by installing IIS Windows Feature.
After that, it will stop the default website by setting `State = Stopped`.

```powershell
Configuration Sample_xWebsite_StopDefault
{
param
(
# Target nodes to apply the configuration
[string[]]$NodeName = 'localhost'
)
# Import the module that defines custom resources
Import-DscResource -Module xWebAdministration
Node $NodeName
{
# Install the IIS role
WindowsFeature IIS
{
Ensure = "Present"
Name = "Web-Server"
}
# Stop the default website
xWebsite DefaultSite
{
Ensure = "Present"
Name = "Default Web Site"
State = "Stopped"
PhysicalPath = "C:\inetpub\wwwroot"
DependsOn = "[WindowsFeature]IIS"
}
}
}
```

### Create a new website

While setting up IIS and stopping the default website is interesting, it isn’t quite useful yet.
Expand Down