summaryrefslogtreecommitdiffstats
path: root/web/README.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-30 00:52:25 +0100
committersalmonik <salmonik@tuta.io>2026-10-30 00:52:25 +0100
commit8f8cabeaa533e4f4f8156ff8f4f001f9e4228698 (patch)
tree60f3445ab7a303d7be10bcb45d51a27042fc5e99 /web/README.md
parentadd deploy script with live verification; cache file hashes by size and mtime (diff)
downloadzagan-bet-8f8cabeaa533e4f4f8156ff8f4f001f9e4228698.tar.gz
zagan-bet-8f8cabeaa533e4f4f8156ff8f4f001f9e4228698.zip
add nginx + php-fpm deployment example
Diffstat (limited to 'web/README.md')
-rw-r--r--web/README.md34
1 files changed, 34 insertions, 0 deletions
diff --git a/web/README.md b/web/README.md
index a82c492..e79abd4 100644
--- a/web/README.md
+++ b/web/README.md
@@ -50,6 +50,40 @@ dependency; the client is rustls-only.
50Cargo itself cannot produce these names: it always writes 50Cargo itself cannot produce these names: it always writes
51`target/<triple>/release/<bin>`. The script renames after each build. 51`target/<triple>/release/<bin>`. The script renames after each build.
52 52
53## nginx
54
55`web/nginx.conf.example` is a working server block for a subdomain with an
56existing certificate. On Arch-based systems:
57
58```sh
59sudo pacman -S nginx php-fpm
60sudo install -d -o "$USER" -g http -m 0755 /srv/zagan.bet
61sudo cp web/nginx.conf.example /etc/nginx/conf.d/zagan.bet.conf
62# edit server_name, root and the certificate paths, then:
63sudo nginx -t && sudo systemctl enable --now nginx php-fpm
64```
65
66The pool socket and user are Arch defaults (`http`,
67`/run/php-fpm/php-fpm.sock`). Check them and adjust `fastcgi_pass` if your
68distribution differs:
69
70```sh
71grep -E '^(user|group|listen)' /etc/php/php-fpm.d/www.conf
72```
73
74`rsync` publishes files as `0755`/`0644`, so the `http` worker and the php-fpm
75pool can read them without extra group juggling. `index.php` is the only
76script; any other `.php` request 404s instead of executing.
77
78PHP's opcache is enabled by default and revalidates timestamps every two
79seconds, so a deployed `index.php` takes effect without reloading php-fpm. If
80you ever set `opcache.validate_timestamps=0`, reload php-fpm after a deploy.
81
82The php-fpm unit on Arch uses `PrivateTmp=`, so the hash cache in `/tmp` lives
83in the service's private tmp. It still works; point `ZAGAN_HASH_CACHE` at a
84writable path such as `/var/cache/zagan-bet-hashes.json` if you want it to
85survive a service restart.
86
53## Preview locally 87## Preview locally
54 88
55```sh 89```sh