執行 Fluxheim
想快速開一個本機伺服器時用呢頁。設定保持精簡,並會喺開始處理流量前先檢查。
安裝
解壓縮之前,請驗證已發布嘅 SHA-256 校驗和。
Linux x86_64
VERSION="1.8.2"
ARCHIVE="fluxheim-${VERSION}-full-x86_64-linux.tar.gz"
BASE_URL="https://github.com/valkyoth/fluxheim/releases/download/v${VERSION}"
curl -fLO "${BASE_URL}/${ARCHIVE}"
echo "1a323dcd5632e25acf2e4463e549f20cdd3d568f445f9d923b1be312ec7f9839 ${ARCHIVE}" | sha256sum -c -
tar -xzf "$ARCHIVE"
sudo install -m 0755 "fluxheim-${VERSION}-full-x86_64-linux/fluxheim" /usr/local/bin/fluxheim
macOS Apple Silicon
VERSION="1.8.2"
ARCHIVE="fluxheim-${VERSION}-full-aarch64-macos.tar.gz"
BASE_URL="https://github.com/valkyoth/fluxheim/releases/download/v${VERSION}"
curl -fLO "${BASE_URL}/${ARCHIVE}"
echo "a725ebcccac259af6640da57ce12e7a3944c5bd0d9e7869d4001196a0c394031 ${ARCHIVE}" | shasum -a 256 -c -
tar -xzf "$ARCHIVE"
install -d "$HOME/.local/bin"
install -m 0755 "fluxheim-${VERSION}-full-aarch64-macos/fluxheim" "$HOME/.local/bin/fluxheim"
呢個係未簽署嘅命令列預覽版。請保持 Gatekeeper 開啟;目前仲未提供 Developer ID 簽署、公證同 launchd 整合。
Windows x86_64
$Version = "1.8.2"
$Archive = "fluxheim-$Version-full-x86_64-windows.zip"
$BaseUrl = "https://github.com/valkyoth/fluxheim/releases/download/v$Version"
Invoke-WebRequest "$BaseUrl/$Archive" -OutFile $Archive
$Expected = "a72b84720083406f318bf3fc87555eb62fd76dbd1506dbf2cd368e7364726b44"
if ((Get-FileHash $Archive -Algorithm SHA256).Hash.ToLowerInvariant() -cne $Expected) { throw "Archive checksum verification failed" }
Expand-Archive -LiteralPath $Archive -DestinationPath "$env:LOCALAPPDATA\Fluxheim" -Force
呢個係未簽署嘅可攜式預覽版。請保持 SmartScreen 同 PowerShell 保安功能開啟;目前仲未提供 Authenticode 簽署同 Windows 服務安裝程式。
受管理嘅 PHP-FPM 程序監督只適用於 Unix;Windows 支援外部 TCP FastCGI 集區。
最小靜態站點
[server]
listen = ["0.0.0.0:8080"]
default_vhost = "site"
[[vhosts]]
name = "site"
hosts = ["example.com"]
[vhosts.web]
root = "/srv/example"
index_files = ["index.html"]
deny_dotfiles = true
第一個配置的作用是什麼
| 選項 | 用途 |
|---|---|
server.listen | 控制s the plain HTTP socket Fluxheim opens. |
server.default_vhost | 當沒有主機匹配時選擇後備站點。 |
vhosts.hosts | 列出網站接受的主機名稱。 |
vhosts.web.root | 為訪客提供的目錄點。 |
檢查並啟動
fluxheim --config /etc/fluxheim/fluxheim.toml --check-config
fluxheim --config /etc/fluxheim/fluxheim.toml
喺 deployment script 入面做 config check;佢會喺轉移流量之前搵出未知 field、不安全 path、無效 listener 同 feature/config 唔相符。
下一步有用選擇
- 僅在 DNS 指向主機後新增 TLS。
- Add cache only for routes that are safe to share between visitors.
- Add metrics only when the listener is private or behind a trusted proxy.