Paozhu logo Paozhu Docs
Documentation
OPS

Server configuration

The global section of conf/server.conf: ports, paths, HTTP/2 and runtime switches.

A minimal working config

conf/server.confini
[default]
httpport            = 80,8080
httpsport           = 443
ip6_listen_enable   = 1
http2_enable        = 1
global_http2_enable = 1
deamon_enable       = 0
mainhost            = www.example.com
certificate_chain_file = www.example.com.pem
private_key_file       = www.example.com.key
tmp_dh_file            = dh4096.pem
chain_crt_file         = www.example.com.crt

wwwpath             = ./www/default
index               = index.html
directorylist       = 1
usehtmlcache        = 1
usehtmlcachetime    = 3600

session_type        = 1
rate_limit_status   = 0
acme_auto           = 0
ocsp_intv_time      = 14400

Key settings

KeyDefaultMeaning
httpport80Comma-separated port list supported
httpsport443Same
http2_enable1HTTP/2 and ALPN switch
global_http2_enableunsetControls whether virtual sites inherit HTTP/2
cothreadnum6Coroutine worker threads
ioc_thread_num8Max ORM / HTTP io_context count
orm_thread_pool_num4ORM pool; 0 uses CPU count
wwwpath./www/defaultStatic site root
indexindex.htmlDefault index file
session_type10 file / 1 memory / 2 Redis / 3 Memcache
rate_limit_status0Global rate-limit switch
usehtmlcache1Static-file cache; TTL floor 10 seconds
deamon_enable0Daemon mode
ocsp_intv_time14400OCSP refresh ticks; multiplied by 5 seconds at runtime

Ports and static roots

httpport and httpsport are parsed as comma-separated lists and fall back to 80 / 443 when empty. The static root comes from wwwpath, the default file from index, and directorylist = 1 enables directory listing.

terminalbash
lsof -i :80
sudo ss -tlnp | grep 80
# change conf/server.conf when the port is busy:
# httpport = 8080

HTTP/2 inheritance

The default site is controlled by http2_enable. Virtual sites inherit isallnothttp2, which is then unconditionally overwritten by global_http2_enable. The shipped config only sets http2_enable = 1, so virtual sites without their own http2_enable = 1 default to HTTP/2 off.

Unused config keys

These keys remain in the config file but have no reader in the current C++ code: threadmax, threadmin, bmcport, staticfile_cache_num, modelspath, viewpath, controlpath, libspath and pluginspath. Keeping them is harmless; tuning them has no effect.

Start and stop

terminalbash
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j8
cd ..
lsof -i :80
./bin/paozhu conf/server.conf
curl -I http://127.0.0.1/
tail -f log/*