The web server stack as a project: the recipes, webctl, a vhost panel (domains, PHP version per vhost, TLS, databases, an export into QTS's Web Server), a live test and the WebPortico QTS package. https://qnaputilities.com/bucketvs.html
  • Go 75.4%
  • JavaScript 11.2%
  • Shell 11%
  • HTML 1.1%
  • CSS 1%
  • Other 0.2%
Find a file
2026-11-14 07:31:41 +00:00
.forgejo/workflows Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-08 07:37:42 +00:00
dbtool Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-14 07:31:41 +00:00
docs/review Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-08 07:37:42 +00:00
imagemagick Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-08 07:37:42 +00:00
panel Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-14 07:31:41 +00:00
qpkg Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-14 07:31:41 +00:00
scripts Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-14 07:31:41 +00:00
tests Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-11 12:42:57 +00:00
webctl Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-14 07:31:41 +00:00
ws Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-10-04 09:51:39 +00:00
.gitignore Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-10-08 00:32:36 +00:00
bvsapp.sh Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-08 07:37:42 +00:00
CHANGELOG.md Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-14 07:31:41 +00:00
LICENSE Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-10-12 00:00:37 +00:00
Makefile Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-08 07:37:42 +00:00
PRODUCT.md Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-08 07:37:42 +00:00
README.md Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-14 07:31:41 +00:00
recipes-percona.txt Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-08 07:37:42 +00:00
recipes.txt Public example, generated by tools/publish-examples.sh from the bucketvs wizard template: web-server 2026-11-14 07:31:41 +00:00

WebPortico: a web server stack with a panel for the NAS's sites

A web hosting stack for your own sites, with a web panel, packed as the QTS package WebPortico:

  • nginx and Apache httpd serve the sites. Each site picks its server. nginx is the one front: clients reach every site through it (TLS, HTTP/2, HTTP/3 when nginx has it, websockets), and httpd answers behind it on 127.0.0.1 (D217). The package adds to both servers' MIME type lists the types sites need that the lists lack, such as .webmanifest, .mjs on nginx, subtitles and the segments of HLS and DASH films (scripts/mime-types.sh, D382). httpd has mod_access_compat, so an .htaccess with Apache 2.2's Order, Allow from and Deny from lines works as it did under QTS's Web Server (D384), and since 0.11.0 Digest authentication, groups from a group file, Substitute and the RATE_LIMIT filter (D396). httpd can load a module built later with apxs (mod_so), and nginx is built --with-compat for load_module; no site loads one yet.
  • PHP 8.1 to 8.5 side by side with PHP-FPM: every PHP site has its own PHP-FPM master (its own OPcache and APCu, its own workers, its own settings), and its workers run as the site's own account. A site's PHP may open its own folder, its own temporary folder and the app's ffmpeg and ffprobe (D386). The programs it runs find the app's bin first on PATH and get the temporary folder as TMPDIR, so FileRise's video thumbnails work, and h5ai runs the app's ffmpeg too. QTS's /tmp stays out of reach: it is a 64 MB folder that every account on the NAS may write. Since 0.12.0 a PHP site can have PECL extensions of its own (D397): built on its PHP tab as the site's account, with no network, in Bucket & Code Server IDE's builder environment, checked, kept as root's, and loaded by that site's workers alone.
  • imagick in every PHP branch, on ImageMagick 7 with JPEG, PNG, WebP, GIF, HEIC (read) and AVIF, under the package's own strict policy (D394).
  • MariaDB and PostgreSQL for the sites' data. Every PHP site has a Valkey (it speaks Redis's protocol) and a memcached of its own, as its own account, on sockets only the site can open, with no password (D393); the stack's shared Valkey and memcached stay for the admin (D227).
  • Node.js (a websocket example), Grafana and OpenSearch as optional services behind a proxy site.
  • webpanel (panel/, Go, no outside modules) is the panel, over HTTPS with its own certificate.

All of it is one App Builder app, web-server (the example "Web server stack"), linked as bundle: the recipes build from source, and the libraries the programs load go into the app.

The panel

  • Sites: a site is a domain with its aliases, a kind (static files, PHP, or a proxy to a service on this NAS or the local network, a container included, with websockets), its server (nginx or httpd), an account of its own (ws-<ID>) and its folder, whose public/ is the document root; a new static or PHP site's first apply puts WebPortico's starter page there as index.html (D405), in the panel's language, for the site's own files to replace. A PHP site has its own PHP-FPM master with its version and settings. Add site is a wizard: whether you have a domain (or the guide to buying one at OVHcloud, or a site for the local network only), the domain, the DNS step (the lookup of who answers for the domain, then what to do there: an API key or the rows by hand at Cloudflare and OVHcloud, the name servers and glue for TurboDNS, the rows at another provider; this NAS's addresses; the router; Check now, D406), the website, for a PHP site its PHP (the version with its support dates, the memory, upload, request and time limits at 256 MB, 64 MB, 72 MB and 120 s, and OPcache on now or once the site is finished, D407) and a database, and the certificate, then one dry run and the apply, which also sends TurboDNS's plan when TurboDNS answers, or writes the records at Cloudflare or OVHcloud with the zone's key. The site's Overview then shows a checklist until it is closed: the records sent to TurboDNS (when it serves or keeps the zone), the values for the registrar, the live check and, for Let's Encrypt, the request. The first visit asks once where the sites' folders go: a shared folder of QTS, or <data>/www as before. On QuTS hero, a share with Advanced Folder Permissions cannot hold sites: the apply stops, names the folder and asks again. After a share is renamed or moved in QTS, root points the sites at its new path (docs/architecture/web-server.md, "A share renamed or moved in QTS"). Each site has a page with tabs. Overview shows its address, account, PHP service, folder, certificate expiry and disk use. Files has the disk use, Fix permissions and a link that opens the folder in bucketvs's IDE. Domains and TLS has the aliases and the certificate, Hosting the site type, the server and a proxy's target, PHP a PHP site's version and settings, Cache the compression, the page cache and the expiry of static files (nginx static and PHP sites), Database the site's databases (for a PHP site, or one that has them), Scheduled tasks its tasks, and Logs its logs. The panel shows each PHP line's support state (active, security fixes only, end of life) from php.net's dates.
  • The default site (D373): a request for a name no site has (the NAS's address, its name, any other name) gets QTS's Web shared folder when smb.conf lists one the web servers can use, else a start page in <data>/www/default, so WebPortico can stand in for QTS's own Web Server without a domain. httpd serves it, so the Web folder's .htaccess files keep working, and its PHP runs under an account of its own. It is the Sites list's first entry, "Default site", with its folder and PHP version; its page has the switch, the PHP settings and the logs. It has no domain. After the install or an upgrade it is on as a draft, and the next dry run and apply put it live. It answers on the front's ports: on 80 once the front has moved there, else on 9542. While QTS's Web Server holds port 80, its page says what to switch off in QTS first. It never serves the sites' folders in the Web folder, dot files and folders (except .well-known) or QTS's @ folders, and it never changes the Web folder's permissions; when httpd or the site's PHP cannot read the folder, the page says so. Over HTTPS it answers with the NAS's own certificate, the one QTS uses for its own pages (D377): the agent keeps a copy of it in <data>/nascert/ and follows QTS when it changes. A TLS request for a site without TLS is refused at the handshake, as no certificate names it. Its PHP may open files under /share (D379), so a folder of the Web share that is a link to another shared folder or volume works as it did with QTS's own Web Server; httpd follows such a link when the link and its target have the same owner. A Satisfy Any line in an .htaccess opens none of what it never serves (D384). While its PHP tab has no settings of its own, its PHP takes the upload, POST, time and memory limits of QTS's own Web Server from /etc/config/php.ini, at least a 2048 MB upload, a 2100 MB POST and 600 s, within the tab's ranges (D385). What an application wrote under QTS's Web Server belongs to httpdusr, which the default site's account cannot change: give such a data folder to the account its Overview names (chown -R ws-<ID> <folder>).
  • Reverse proxies from the apps' templates (D374): a proxy site's "App on this NAS" lists the apps installed here that a template fits (Rtorrent 16 and its add-ons, Radarr, Sonarr, Prowlarr, Lidarr, Bazarr, Seerr, Tautulli, qBittorrent, Transmission, TunerHub, Weblate, Tolgee, Bucket & Code Server IDE, Plex Media Server, Jellyfin), with the port their package keeps in qpkg.conf. Picking one fills in the target and the websocket switch; the front then sends the app the forwarded headers it reads, gives an app with long requests up to an hour, and streams media and events without buffering for the apps that send them. The page gives one line for what only the app's own settings can change (an *arr app's URL Base, Seerr's Application URL, qBittorrent's reverse proxy support, Plex's Custom server access URLs, Bucket & Code's Public URL, Weblate's site-domain file).
  • PHP settings (D243, D287, D288): on a PHP site's PHP tab, the version and time zone, the limits, the errors, the sessions and security, OPcache (on or off for the site, D407) and the JIT, APCu and the extensions, more php.ini lines of the site's own and the PHP-FPM pool (the process manager, the number of processes, the request time limit and a slow-request log). Each field has a "?" that says what it does and what its default is. A php.ini line is accepted only when the version's own PHP lists the setting and it is not one that loads code, runs a command or names a file. HHVM is not offered: since 4.0 it aims at Hack, and since 4.1 it refuses PHP files unless a switch allows them.
  • Caches (D289, D407): a live PHP site's Cache tab opens with what its Valkey, memcached, APCu and OPcache hold (memory, limit, keys, items, entries or scripts, and the hit rate), each with Flush, and nginx's page cache with Purge and Turn off; the Databases page has the same for the shared Valkey and memcached. nginx compresses text answers with Brotli, zstd or gzip, with no switch. A PHP site's Cache tab turns on a page cache (off by default), nginx's only cache; httpd keeps none. The cache serves a page for 10 s unless set otherwise, only to visitors without a sign-in cookie, and shows what happened in the X-Cache header: HIT, MISS, STALE, UPDATING or BYPASS. Purge empties it. The tab also sets how long browsers keep static files. A page-cached site that Cloudflare's tunnel serves runs uncached on that path.
  • Scheduled tasks (D391): a live site's Scheduled tasks tab holds up to 20 tasks, each a PHP file of the site (run by the site's PHP with its php.ini and its pool's limits), a command line for the shell in the site's folder (where php is the site's PHP), or an address of the site that WebPortico fetches from its own front. The schedule is a preset (every minute, 5, 15 or 30 minutes, every hour, day, week or month at a time) or the five cron fields, with the next runs on the NAS's clock shown as you type. The root agent runs each task as the site's account, in its folder, niced, with no core file, at most 512 processes and 6 hours a run; a task never runs twice at once, and at most four run at the same time on the NAS. Run now starts one at once, Stop ends it, the page shows the last result with its output, and each run's block goes into the site's task log (logs/tasks/site-<ID>.log, rotated with the other logs). With MailServerPro on the NAS, a task that turns from working to failing sends a report to the address you give, then at most one a day while it keeps failing. A task's change counts at once: it needs no dry run. The tasks run from WebPortico's own scheduler, not from QTS's crontab. While WebPortico or QTS stops (the package's stop, a shutdown or restart of the NAS, QTS stopping its services), no task starts and Run now says why. One agent runs at a time, and when the agent was killed during a run, its next start stops what that run left (D408).
  • Backups (D459): every live site is backed up once a day into a folder you pick once on the Backups page (a shared folder, where WebPortico makes a folder of its own that only it can open, or WebPortico's data folder). A backup holds the site's databases, its files and its settings: a full backup on the day of the week you choose, and the changes only on the other days, kept for 1 to 52 weeks (4 by default). Each site's Backups tab shows the kept days, Back up now, and for each backup Restore, which puts the site's files and databases back as they were (after a check of the unpacked files against the backup's list and a backup of the site as it is now), and Restore settings as draft. The page warns when a site's folder is on the same volume as the backups. Each backup's folder holds RESTORE.txt, the commands to unpack it by hand with GNU tar and zstd.
  • Dry run and apply: a saved site is a draft. The dry run renders the whole web tier into a scratch folder, runs nginx -t, httpd -t and php-fpm -t on it, and shows the files added, changed and removed with their diffs, and the starts and reloads it needs. Apply carries out exactly that plan (a plan made before another change is refused with a new dry run to read), keeps a snapshot of the live files first, reloads gracefully, and puts the snapshot back if a step fails. Deleting a site needs its name typed; its folder and databases stay, and its account goes after the apply.
  • TLS: a certificate and key you paste or upload (the key must match, and the panel names any of the site's names the certificate does not cover), QTS's own certificate (read, never changed), or a self-signed one the panel makes. The front shows it to browsers; when a Cloudflare Tunnel or another proxy stands in front of the NAS, that one holds the public certificate. The TLS card is on the TLS page and on the site's Domains and TLS tab.
  • Certificates from Let's Encrypt (D220): each site's TLS card asks Let's Encrypt for a certificate of its name and aliases with lego (the app's bin/lego), after you give the account's e-mail and accept Let's Encrypt's terms. The check is HTTP-01 (a file the front serves on port 80 under /.well-known/acme-challenge/), DNS-01 through TurboDNS (WebPortico adds the _acme-challenge TXT record through TurboDNS's hand-off and takes it away again) or DNS-01 through Cloudflare (your API token, kept 0600). A wildcard alias needs DNS-01. The site uses the certificate after the usual dry run and apply; from then on WebPortico renews it by itself when 30 days or less are left (twice a day it asks), puts the new one live and reloads nginx, and the card shows the last run, with lego's own words when it failed. Renew now does the same at once.
  • Front server and ports (D217): where the front listens (9542 and 9543, or 80 and 443), whether it speaks HTTP/3, and what holds 80 and 443. While QTS's own servers hold them, one click takes them over (D399): QTS's administration over HTTPS moves to 44443 (or the next free port), QTS's Web Server and its vhosts to 8880, each checked before the next step, QTS's vhosts come in as proxy sites behind the front, and the front takes 80 and 443 in one apply; the result names the administration's new address, and one click goes back. A fresh install asks this once after the first sign-in. While another program holds a port, the card shows the steps that free it. Once both are free, one click moves the front there (after the servers' checks, with the usual way back), and one click moves it back.
  • The guided tour (D400): Tour in the status bar walks through the panel in order (standard ports and their takeover, TurboDNS first, the first site, Preview changes and Apply changes, the site's checklist, DNS for your network), opens each step's page and rings its control, and never clicks anything. What it says follows this NAS: the router's DHCP is suggested only when TurboDNS answers every name and the NAS's own DNS is Manual with another server. A fresh install opens it once after the first-run question.
  • The Cloudflare Tunnel (D311): for a NAS without a public address (behind CGNAT, or a router that forwards no ports), the Front page's card "Reach the sites from the internet through Cloudflare". Paste an API token of your Cloudflare account (Account › Cloudflare Tunnel › Edit, and for the zone Zone › Zone › Read and Zone › DNS › Edit), pick the zone, and turn the tunnel on: WebPortico makes one tunnel of its own and runs the app's cloudflared as web-tunnel, which connects out to Cloudflare. Each applied site then has the switch "Reach this site from the internet through Cloudflare": its names in the zone (the zone's own name and names one level below it) get a proxied CNAME to the tunnel, and Cloudflare passes their visitors to the front's listener on 127.0.0.1:9553. A name that already has an A, AAAA or CNAME record WebPortico did not make, or an NS delegation, is refused, never overwritten; MX, TXT and the other types stay. Through the tunnel browsers see Cloudflare's certificate; the front keeps its own for the local network. Turning the tunnel off deletes the records WebPortico made and the tunnel; turn it off before you remove WebPortico, since the removal leaves both at Cloudflare. The domain's name servers must be Cloudflare's; Cloudflare's free plan takes uploads up to 100 MB per request and waits up to 125 s for an answer, and its terms let it limit a site that serves video or mostly large files without a paid service.
  • Databases: a MariaDB, Percona Server (where the package has its app) or PostgreSQL database and user per site, on the Databases page and on the site's Database tab. The user's password is shown once and kept in a 0600 file in the panel's state folder; it is never written to a log. Above the sites' databases the page has a card for MariaDB and one for Percona Server: the buffer pool, the connections, the largest packet, the redo log, the temporary tables, the table cache, the idle time, the slow-query time and more my.cnf lines the server itself checks. A change is a draft; the apply restarts the server, and the sites' databases do not answer while it restarts, typically a few seconds. A site's database itself is no draft: it is made or dropped at once, and its site stays unchanged (D382).
  • Database tool (D458): Open in Adminer, beside each database on the Databases page and on the site's Database tab, opens Adminer 6.3.0 for that database in a new tab, already signed in (a site that is still a draft says to apply the changes first). It signs in with an account of WebPortico's own that reaches only that site's databases on that server (wpdbt_s<ID> in MariaDB and Percona Server, wpdbt_<user> in PostgreSQL, acting as the database's owner), never with the site's own password, so it works for a database whose password WebPortico never saw. Each opening gives that account a new random password, and the account is locked again when the session ends: after 2 hours without use, at Adminer's Logout, and when you sign out of WebPortico. Adminer runs as web-dbtool in a PHP-FPM pool of its own that only the panel reaches, and its pages come from the panel's program on a port of their own (9556), so nothing shown in Adminer can reach the panel; there is no login form, so no other host can be typed. Uploads go up to 128 MB.
  • Services: state, start, stop, reload and logs of nginx, httpd and each PHP-FPM master.
  • Snapshots: every apply keeps one; a snapshot comes back as the draft and goes through the same dry run.
  • QTS Web Server: chosen static and PHP sites are written into QTS's own Web Server (its two vhost files: name, port, folder, TLS), after a dry run of the three files, with a backup of all six that restores byte for byte. A proxy site, a PHP version and everything else of a site do not carry over; the panel says so. A site whose folder belongs to its own account is refused, because QTS's Apache cannot read it: a site in a shared folder, and every site that an apply of 0.5.0 made live (its folder is 0750, D248).
  • DNS records to TurboDNS (D216): when the TurboDNS package runs on the NAS, the Add site wizard's DNS step offers it the zone, its review shows TurboDNS's plan under the site's plan, and its apply sends both. The step's third answer, a DNS provider (Cloudflare or OVHcloud) answering for the zone TurboDNS keeps, sends the same records and leaves the push to TurboDNS's Cloudflare and OVH tab; the live check then passes on the public resolvers and the front, and the DNS step names no name servers to set. A site's row has a button for the dialog "Send this domain's records to TurboDNS?". With MailServerPro installed, the zone gets TurboDNS's hosting template with the NAS's public addresses you confirm, and MailServerPro's DKIM, MTA-STS, TLS-RPT and TLSA records. Without it, a new zone gets its name servers and the address records of the site's names, and no mail records (D286); a zone TurboDNS already has keeps its own name servers. The dialog shows every change and what it overwrites; nothing is written before Send, and replacing the zone's name servers needs the zone's name typed. Without TurboDNS the Sites list has no DNS button, and the wizard's DNS step offers the registrar or provider only, with the records to add there when it has this NAS's address; on that side the address is optional, and without it the site is saved with no domain setup.
  • The domain guide's server side (D406): GET /api/domain/lookup?name= reads a domain's zone and name servers from the parent zone's servers, its registrar from the registry's RDAP server, and who answers for it: Cloudflare, OVHcloud, TurboDNS on this NAS, another provider, or nobody yet. For a zone at Cloudflare or OVHcloud, PUT /api/dns/keys/{zone} checks an API token or OVHcloud's three API keys against the zone and keeps the key only when the check reads the zone: one key per provider and zone, a 0600 file of the panel's account in <state>/secrets/dns/, never shown back (the list shows its rights and when it was checked). With the key, POST /api/dns/provider/plan lists the site's A and AAAA records it would add, replace or remove there, and POST /api/dns/provider/apply writes them: DNS only at Cloudflare, TTL 300 s at both, OVHcloud's zone refreshed after the writes. A zone TurboDNS on this NAS keeps gets its records through TurboDNS, and no key is taken for it. tools/webportico-links.mjs checks the guide's external links before a release.
  • The domain guide (D406): the wizard's first question is whether you have a domain. With one, the DNS step shows the lookup's lines (the zone, the registrar, its DNS servers, who answers for it) and the steps at that provider: Cloudflare's and OVHcloud's pages to make a key, with links and, where one exists, a picture behind a "?", then Check and keep; or the rows to copy there by hand; TurboDNS's name servers and glue with what the registrar has now; another provider's rows (with a CNAME for www), or the whole domain to TurboDNS. Not registered: Buy a domain; no DNS servers yet: Check again. The buy guide walks through OVHcloud's order in eight steps with pictures of its pages. With a key, the dry run lists the provider's rows under the site's plan and the apply writes them; the Overview's checklist has a row for them with Send records. Without the lookup (the parent's servers cannot be read), the step asks who answers for the zone, as before. tests/guide-shots.sh draws each path for the docs.

Who runs as whom

The panel runs as web-panel and holds no root right. What needs root goes through webpanel -agent, which runs as root beside it and takes one-line requests from a spool folder shared through the group: the servers' checks, writing the servers' files, starts, reloads and stops, the folders of a site, the database clients, the export into QTS, and reading QTS's ports and the programs that hold 80, 443 and the front's ports (D217). The agent takes names and ids from a request and no file content: it reads the sites from the panel's own file, validates them again and renders every file nginx, httpd and PHP-FPM read itself, into folders of root's (etc/web, agent/). It follows no link in the panel's folders (D194). webctl starts the agent, the panel and each site's PHP master again when one of them stops. Each site's PHP workers run as the site's own account ws-<ID> (uid 20000+ID), and so do the default site's, with the ID it got when the panel added it (D373). The agent alone makes and removes those accounts: it makes a site's account before the site's first check and removes it once the site is gone (D243). At each apply, a short-lived child of the agent's checks that a site's account and web-http can both enter a site's folder in a share (D248). The daemons run as accounts of their own (web-http for the servers' workers, web-mariadb, web-postgres, web-memcached, web-redis, web-percona when the Percona Server app is there, web-dbtool for Adminer (D458), and web-grafana, web-search, web-node for the optional services), added at the first start with ids between 190 and 499, without password, home or login shell, and kept when the package is removed (D165). web-php is the group of the caches' sockets, and every site account is in it (D243). web-dns runs nothing of its own: the agent sends a domain's records to TurboDNS through a short-lived child that runs as web-dns with TurboDNS's group tdns-clients, the only way onto TurboDNS's local socket, and webctl lists web-dns in that group when TurboDNS is installed (D216). web-acme runs lego for the certificates from Let's Encrypt, with its files in <data>/acme/lego; the agent checks and installs what lego gets, and adds or takes away a DNS-01 record through TurboDNS only when lego asks for one of the certificate's own _acme-challenge names (D220). web-tunnel runs cloudflared for the Cloudflare Tunnel, with the token the agent copies into <data>/tunnel (root's, the group web-tunnel, D311).

The control script

webctl (webctl/webctl, POSIX sh, run by the app's busybox) is the package's command:

webctl [-d DATA] init                  accounts, folders, MariaDB's and PostgreSQL's first run, Valkey's password
webctl [-d DATA] start|stop|restart|status [SERVICE...]
webctl [-d DATA] start|stop grafana|opensearch|ws    the optional services (D387)
webctl [-d DATA] start percona         Percona Server (D291): sets it up first when it has no data, then starts it
webctl [-d DATA] start|stop|status php8.N-ID    one site's PHP-FPM master, under supervise (D243)
webctl [-d DATA] start|stop|status valkey-ID|memcached-ID   one site's own cache server (D393)
webctl [-d DATA] caches [SERVICE...]  the sites' cache servers follow the tree (the agent runs it after every apply)
webctl [-d DATA] start|stop|status dbtool   the database tool's PHP-FPM pool (Adminer as web-dbtool, D458)
webctl [-d DATA] ports                 every port of the stack, where the front is, what holds 80 and 443
webctl [-d DATA] grafana-password      Grafana's admin password, read from stdin

A bare start (the package's own, at every boot, upgrade and start from App Center) starts the stack, then the optional services you started by name (D387). webctl start grafana writes grafana into <data>/etc/autostart, and from then on Grafana comes back with every start of the package, after a reboot too; webctl stop grafana takes it out again, and it stays down. OpenSearch and the websocket example work the same way. The package's start does not wait for them: they start one after the other in the background, <data>/logs/autostart.log says how each start went, and webctl status lists them (starting while the background start is still on its way). One that cannot start stops neither the sites nor the others. A bare stop stops them and keeps the file. An upgrade from 0.8.4 or older does not know what ran before it: start each one once by name.

The order is mariadb, percona, postgresql, memcached, redis (Valkey), web (each site's PHP-FPM master first, then nginx, httpd and the PHP-FPM masters of 0.4.0's configuration), tunnel (cloudflared, only once the panel's card made a tunnel; a start at boot goes on without it when it does not start), agent, panel. A site's master runs under webctl's supervise loop: it starts again when it exits, and it stays down after five exits within a minute (logs/php8.N-ID.log says so) or after an exit while WebPortico or QTS stops (D408). A bare stop writes <data>/run/stopping first, and only a bare start removes it. Settings are KEY=VALUE lines in <data>/etc/web.conf. Valkey's password is made once, kept 0600 and never printed. MariaDB's root signs in over its socket as the system's root; PostgreSQL's socket takes its own account only, and TCP takes a password. Percona Server is an app of its own beside web-server (make app-percona): a start or a status that names no service leaves it out until webctl start percona has set it up, which makes its system tables and lets root in only through auth_socket as web-percona. The panel's agent makes that call before every Percona database action, so the first Percona database sets the server up (D291). The panel offers the Percona engine where webctl passes it -percona-prefix, which it does when the prefix has an executable sbin/mysqld; without that flag there is no Percona engine, and a package without the app starts and behaves as it did before.

Root follows no link in a service account's folder. mariadb/, percona/, grafana/ and opensearch/ under the data folder are root's (0711); their children (data, tmp, Grafana's plugins, OpenSearch's logs and conf) are made by root and given to the account one by one, and nothing below them is chowned. A link where one of those children should be is removed instead of followed; a link or a file named data is refused and kept, since that folder may hold what you keep. The slow query log of MariaDB and Percona Server is <data>/<engine>/data/slow.log. The database tool's folders have the same shape (D458): <data>/run/dbtool is root's (0711), and its sessions and tmp are made by root and given to web-dbtool (0700); <data>/etc/dbtool, with the pool's files webctl writes at each start of dbtool, is root's (0755). The agent starts dbtool when the first database opens in Adminer, and it runs until the stack stops.

The agent rotates every log the package writes (D376): at 10 MiB, or after a week with lines, keeping five copies compressed with gzip (name.1.gz to name.5.gz). nginx and httpd open their logs again by their reload and a PHP master at SIGUSR1, so no request is lost; the panel's, the agent's and the database and cache servers' logs are copied and emptied in place. kill -USR1 $(cat <data>/run/agent.pid) rotates every log that holds anything at once. Grafana and OpenSearch rotate their own logs. An install made by 0.6.0, whose trees belong to the accounts, starts unchanged: init takes the parent folders for root and leaves the children as they are.

Valkey (D227) answers under the names the sites and the settings use: the service redis, the account web-redis, REDIS_PORT (9550), <data>/etc/redis.conf, the password in <data>/etc/redis.pass, the socket <data>/run/redis/redis.sock and the data in <data>/redis. The dump there is Valkey's own, and the start reads no dump of another server (D329).

Ports

Above 9000 (D184), clear of bucketvs (9950 to 9989) and QTS's services; everything but the front, the panel and the database tool listens on 127.0.0.1. The front moves to 80 and 443 only by a click on the panel's Front page (D217).

Port What
9541, 9540 the panel (HTTPS), and its plain-HTTP redirect to it (D182)
9542, 9543 the front (nginx) HTTP, HTTPS, and UDP 9543 for HTTP/3 when nginx has it; 80 and 443 once moved there
9544 httpd, on 127.0.0.1 behind the front
9546 Grafana
9547, 9552 OpenSearch HTTP, transport
9548 MariaDB
9549 PostgreSQL
9550 Valkey (and its socket)
9551 the websocket example
9553 the front's listener for cloudflared, the Cloudflare Tunnel's connector (127.0.0.1, D311)
9554 cloudflared's metrics, where the panel reads its connections (127.0.0.1, D311)
9555 Percona Server (and its socket <data>/run/percona/mysqld.sock)
9556 the database tool: Adminer's pages, served by the panel's program with the panel's TLS on an origin of their own (DBTOOL_PORT, D458)

memcached has a socket only; the shared caches' sockets are in <data>/run/redis and <data>/run/memcached, reached through the group web-php. Each PHP site's own Valkey and memcached (D393) listen on no port: their sockets are <data>/run/cache/site-<ID>/valkey.sock and memcached.sock, in a folder only the site's account enters, and the site's Cache tab shows them. The database tool's pool (D458) listens on no port either: its socket is <data>/run/dbtool/fpm.sock, which belongs to web-panel with the mode 0600, so only the panel reaches Adminer. Grafana has no known password: after its first start, run webctl grafana-password and type the admin's password (at least 12 characters; not shown while you type, and read from stdin when that is not a terminal).

What is in the app

Component Version From source x86_64 aarch64 Proven
Apache httpd (apr, apr-util) 2.4.68 yes built, checked (HTTP, HTTPS, HTTP/2) dynamic build, checked under qemu build VM
nginx 1.30.5 yes built, checked (HTTP, HTTPS, HTTP/2) dynamic build, checked under qemu build VM
MariaDB 12.3.3 yes built, checked dynamic build, checked under qemu build VM
Percona Server (its own app, web-percona) 8.4.11-11 yes built, checked in the Debian 12 builder (D273) not in the package build VM
PostgreSQL (libpq) 18.6 yes built, checked dynamic build, checked under qemu build VM
memcached 1.6.45 yes built, checked dynamic build, checked under qemu build VM
Valkey 9.1.2 yes built, checked (dynamic, Ubuntu 24.04 builder) not yet tried a cloud session's builder; the VM not yet
PHP 8.1 to 8.5 with PHP-FPM, PECL apcu, igbinary, msgpack, redis, memcached, xdebug, imagick, imap (8.4, 8.5) 8.1.34, 8.2.35, 8.3.36, 8.4.27, 8.5.12 yes built, checked, one request per version through both servers not yet tried build VM
Node.js 24.22.1 yes built by the recipe not yet tried websocket stack test and the package on a NAS
Grafana 13.2.4 backend yes (Go, vendored modules); the frontend public/ from the release built, checked not built (the recipe needs an x86_64 build machine) build VM, a NAS
OpenSearch 3.8.0 no: the release's jars (its Gradle build fetches dependencies while it runs) built, checked not yet tried build VM, a NAS
Temurin runtime 25.0.4.1+1 no: the vendor's JDK, cut down with jlink built, checked not yet tried build VM, a NAS
busybox, sqlite, openssl, curl 1.38.0, 3.53.4, 3.5.8, 8.22.0 yes built, checked not yet tried for this app build VM
ImageMagick (magick, convert; its delegates libjpeg-turbo, libpng, libwebp, libheif with libde265 and libaom; licences in share/doc/<name>; the package's policy, D394) 7.1.2-32 (libheif 1.23.6, libde265 1.1.3, libaom 3.15.3), imagick 3.8.1 yes built, checked (PNG, JPEG, WebP, GIF, AVIF written and read back; HEIC read) not yet tried for this app build VM
FFmpeg (ffmpeg, ffprobe; LGPL, its own codecs only, licence in share/doc/ffmpeg) 9.0.2 yes built, checked (MPEG-4 and AAC encoded, probed, decoded; a PNG frame) not yet tried for this app build VM, a NAS (D386)
lego 4.35.2 yes (Go, vendored module zips) built, checked (dynamic and static, Ubuntu 24.04 builder) cross-built, not run a cloud session's builder and tests/acme.sh; not the VM, not a NAS
Adminer (one PHP file, run by the database tool's pool; licence header in share/doc/adminer) 6.3.0 the release's single file, as upstream compiles it the recipe's build and check run by hand on the VM (not yet by the App Builder), and the file run through the panel against the app's MariaDB, PostgreSQL and PHP-FPM 8.4 (TestDBToolLive) the same file build VM (D458); not yet a NAS
cloudflared 2026.10.1 yes (Go, the tag's archive and vendored module zips) built offline from the vendored files, checked built offline, --version under qemu the build VM (tools/recipe-test.sh, TestTunnelLive) and .12: bucketvs 1.0.0-57's App Builder made the same file, and WebPortico 0.6.0 ran it for the tunnel

The package is signed and installs with qpkg_cli -m on QTS 6.1 and on QuTS hero, where the stack, the panel and the optional services (Grafana, OpenSearch with a small heap, the websocket example) run; the aarch64 package is not built (the arm trees are dynamic, and PHP, Node, Grafana and OpenSearch's runtime were never cross-built). MySQL is tried and not shipped (D163); OpenLiteSpeed is tried and not shipped (D161).

The data folder

The package keeps the sites, the databases and the panel's state in the folder that etc/data-dir in its install folder names, else in <install volume>/WebPortico, which the first start writes there. It looks at no other folder (D329; make migrate-test runs the test against a fake QPKG tree). An upgrade keeps the folder; App Center's removal deletes the install folder only, and a reinstall on the same volume uses <install volume>/WebPortico again.

From 0.4.0 to sites (0.5.0)

The first start of 0.5.0 reads every vhost of 0.4.0 or older as a site whose folder stays <data>/www/<name>, and the panel's first write keeps the old file as <data>/panel/panel.json.pre-sites (D242). The first apply gives each site's folder to the site's account. The step is one-way, because 0.4.0 reads no sites. Going back means installing 0.4.0 again, cp -p <data>/panel/panel.json.pre-sites <data>/panel/panel.json (after a round trip back to 0.4.0 and up again, the newest panel.json.pre-sites.<UTC time> instead), giving each site's folder back to web-php (chown -hR web-php:web-http <data>/www/<name>, and chown web-php:web-php <data>/logs/php), and a dry run and an apply in that version's panel. Keep the -h: a site's account can put links in its folder, and with -h chown changes those links and never what they point to. QTS's BusyBox 1.24.1 left the targets alone without it too, but a BusyBox built without its desktop option follows the links. A site made under 0.5.0 is not in that copy.

The description of each site account names the data folder (WebPortico site of <data folder>), which keeps the accounts of two installs apart (D243). After a move of the data folder (stop, mv, the new path in etc/data-dir, start) the start takes the install's own accounts back when the old folder is gone and the new folder holds the site's link, renders the servers' files again for the new folder with the certificates they had, and starts the sites; the servers' files are then what the applied sites render to, so the first dry run lists nothing the move caused, only what was pending before it (a dry run takes the accounts back too when the start did not, and lists them under "Accounts taken back"). Otherwise (a copy of the old folder still there, no link in the new folder because none of that folder's sites was ever applied, a path spelled another way) every dry run is refused and names a ws-<ID> line: edit the description of that line in /etc/passwd to WebPortico site of <the new folder> by hand, or remove those lines from passwd, group and shadow; the next dry run then makes them again with the same ids.

Build and test

make app build activate     # the App Builder app web-server, through bvsd's API (bvsapp.sh, root, the IDE's terminal)
make app-percona            # Percona Server's own app web-percona (then make build activate APP=web-percona); make qpkg packs it
make test                   # the panel's unit tests, webctl's checks, the data folder's test (migrate-test.sh), the MIME types (mime-types-test.sh)
make sites-e2e              # the Sites page, the wizard and the site page in Chromium over the panel's mock
make live-test              # as root, on the activated app: init, start, the panel's API, every server, stop
make qpkg                   # WebPortico with QDK (BVS_DATA names the package's data folder)

make qpkg runs scripts/make-qpkg.sh; --stage-only lays out build/qpkg and stops before qbuild. To sign the package, give the folder of the code-signing files in QPKG_CERT_DIR, or put certificate and private_key (and ca_certs, the chain) beside qpkg/qpkg.cfg (.gitignore keeps them out of git). The packer places them 0600 beside the staged qpkg.cfg for the qbuild call only and removes them right after it, and no signing file stays in build/qpkg after a run that ends, fails or stops before qbuild (TestWebServerPackerLeavesNoSigningFiles). In CI, the workflow writes them from the repository's Actions secrets QPKG_CERTIFICATE and QPKG_PRIVATE_KEY (and QPKG_CA_CERTS, the chain), each the file's PEM text or its base64, into a folder of its build step that QPKG_CERT_DIR names, and removes it when the step ends (D370).

scripts/live-test.sh runs the stack on free ports in a scratch data folder and drives the panel with curl: the first sign-in, sites on both servers with a dry run each, a request to each, PHP versions, a database of each engine, a self-signed certificate, the websocket example through a proxy site on each server, a snapshot restored, the export's dry run on QTS, and webctl stop. The sites of D242 to D248: accounts, isolation, per-site PHP, a crash, a LAN proxy, Fix permissions (scripts/live-test.sh); the wizard and the site page in Chromium over the panel's mock (make sites-e2e). scripts/webctl-test.sh checks webctl's accounts and folders against a scratch root. scripts/mime-types-test.sh checks the MIME types make-qpkg.sh adds (scripts/mime-types.sh) on small lists and, when the app is at /usr/app/web-server or MIME_APP, on the app's own lists with a real nginx and httpd serving a file of every added extension. With the app at WEBPANEL_NGINX_PREFIX (root), panel/htaccess_test.go runs Apache 2.2's access lines and Satisfy Any on the default site and an httpd site (D384), and panel/qtsphp_test.go posts a 50 MB file to the default site's PHP with QTS's limits (D385). tests/sites-e2e.sh (make sites-e2e) serves the panel over a stand-in agent (panel/mock_test.go, build tag e2emock) and drives the Sites page, the Add site wizard and the site page with tools/webportico-e2e.mjs, without root or the app; with --live, the same script runs the wizard on a test NAS. tests/e2e.sh (root) drives the page over the app's real servers and databases in the builder environment. tests/dns-dialog.sh (root) drives the DNS dialog in headless Chromium over TurboDNS's real panel and socket and MailServerPro's real generator, in a private mount namespace. tests/front.sh (root, FRONT_PREFIX names the app) drives the Front and ports page in headless Chromium over the app's nginx and httpd, with QTS played by scratch files and small servers on 80, 443 and 8081: the proposal, the import, websockets through the front, the one-click move to 80 and 443, HTTP/3 when nginx has it, and the way back. tests/acme.sh (root, ACME_PREFIX names the app) gets certificates from Pebble, Let's Encrypt's test server, in private mount and network namespaces, through the TLS page in headless Chromium: HTTP-01 over the app's nginx, DNS-01 through TurboDNS's real panel over PowerDNS, DNS-01 through a stand-in for Cloudflare's API, Renew now, the renewal job after an agent restart, a failed request.

Layout: panel/ the panel, webctl/ the control script, ws/ the websocket example, tests/ the stack tests (php-stack.sh, ws-stack.sh), qpkg/ the package's files, scripts/ the package build and the live test, LICENSE the licence of the project's own code (below).

License

LICENSE is the Bucket & Code Server IDE Freeware Licence 1.0, the license of WebPortico's own code: the panel (panel/), webctl, the service script and the scripts. It is byte-equal to the repository's LICENSE (TestWebPorticoShipsItsOwnLicence holds it so). scripts/make-qpkg.sh installs it in the package as share/licenses/webportico/LICENSE and stops when the file is missing, and QPKG_LICENSE in qpkg/qpkg.cfg names it before the bundled programs' licences. Each bundled program keeps its own licence files where its build put them in the app tree (app/share/doc/<program>/ for the ones that install any).

The icon

qpkg/icons/ holds QDK's three icons (since D283): the package's icon, the same at 80 px and the grey one for a stopped package, each a 256 px PNG under a .gif name. The picture is a server stack with an infinity sign, recoloured to blue from an isometric icon in an archive the owner supplied. The archive states no licence, and its file names suggest artwork made for a hosting provider's pages; using it is the owner's decision of 2026-10-08. The earlier packages had no icon of their own (QDK's default), so taking this one out again is one revert of that change.


A public example from Bucket & Code Server IDE, the QNAP QPKG that turns a NAS into a build and publishing environment. This copy is generated by tools/publish-examples.sh from the product's own example library; changes made here are not read back into it. The wizard's New Project page builds one of these yourself, with your own name and account.