How it works
Websites and PHP
How a site's configuration is written and validated before it is served, how several PHP versions run side by side, and what a customer may and may not change.
A site is static, PHP, or a reverse proxy. It can carry domain aliases, and its document root lives inside its account's home, never outside it.
Configuration is validated by the server itself
The danger in a control panel is that a bad form value turns into a broken configuration file, which takes down every other site on the machine at the next reload.
So a write always follows these steps:
- render the configuration to a temporary file,
fsyncand rename it atomically into place,- ask the server's own validator to check the result,
- reload, and if either the validation or the reload refuses, put the previous file back.
The validator is the one the server itself ships. It is not a parser this project wrote, which might accept what the server would reject.
Values are validated, not escaped
A domain is checked to be a domain: letters, digits, hyphens and dots. Nothing is escaped, because there is no newline in the result that could end one directive and start another of the caller's choosing. The same rule holds everywhere a value reaches a configuration file.
Names that are not a public host name are refused as well, for sites, aliases and certificates: an IP
address (any name whose last label is a number), localhost and its subdomains, the special-use
suffixes .local, .localdomain, .internal, .lan, .home.arpa and .invalid, and the panel's
own host name, also with www.. FTPS applies the fixed set but does not check the panel's own name.
The refusal says only that the name cannot be used and never repeats it. A site that already exists
under such a name is not removed; it can still be disabled and deleted.
One consequence to know: a reverse-proxy upstream is checked for shape rather than for destination, so a site can be pointed at a service on the same machine's loopback.
Aliases
A site answers on its own domain and on up to 99 aliases, the additional host names the same vhost serves. The limit is not a plan setting. One certificate can name at most 100 hosts and the site's own domain is one of them, so 99 aliases is the most a single certificate for the site can cover.
The create-site form counts the list as you type ("3 of 99 additional hostnames."), says "A site can
have at most 99 additional hostnames." as soon as it is too long, and does not create the site until
it fits. The server enforces the same bound whatever the form shows: a request with more aliases is
refused with 400 SiteAliasLimitExceeded, "A site cannot have more additional hostnames than one
certificate can cover.", and the server agent refuses it too for every operation that writes the
site's configuration. Disabling or deleting a site still works whatever it carries. A program can
read the bound from GET /api/v1/sites/limits, which answers {"maximumAliases": 99}.
Closed sets are chosen, not typed
Where a value must come from a fixed set, the interface offers a list instead of a text box, and the
list comes from the server. The backend picker on the create-site form and the backend and state
filters on the sites list are read from GET /api/v1/sites/choices, which answers each option as a
value and a label already written in the language of the interface. The PHP version picker lists
only the versions installed on the server. The list is advice: the server checks every submitted value
against the same set, and a value outside it is refused whatever the form allowed.
Several PHP versions at once
Each account gets its own php-fpm pool per version, running as that account's Linux user, with the worker budget its plan allows. Two customers on the same server can run different PHP versions, and neither can read the other's files, because the pools run as different users.
An administrator adds a version from Sites and domains → PHP versions by choosing it from a list. It cannot be typed in. The list holds the versions the server's package repository can install, newest first; versions the server already has are left out. The panel validates the chosen version against the same list again on the server, so a version outside it is refused with a clear message and never reaches the package manager.
Each pool listens on a unix socket in /run/maran-php, a directory of its own that the installer
creates and recreates at every boot. It is world-traversable (root:root, mode 0755) so the web
server can reach the sockets. Each socket file stays 0660 and belongs to the web server's user, so
an account cannot connect to another's pool. The agent's own /run/maran stays private
(root:maran, 0750) and holds no PHP sockets. On a server installed before this change, the panel rewrites each PHP site's pool and then its vhost
when it starts after the upgrade. No manual step is needed.
Customers may change a whitelisted subset of settings. A name outside that list is refused, not
quietly dropped, so nobody believes a setting applied when it did not. The hardening
lines above their settings are written as php_admin_value, which a customer's own setting cannot
countermand.
Logs
Access and error logs stream into the interface live. The stream names a site and a log kind, never a path. It has limits: each account can have only so many open at once, and a heartbeat keeps a quiet log from looking like a dead connection.