Documentation
204 documents, generated from the docs/ directory of the ScalWS repository. Start with Getting started, then Architecture.
Getting started 5
- Getting started
A Linux web and application server written in Rust. It serves static files, runs PHP through PHP-FPM, Node.js and Python applications, works as a reverse proxy and load balancer, hosts several tenants with cgroup v2 limi
- Installation
This guide installs ScalWS from the signed apt, dnf, zypper or apk repository, explains what the package puts on the system, and gets the server answering on ports 80 and 443. For your first site continue with the quick
- Quick start: your first site in five minutes
From a fresh installation to a static site, a PHP (WordPress-style) site, a Node.js application behind the server, and HTTPS with Let's Encrypt. Every site lives in its own short file under /etc/scalws/sites.d/, managed
- Files, directories and services
Reference for everything the scalws package puts on a system and for the day-to-day mechanics: where configuration and state live, the systemd units and their sandbox, logs, reloads, backups and upgrades. Installation it
- Upgrading
This page explains how to upgrade the scalws package, what the upgrade does to running services and configuration files, and how to go back if something goes wrong.
Users' guide 23
- Configuration: `scalws.yaml`
ScalWS reads one YAML file, by default /etc/scalws/scalws.yaml. This page is an overview of that file: its layout, what each part of the server: section is for, the caveats worth knowing, and an example per section. Ever
- Sites: adding a domain
One short file per site, scalwsctl site add|list|remove, and moving sites from nginx or Apache with scalwsctl migrate.
- Tenants, applications and runtimes
How tenants, applications, routes and the runtimes (static files, reverse proxy, fixed responses, redirects, PHP, Node.js, Python, containers) are configured, with complete examples for common applications.
- HTTPS and TLS
This guide covers how ScalWS serves HTTPS: TLS listeners and certificate files, certificates from Let's Encrypt (ACME), HTTP/2, HTTP/3, kernel TLS, and redirects to HTTPS. The basics of the configuration file are in conf
- Response cache
ScalWS has a built-in HTTP response cache that sits in front of the application runtimes (PHP, Node.js, Python, containers, proxies). It is designed to be safe by default: it only stores responses that the application ex
- Security
This guide describes the security features of ScalWS and how to configure them: request and connection limits, per-client rate limits, tenant quotas, per-application rules, trusted proxies, path handling, isolation of te
- Sandbox
ScalWS can confine its web server process, scalwsd, with two Linux kernel features: Landlock (which files it may read, write or execute) and seccomp (which system calls it may make). If an attacker ever found a way to ru
- ScalWS Adaptive Runtime: design summary, configuration and benchmark plan
Design ADRs: 0033 (control/data plane, reuseport), 0034 (PressureScore, classification), 0035 (lifecycle, drain, generations, recovery), 0036 (multi-instance state). Rollback point: pre-adaptive-runtime-2026-10-06.
- ScalWS Console: installation and operation
ScalWS Console is part of the standard ScalWS distribution: the DEB, RPM and APK packages contain /usr/bin/scalws-console and scalws-console.service, next to scalwsd, scalws-controller and scalwsctl.
- Operations guide
Supported systems (x8664): AlmaLinux, Rocky Linux and Oracle Linux 8, 9 and 10 (for 10 see the EL10 note), Fedora 44, openSUSE Leap 16.0 and 15.6, SLES 16.0 and 15 SP7, Debian 12 and 13, Ubuntu 22.04, 24.04 and 26.04, Al
- How a request is processed
This page follows one HTTP request through ScalWS, from the accepted connection to the logged response, and lists the status code returned at every step that can refuse it.
- Domains, routing and default certificates
This page explains how ScalWS picks the application for a request from its host name, how it picks the TLS certificate for a connection from the SNI name, and how the two relate.
How-to 12
- WordPress
Serve a WordPress site with PHP-FPM, pretty permalinks, the WordPress profile and HTTPS.
- Laravel
Serve a Laravel application from its public/ directory through PHP-FPM, with the Laravel profile's deny and cache-bypass rules.
- Node.js applications
Run a Node.js application behind ScalWS: started and supervised by ScalWS under scalwsd.service, or run by systemd and proxied under scalws-controller.
- Python applications
Run a FastAPI (ASGI) application with uvicorn or a Django (WSGI) application with gunicorn behind ScalWS.
- Reverse proxy
Put ScalWS in front of an HTTP application, send an /api path to a second upstream, and control the Host header and WebSockets.
- Single-page application
Serve the build output of a single-page application (React, Vue, Svelte, ...) as static files, with precompressed assets and client-side routes falling back to index.html.
- .htaccess support
Turn on Apache .htaccess files for a site and know which directives ScalWS applies, which it ignores and which make it deny access.
- HTTPS with Let's Encrypt
Get and renew certificates from Let's Encrypt automatically, test against the staging CA first, then redirect HTTP to HTTPS and www. to the bare domain.
- Migrating from nginx
Move the sites of an nginx server to ScalWS with scalwsctl migrate nginx, test them next to nginx, switch ports 80 and 443 over, and roll back if needed.
- Migrating from Apache
Move the virtual hosts of an Apache httpd server to ScalWS with scalwsctl migrate apache, test them next to Apache, switch ports 80 and 443 over, and roll back if needed.
- nginx directives in ScalWS
This page maps the nginx directives people use most to their ScalWS equivalent and says which ones scalwsctl migrate nginx converts for you.
- Apache directives in ScalWS
This page maps the Apache httpd directives people use most to their ScalWS equivalent and says which ones scalwsctl migrate apache converts for you.
Reference 46
- Directive index
ScalWS configuration reference for Directive index: every setting with its syntax, default, context and reload behaviour.
- Reference: scalws.yaml top level
ScalWS configuration reference for scalws.yaml top level: every setting with its syntax, default, context and reload behaviour.
- Reference: server
ScalWS configuration reference for server: every setting with its syntax, default, context and reload behaviour.
- Reference: server.acme
ScalWS configuration reference for server.acme: every setting with its syntax, default, context and reload behaviour.
- Reference: server.admin
ScalWS configuration reference for server.admin: every setting with its syntax, default, context and reload behaviour.
- Reference: server.ai
ScalWS configuration reference for server.ai: every setting with its syntax, default, context and reload behaviour.
- Reference: server.cache
ScalWS configuration reference for server.cache: every setting with its syntax, default, context and reload behaviour.
- Reference: server.cgroups
ScalWS configuration reference for server.cgroups: every setting with its syntax, default, context and reload behaviour.
- Reference: server.client_address
ScalWS configuration reference for server.client_address: every setting with its syntax, default, context and reload behaviour.
- Reference: server.compression
ScalWS configuration reference for server.compression: every setting with its syntax, default, context and reload behaviour.
- Reference: server.diagnostics
ScalWS configuration reference for server.diagnostics: every setting with its syntax, default, context and reload behaviour.
- Reference: server.ebpf
ScalWS configuration reference for server.ebpf: every setting with its syntax, default, context and reload behaviour.
Help 2
- Troubleshooting
Where to look when something is wrong, the built-in diagnostics, and common problems with their real error messages, causes and fixes.
- Frequently asked questions
Scale Web Server (ScalWS) is a multi-tenant web and application server for Linux, written in Rust. One process serves static files, reverse-proxies to upstreams, and runs PHP-FPM, Node.js, Python (ASGI and WSGI) and cont
Internals: architecture 3
- Architecture
Goals: a Rust data plane that is fast, deterministic, observable, secure and multi-tenant; PHP / Node.js / Python / arbitrary upstreams as first-class runtimes via adapters; declarative, validated, atomically reloadable
- Decision log
Significant decisions get an ADR in docs/adr/. Smaller ones are logged here with date and reason so they can be revisited.
- Changelog
All notable changes are recorded here. Format: Keep a Changelog.
Internals: Adaptive Runtime 4
- Adaptive Runtime: final report (2026-10-07)
Design: ADR-0033 … 0036 and docs/adaptive-runtime.md (architecture diagram, configuration reference). Rollback point: pre-adaptive-runtime-2026-10-06 (VERIFIED, docs/pre-adaptive-runtime-backup.md). Benchmarks: docs/benc
- Listener generations: changing listeners without restarting the controller
Design: ADR-0037. Applies to scalws-controller with listen: inherited (the default).
- Connection distribution: what is measured and what it means
Design: ADR-0038. Applies to several instances under scalws-controller.
- HTTP/3 with several instances: operation
Design: ADR-0039 (transport plane), ADR-0040 (connection IDs), ADR-0041 (lifecycle). TCP (HTTP/1.1, HTTP/2) is unchanged: one shared accept queue per address (listen: inherited).
Internals: console 5
- ScalWS Console: architecture
ScalWS Console is the web administration of a ScalWS host, shipped with ScalWS the way LiteSpeed WebAdmin ships with LiteSpeed Web Server: the same packages and release artifacts (scalwsd, scalws-controller, scalwsctl, s
- ScalWS Console: configuration workflow
The console never edits the active configuration in place. Every change is a transaction over the configuration file the controller reads (controller.config in controller.yaml), and the controller turns the file into a n
- ScalWS Console: roles and capabilities
Roles are fixed sets of capabilities (cmd/scalws-console/src/rbac.rs). Every API handler names the capability it needs and checks it on the server; the browser only hides what the session cannot do. Sensitive actions als
- ScalWS Console: security and threat model
/etc/scalws/console/credentials (packaged installs; <statedir>/credentials otherwise), mode 0600, one account per line:
- ScalWS Console: test and security report (2026-10-07, updated 2026-10-08)
Build: cmd/scalws-console at the commit that adds it; demo stack on the development VM (scripts/console-demo.sh): its own scalws-controller (state in a scratch directory, listeners 127.0.0.1:28080/28443, metrics 39910+,
Internals: security 4
- Threat Model
Legend: ✅ implemented and tested · 🟡 partial · ⏳ planned (milestone) Setting (ScalPanel mode): one scalwsd per website container, running as the website's user (UID 200000-999999, GID = UID), no capabilities, read-only
- Security audit of the own HTTP/1 code (run-2, 2026-10-09)
Scoped standard run of the security-audit workflow over the new code: crates/scalws-h1, crates/scalws-http/src/h1server.rs (+ conn.rs dispatch), crates/scalws-core/src/upgrade.rs and the experimental upstream client (cra
- Hardening pass 1: fuzzing and wire-level attacks (2026-10-09)
Development VM (Ubuntu 24.04, Linux 6.8), commit 4f5c52f. Ten minutes per target, libFuzzer with AddressSanitizer, -maxlen=8192, seeded with real inputs (WordPress .htaccess, benchmark configurations, PROXY v1/v2 lines,
- Security audit of the own HTTP/1 server and client before they become the default (2026-11-13)
Focused review (security-audit skill, guidance mode) of the code that 1.1 P10 makes the default: the own HTTP/1 server (crates/scalws-http/src/h1server.rs, its codec crates/scalws-h1) and the own upstream client (crates/
Internals: benchmark reports 45
- Benchmark reports
Dated reports. Those written before 2026-10-07 use the names of that time: the server was called SCB (scb-webd, scbctl, crates scb-, result rows labelled scb); it is now Scale Web Server (ScalWS): scalwsd, scalwsctl, sca
- Benchmark harness
Reproducible, comparative HTTP benchmarks. Runtime scenarios php, node, python put each server in front of identical application servers (see docs/benchmarks/2026-10-05-m2-runtimes.md).
- Kubernetes ingress benchmark harness
Compares the ScalWS ingress controller (chart deploy/helm/scalws in ingress mode) with ingress-nginx and Traefik on one k3s node. Report (round 2 on top, round 1 below): docs/benchmarks/2026-10-14-xeon-k8s-ingress.md.
- Pre-Adaptive-Runtime baseline (frozen 2026-10-06)
The authoritative single-instance reference for the Adaptive Runtime work: regression gates compare against these numbers with Adaptive Runtime disabled.
- ScalWS 1.1.1 on bare metal: the installed package against 1.1.0 and nginx (2026-11-23)
The release measurement of 1.1.1: the 1.1.1 .deb installed on the Xeon host, against the published 1.1.0 package and nginx 1.31.6, at 1 CPU and at 6 CPUs, plus the compression rows and the edge rows, with the method of 2
- Replica keys on the proxy path (1.1.1, Task 12)
Question: what do the 1.1.1 replica keys cost a proxied 1 KiB response, against the same route without them, and against nginx?
- ScalWS 1.1.0 on bare metal: the installed package against nginx and 1.0.0 (2026-11-19)
The release measurement of 1.1.0 (release gate 4): the 1.1.0 .deb installed on the Xeon host as 1.0.0 was in 2026-11-12-xeon-1.0.0.md, against nginx 1.31.6 and against the published 1.0.0 package, at 1 CPU and at 6 CPUs,
- ScalPanel edge features on the proxy path, against nginx (2026-11-18)
The benchmark gate of the 1.1 edge-features plan (Task 15, ruling C2): what the keys ScalPanel's generator puts on a website route cost on the proxy path, and how ScalWS with them compares with nginx configured the same
- Compression on xeon: mode off, static and all against nginx gzip (2026-11-15)
The measurement of the ScalPanel plan's Task 6 (design "Cost when off, measured"): what response compression costs when it is off, and how ScalWS's static and all modes compare with nginx's gzip module.
- Where ScalWS trails nginx 1.31: a profile on bare metal (2026-11-13)
Diagnosis only: no product code changed. The question is why ScalWS is below nginx 1.31 in some scenarios of the 1.0.0 report (2026-11-12-xeon-1.0.0.md), and which changes would recover how much, towards the goal of at l
- ScalWS 1.0.0 on bare metal: the installed package with three warm instances (2026-11-12)
The first measurement of a release as it is installed: the 1.0.0 .deb on the Xeon host, scalws-controller running three scalwsd instances of two CPUs each, started before the measurement (no autoscaling), with the servic
- Performance gates for 1.0.0 on the Xeon host, 2026-11-06 to 08
The rule: every scenario at parity or faster than the version it replaces, median of at least three rounds (method of 2026-10-27-el8-build.md). Three gates:
Internals: decision records 55
- 0001 Rust + Tokio + hyper for the data plane
Requirement: Rust owns listeners, HTTP, TLS, routing, proxying and static serving, using mature libraries and no hand-written HTTP parsers.
- 0002 rustls with the aws-lc-rs crypto provider
TLS must use a mature library. Options: OpenSSL bindings, rustls+ring, rustls+aws-lc-rs.
- 0003 Declarative YAML configuration, validate-then-swap
Requirement: declarative, validated before activation, atomically reloadable, roll-backable; a failed config never replaces the last-known-good. The original example is YAML. serdeyaml is deprecated upstream.
- 0004 Two-level runtime contract (Handler / RuntimeAdapter)
Requirement: core routing must not care whether the destination is PHP, Python, Node, a container, a Unix socket or a TCP service. Language specifics must not leak into the core.
- 0005 Metrics, logs and bounded cardinality
- 0006 Static file confinement
- 0007 Linux-first product, cross-platform development
The first development machine is Windows 11 with Docker Desktop. The product targets Ubuntu 24.04 and AlmaLinux/Rocky 9.
- 0008 Managed application processes
Requirement: Node, Python and PHP-FPM processes are supervised by scalwsd with lifecycle state, readiness, crash backoff, graceful drain/restart, rate-limited stdout/stderr capture and restart-loop protection. A runtime
- 0009 PHP via FastCGI using the `fastcgi-client` crate
PHP is served through PHP-FPM over FastCGI. Options: write a FastCGI record codec, or use an existing crate. Requirement: use mature libraries.
- 0010 cgroup v2 placement, tenant resource limits and request quotas
Requirement: Tenant → Application → Domain; CPU, memory, PIDs, I/O, concurrent requests, connections and request rate policies; cgroups v2 for application workloads; do not claim cgroups isolate CPU used inside the share
- 0011 Data-driven application profiles and detection
Requirement: pluggable application detection that reports evidence and confidence and proposes a profile; detection never silently changes production. Profiles are data-driven and define recommended cache bypasses, stati
- 0012 Bounded in-memory response cache
Requirement: bounded memory cache first, optional disk cache second; correct keys, Vary handling, stale-while-revalidate where safe, tag/key purge and profile-driven bypass. Requirement: never infer personalised-content