Skip to content

Instantly share code, notes, and snippets.

@allexiusw
Created February 27, 2020 17:39
Show Gist options
  • Save allexiusw/01303e89474454377dddded7521d2bee to your computer and use it in GitHub Desktop.
Save allexiusw/01303e89474454377dddded7521d2bee to your computer and use it in GitHub Desktop.
In this gist we install IIS Role and create 2 sites running in 8080 and 8888 ports.
Install-WindowsFeature Web-Server -IncludeManagementTools
Install-Module -Name 'IISAdministration'
Get-IISSite
mkdir C:\site1
echo "<h1>Sitio 1</h1>" > C:\site1\index.html
New-IISSite -Name 'Site 1' -PhysicalPath 'C:\site1\' -BindingInformation "*:8080:"
New-NetFirewallRule -Name http1 -DisplayName 'HTTP1 Allows IIS (8080)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 8080
Get-IISSite
mkdir C:\site2
echo "<h1>Sitio 2</h1>" > C:\site2\index.html
New-IISSite -Name 'Site 2' -PhysicalPath 'C:\site2\' -BindingInformation "*:8888:"
New-NetFirewallRule -Name http2 -DisplayName 'HTTP2 Allows IIS (8888)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 8888
Get-IISSite
Write-Host "Ingresar a la IP de su servidor y a los puertos 80, 8080 y 8888 donde estan corriendo los 3 sitios configurados"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment