Home
Operating System
Windows
Linux
Tutorial
Windows Server
About
☰
Host Website Static with Internet Information Services (IIS) Manager
# Install IIS Management Console + WebAdministration module
Add-WindowsFeature Web-Server, Web-Mgmt-Console
✏️ Edit
📋 Copy
Copied!
# Make Folder and The Simple Html
mkdir c:\Website cd c:\website New-Item -Path . -Name "index.html" -ItemType "File" -Value @" <!DOCTYPE html> <html> <body> <h1>Hello World</h1> </body> </html> "@
✏️ Edit
📋 Copy
Copied!
# ( Important ) Import Module WebAdministration
Import-Module WebAdministration
✏️ Edit
📋 Copy
Copied!
# Add new site
New-Item 'IIS:\Sites\test' ` -Bindings @{protocol="http"; bindingInformation="*:80:"} ` -PhysicalPath "C:\website"
✏️ Edit
📋 Copy
Copied!
# Set site to start automatically
Set-ItemProperty 'IIS:\Sites\test' ` -Name serverAutoStart ` -Value $true
✏️ Edit
📋 Copy
Copied!
# Stop Defaul web
Stop-Website -Name "Default Web Site"
✏️ Edit
📋 Copy
Copied!
# Start the site now
Start-WebSite -Name "test"
✏️ Edit
📋 Copy
Copied!
# List all sites
Get-Website
✏️ Edit
📋 Copy
Copied!
# Remove site
Remove-Item 'IIS:\Sites\test'
✏️ Edit
📋 Copy
Copied!
Labels
all
(21 )
autocad
(3 )
css
(2 )
linux
(5 )
op_system
(18 )
website
(4 )
windows
(14 )
windowsServer
(17 )