Chapter 1 — Introduction & Quick Start

Last Updated: 2026-11-30 14:51 Views: 11

1.1 What WxServer is

WxServer is a web server and gateway written in Rust as a single binary. Its core capabilities are:

  • HTTP engine: domain matching, exact/prefix/regex locations, a seven-phase pipeline, internal redirects and error_page.
  • Proxy family: proxy, FastCGI, uWSGI, SCGI, gRPC, memcached, mirror, WebDAV and TCP/UDP stream.
  • TLS: SNI multi-certificate, HTTP/2, HTTP/3 (QUIC), mTLS and automatic ACME certificates.
  • Security: SecRule/CRS or fast WAF engines, IP allow/deny lists, CC protection, rate limiting, security headers and privilege separation.
  • Operations: built-in Vue console, Prometheus metrics, combined access logs, hot reload and cross-platform service management (--service).

1.2 Platforms and run users

Platform Service management Dynamic modules
Linux --service auto-detects systemd/OpenRC (Alpine)/SysV initd Supported, most stable
FreeBSD --service registers rc.d (daemon(8)) Supported
macOS --service registers launchd Supported
Windows --service registers an SCM service Supported (.dll)

Started as root with worker_processes >= 1, it uses the master/worker model: workers run as www-data on Linux, _www on macOS and www on FreeBSD. On Windows the service runs under an ordinary local account, never LocalSystem.

1.3 Installation layout

Paths after installing the Linux distribution package:

Path Contents
/usr/sbin/wxserver Main binary
/usr/bin/wxserver-convert web server / CRS config converter (`–from auto
/usr/bin/wxserver-tool htpasswd, bench load test, precompress
/etc/wxserver/ wxserver.toml, manager.toml, acme.toml, cert.toml
/etc/wxserver/vhost/ Site files; default.toml shipped
/etc/wxserver/certs/ Certificates and private keys
/var/wxserver/html/ Default root and error-page templates
/var/log/wxserver/ Access/error/WAF/stream logs
/usr/share/wxserver/modules/ External modules
/var/run/wxserver/ PID, shared memory, cache, runtime files

macOS and FreeBSD use /usr/local for the program tree (/usr/local/bin, /usr/local/sbin, /usr/local/share/wxserver/modules); configuration lives in /etc/wxserver, exactly as on Linux. The site root, logs and runtime directory stay at /var/wxserver/html, /var/log/wxserver and /var/run/wxserver. A Windows installation contains bin\, sbin\, conf\, html\, logs\, modules\ and run\; the four TOML files plus vhost\ and certs\ live under conf\. The service account is an ordinary local user.

1.4 First start

wxserver -t -c /etc/wxserver/wxserver.toml      # validate configuration
wxserver -c /etc/wxserver/wxserver.toml         # run in the foreground
wxserver --service install -c /etc/wxserver/wxserver.toml   # register a service
wxserver --service start   -c /etc/wxserver/wxserver.toml
wxserver -s reload|stop|quit -c /etc/wxserver/wxserver.toml # signal control

On first start, if manager.toml has no users, an admin account is created with a 16-character random password, printed to stdout and stored in manager.toml (0600). The same password is written to manager-initial-password.txt (0600) for service managers that do not capture stdout (FreeBSD rc.d / Windows SCM); delete that file after the first login. Open http://127.0.0.1:9090, sign in and change it. If lost, run:

wxserver --reset-password 'new-password' -c /etc/wxserver/wxserver.toml
wxserver --reset-totp -c /etc/wxserver/wxserver.toml

The console listens on loopback by default. If remote access is truly required, use an SSH tunnel or a trusted reverse proxy, with a strong password and TOTP.

1.5 External module deployment

External modules are native dynamic libraries (cdylib): .so on Linux/FreeBSD, .dylib on macOS and .dll on Windows. Declare the path in the external_modules section of the main configuration:

cargo build --release --manifest-path /path/to/module/Cargo.toml
external_modules = [{ path = "/usr/share/wxserver/modules/libexample.so", enabled = true }]

Optional SHA-256 pinning and Ed25519 signature verification are available; see Chapter 8.

← Previous Article WxServer User Manual Next Article → Chapter 2 — Web Console

Comments

No comments yet