LiarGame AI — Windows Server 2016 / IIS 10 배포 매뉴얼
옵시디언에서 가독성 좋게 보이도록 헤더 구조 / 표 / 코드블록 / 체크리스트 / 콜아웃을 적용해서 정리해봤어.
(그대로 .md 파일에 붙여넣으면 바로 쓰기 좋게 구성함)
LiarGame AI — Windows Server 2016 / IIS 10 배포 메뉴얼
도메인:
liargame.kimkitty.net
대상 환경: Windows Server 2016 + IIS 10
📚 목차
- [[#1. 사전 요구사항 확인]]
- [[#2. IIS 기능 설치]]
- [[#3. httpPlatformHandler 설치]]
- [[#4. Node.js 설치]]
- [[#5. 소스코드 준비 (빌드)]]
- [[#6. 배포 디렉토리 구성]]
- [[#7. IIS 사이트 구성]]
- [[#8. 환경변수 / web.config 설정]]
- [[#9. DNS 및 도메인 설정]]
- [[#10. 방화벽 / 포트 설정]]
- [[#11. HTTPS 설정]]
- [[#12. 서비스 시작 및 헬스체크]]
- [[#13. 자동 배포]]
- [[#14. 트러블슈팅]]
- [[#15. 배포 체크리스트]]
1. 사전 요구사항 확인
🖥 서버 스펙
| 항목 | 최소 | 권장 |
|---|---|---|
| OS | Windows Server 2016 | Windows Server 2016 |
| CPU | 2코어 | 4코어 |
| RAM | 2GB | 4GB |
| 디스크 | 5GB | 10GB+ |
| .NET | 4.6.1+ | 4.7.2+ |
📦 필요 소프트웨어
- IIS 10
- WebSocket Protocol (필수)
- httpPlatformHandler v1.2
- Node.js v18+ (권장 v20)
- Git
🔐 관리자 권한 확인
whoami /groups | findstr "S-1-5-32-544"
2. IIS 기능 설치
⚡ PowerShell (권장)
Install-WindowsFeature -Name Web-Server,
Web-Common-Http,
Web-Default-Doc,
Web-Static-Content,
Web-Http-Logging,
Web-Stat-Compression,
Web-Dyn-Compression,
Web-Security,
Web-Filtering,
Web-Net-Ext45,
Web-Asp-Net45,
Web-ISAPI-Ext,
Web-ISAPI-Filter,
Web-WebSockets,
Web-Mgmt-Console,
Web-Mgmt-Tools `
-IncludeManagementTools
[!important]
Web-WebSockets는 Socket.IO 필수 요소
✅ 설치 확인
Get-WindowsFeature Web-WebSockets
3. httpPlatformHandler 설치
📥 설치
msiexec /i httpPlatformHandler_amd64.msi /quiet /norestart
✅ 확인
Get-WebConfiguration system.webServer/globalModules/* |
Where-Object { $_.name -like "*Platform*" }
4. Node.js 설치
설치 확인
node --version npm --version
🔐 권한 설정
$nodePath = "C:\Program Files\nodejs"
$acl = Get-Acl $nodePath
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
"IIS AppPool\liargame-ai-pool", "ReadAndExecute",
"ContainerInherit,ObjectInherit", "None", "Allow"
)
$acl.SetAccessRule($rule)
Set-Acl $nodePath $acl
5. 소스코드 준비 (빌드)
📦 빌드
npm ci npm run build
📁 결과 구조
.next/ standalone/ static/ dist/ server/index.js public/ iis/web.config
📤 배포 패키지 생성
Copy-Item .next\standalone\* $pkg -Recurse Copy-Item dist $pkg -Recurse Copy-Item public $pkg -Recurse
6. 배포 디렉토리 구성
C:\inetpub\liargame-ai ├─ .next ├─ dist ├─ public ├─ logs └─ web.config
🔐 logs 권한
"IIS AppPool\liargame-ai-pool" → Modify
7. IIS 사이트 구성
7-1. 앱풀 생성
New-WebAppPool -Name "liargame-ai-pool"
7-2. 사이트 생성
New-Website -Name "liargame-ai" `
-PhysicalPath "C:\inetpub\liargame-ai" `
-Port 80
8. 환경변수 / web.config 설정
<httpPlatform processPath="node.exe"
arguments="dist\server\index.js"
stdoutLogEnabled="true"
stdoutLogFile="logs\node.log">
<environmentVariables>
<environmentVariable name="PORT" value="%HTTP_PLATFORM_PORT%" />
<environmentVariable name="NODE_ENV" value="production" />
</environmentVariables>
</httpPlatform>
<webSocket enabled="true" />
[!warning]
API Key는 Git에 절대 포함하지 말 것
9. DNS 및 도메인 설정
🌐 A 레코드
| 타입 | 이름 | 값 |
|---|---|---|
| A | liargame | 서버 IP |
확인
nslookup liargame.kimkitty.net
10. 방화벽 설정
New-NetFirewallRule -DisplayName "LiarGame AI HTTP" `
-Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow
New-NetFirewallRule -DisplayName "LiarGame AI HTTPS" `
-Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow
11. HTTPS 설정
🔐 Let’s Encrypt (win-acme)
.\wacs.exe --target manual `
--host liargame.kimkitty.net `
--installation iis
🔁 HTTPS 리다이렉트
<rewrite>
<rules>
<rule name="HTTP to HTTPS">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect"
url="https://{HTTP_HOST}/{R:1}"
redirectType="Permanent" />
</rule>
</rules>
</rewrite>
12. 서비스 시작 및 헬스체크
Start-WebAppPool -Name "liargame-ai-pool" Start-Website -Name "liargame-ai"
📡 테스트
Invoke-WebRequest http://liargame.kimkitty.net
📄 로그 확인
Get-Content logs\node.log -Tail 50
13. 자동 배포
.\iis\deploy.ps1
14. 트러블슈팅
❌ 503 오류
node dist\server\index.js
❌ WebSocket 실패
Install-WindowsFeature Web-WebSockets iisreset
❌ 포트 충돌
netstat -ano | findstr ":80"
15. 배포 체크리스트
- IIS 설치
- WebSocket 활성화
- Node.js 설치
- 빌드 완료
- 파일 배포
- web.config 설정
- 앱풀 생성
- 사이트 생성
- DNS 연결
- HTTPS 적용
- 방화벽 설정
- 정상 접속 확인
✅ 최종 접속
👉 https://liargame.kimkitty.net
원하면
👉 “더 실무형 (운영용 Runbook 스타일)”
👉 “초보자용 단계별 버전”
같이 버전 나눠서 더 다듬어줄 수도 있어 👍
