Prepares a clean Windows Server Core for use as a Frontend Server.
IIS
, FTP Server
, ASP.NET
, git
, winacme
, MongoDB
- Websites go
C:\www\
- MongoDB Data go
C:\Data\
- Modules are installed with git clone
Install-PackageProvider Nuget -Force
Install-Module -Name PowerShellGet -Force
Install-Script -Name Install-Git -Force
& 'C:\Program Files\WindowsPowerShell\Scripts\Install-Git.ps1'
& 'C:\Program Files\Git\bin\git.exe' clone https://github.com/Lamerchun/Powershell "$([Environment]::GetFolderPath("User"))\Documents\WindowsPowerShell\Modules\Tools"
Rename-Server -ComputerName ComputerName -WorkGroup WorkgroupName
Initialize-Server
Install-Features
Restart-Computer -Force
Will configure IIS with defaults. Creates a ftp user with full rights to your website's root.
Install-FrontendServer
New-FtpUser -Name Username -Password Password -PhysicalPath C:\www
Use these commands to setup websites as you need. Bindings will add http with port 80.
- New-WebSite -AppPoolName AppPoolName -SiteName WebsiteName -Host Hostname
- New-WebSite -AppPoolName AppPoolName -SiteName WebsiteName -Host Hostname -FolderName FolderName
- New-WebSiteBinding -SiteName WebsiteName -HostName Hostname
Will be issued with letsencrypt. Wacs will automatically renew for you.
New-SslCertificate -Email abuse@domain.com -HostName site.domain.com --PhysicalPath C:\www\Website
MongoDB will be installed with cacheSizeGB: 2
.
Install-Mongo -AdminUserName admin -AdminUserPassword PW_XqKwDf9hhT -Port 27017
Read-MongoLog
If you really need to expose MongoDB to public internet.
New-MongoFirewallRule -Port 27017