# Web Server Lokal — Troubleshooting Notes

## Working Setup (Juli 2026)

**Python HTTP server** di port 8080 — works perfectly untuk serve folder + auto-index.

```bash
cd /home/ubuntu/kantor
python3 -m http.server 8080
```

**Akses:**
- Lokal: `http://10.11.20.117:8080`
- Public: `http://43.157.206.165:8080`

## Why Not Caddy (Port 80)

Caddy sudah jalan di port 80, tapi:
1. **Auto-index bermasalah** — folder yang di-config sebagai sub-route (`handle /kantor/*`) tidak bisa auto-index dengan benar (403/blank).
2. **Root permission** — Caddy tidak bisa akses `/home/ubuntu` karena permission `drwx------`.
3. **Reload failure** — `caddy reload` gagal karena admin API tidak jalan.

Fix attempt: chmod `o+rx` ke `/home/ubuntu` dan `/home/ubuntu/kantor` + config `file_server { precompressed }` — masih ada issue route. Tidak worth waktu.

## Quick Fix for Caddy Issues

Jika suatu hari ingin pakai Caddy lagi:
1. `chmod o+rx /home/ubuntu` (minimal agar Caddy bisa traverse)
2. `chmod -R o+rX /home/ubuntu/kantor` (read untuk semua file)
3. Config: root `* /home/ubuntu/kantor`, `file_server`, NO sub-route untuk auto-index work

## File Locations
- Web root: `/home/ubuntu/kantor/`
- Index HTML kustom: `/home/ubuntu/kantor/index.html` (mobile-friendly, hijau-emas theme)
- Sub-folder yang di-serve: `chatbot_whatsapp_2026/` (20 chart PNG + laporan DOCX)
- BKD files: `BKD_Sosialisasi/Materi Sosialisasi 2024/` (19 file)
- DOHI files: `DOHI_IOHI/` (IOHI 2014 PDF)

## Mobile-Friendly Index
`/home/ubuntu/kantor/index.html` — static file list dengan 2 folder card (Kantor + Analisis Chatbot).
Diklik langsung → download/view file. Folder `chatbot_whatsapp_2026/` accessible langsung via URL `/chatbot_whatsapp_2026/`.
