Addon domains

An addon domain is an extra website hosted under an existing account. It shares the account's system user and home directory, but gets its own document root, its own web-server vhost and - if you want - its own PHP version, independent of the account's main domain.

Addon domain or alias domain?

Alias domainAddon domain
Document rootShared with the main domainIts own, e.g. /home/user/shop.example.com
Site servedThe same siteA different site
PHP versionSame as the accountCan differ from the account
ConfigurationAdded to the account's vhostIts own vhost and PHP-FPM pool
Created fromThe account's Advanced settings pageThe command line (see below)

Use an alias when several domains should serve one site. Use an addon domain when one account should host several different sites - a staging copy on a subdomain, a second project for the same customer, or a legacy site that still needs an older PHP.

Create an addon domain

Addon domains are created on the server, as root:

/usr/local/reqad/scripts/adddomain \
  --user=username \
  --domain=test.domain.dom \
  --php=8.3

That creates:

  • the document root /home/username/test.domain.dom, owned by the account user, with a placeholder index.php;
  • the vhost /etc/nginx/conf.d/test.domain.dom.conf (or /etc/httpd/conf.d/ on Apache), redirecting :80 to :443;
  • a certificate - an existing Let's Encrypt one if the domain already has it, otherwise a self-signed placeholder;
  • a PHP-FPM pool for the chosen PHP version, listening on its own socket so it is independent of the account's main domain.

The configuration is tested before it is applied. If the web server rejects it, the vhost and the pool are removed again and nothing is reloaded.

adddomain options

OptionDefaultWhat it does
--user=USERNAMErequiredThe existing hosting account that will own the domain. It must already exist in Reqad.
--domain=DOMAINrequiredThe domain (or subdomain) to add. It must not already be another account's main domain, and must not have a vhost yet.
--docroot=PATH/home/<user>/<domain>Document root. It has to stay under the account's home directory, because open_basedir is set to /home/<user>.
--php=VERSIONthe server's default PHPPHP version for this domain, e.g. 7.4, 8.2, 8.3. It must be one of the versions installed on the server (see PHP versions).
--handler=HANDLERmod_php or fpmfpm runs the domain in its own PHP-FPM pool; mod_php uses the Apache module. nginx has no mod_php, and mod_php only ever runs the server's default PHP version - any other version needs fpm.
--no-wwwDoes not add www.<domain> to the vhost. Useful for subdomains.
--no-sslCreates only the plain :80 vhost - no https vhost and no certificate.
--letsencryptRequests a Let's Encrypt certificate once the vhost is live. The domain has to resolve to this server first; if it does not, the self-signed certificate stays and you get a warning.
--dry-runPrints the vhost it would write and changes nothing. Worth running first.
-h, --helpLists every option.

Examples

A staging subdomain on an older PHP, without a www. hostname, with a real certificate:

/usr/local/reqad/scripts/adddomain \
  --user=username \
  --domain=test.domain.dom \
  --php=7.4 \
  --no-www \
  --letsencrypt

On an Apache server, a second site on PHP 7.4 through mod_php while the account's main domain stays on PHP 8.1 with PHP-FPM:

/usr/local/reqad/scripts/adddomain \
  --user=username \
  --domain=old.domain.dom \
  --php=7.4 \
  --handler=mod_php

See what would happen, without touching the server:

/usr/local/reqad/scripts/adddomain \
  --user=username --domain=shop.domain.dom --dry-run
DNS is not created for you. Point the addon domain at the server yourself, at your registrar or DNS provider, before requesting a certificate with --letsencrypt.

Manage addon domains in the panel

The panel lists every addon domain under Accounts & Domains → Addon Domains, with its account, document root and PHP version. From the list you can:

  • Manage - switch the domain to another PHP version, or between PHP-FPM and mod_php on Apache. Only this domain changes; the account and its main domain keep running what they run.
  • Delete - remove the domain's vhost and PHP-FPM pool, optionally together with its document root and all its files.

The section is hidden unless it is enabled in /usr/local/reqad/etc/server-software.ini:

[reqad]
addon_domains=1

The default is addon_domains=0. New domains are always added from the command line - the panel page lists and manages what adddomain created.

Delete an addon domain

From the command line, the counterpart to adddomain is:

/usr/local/reqad/scripts/deldomain --domain=test.domain.dom
OptionDefaultWhat it does
--domain=DOMAINrequiredThe addon domain to remove. Its vhost and PHP-FPM pool are deleted and the web server is reloaded.
--delete-docrootkeeps the filesAlso deletes the document root and everything in it. Without it, the site's files are left on disk.
--delete-certkeeps the certificateAlso deletes the Let's Encrypt certificate, so it is no longer renewed.
--dry-runPrints what would be removed and deletes nothing.
-h, --helpLists every option.
Main domains are safe. Both scripts, and the panel page, only ever act on vhosts that adddomain wrote and marked as addon domains. An account's main domain cannot be edited or deleted this way - remove the account itself from Accounts if that is what you want.

Good to know

  • An addon domain has no separate quota or disk usage figure: its files live in the account's home and count towards the account.
  • Each addon domain that runs PHP-FPM gets its own pool and its own socket, so a busy addon site cannot exhaust the main domain's PHP workers.
  • open_basedir, disable_functions, the temporary directory and the error log follow the same hardening as a normal account.
  • Email is a per-account setting and is not affected by adding domains this way.

Need a hand? Register for early access or contact us.