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 domain | Addon domain | |
|---|---|---|
| Document root | Shared with the main domain | Its own, e.g. /home/user/shop.example.com |
| Site served | The same site | A different site |
| PHP version | Same as the account | Can differ from the account |
| Configuration | Added to the account's vhost | Its own vhost and PHP-FPM pool |
| Created from | The account's Advanced settings page | The 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 placeholderindex.php; - the vhost
/etc/nginx/conf.d/test.domain.dom.conf(or/etc/httpd/conf.d/on Apache), redirecting:80to: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
| Option | Default | What it does |
|---|---|---|
--user=USERNAME | required | The existing hosting account that will own the domain. It must already exist in Reqad. |
--domain=DOMAIN | required | The 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=VERSION | the server's default PHP | PHP 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=HANDLER | mod_php or fpm | fpm 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-www | — | Does not add www.<domain> to the vhost. Useful for subdomains. |
--no-ssl | — | Creates only the plain :80 vhost - no https vhost and no certificate. |
--letsencrypt | — | Requests 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-run | — | Prints the vhost it would write and changes nothing. Worth running first. |
-h, --help | — | Lists 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
--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
| Option | Default | What it does |
|---|---|---|
--domain=DOMAIN | required | The addon domain to remove. Its vhost and PHP-FPM pool are deleted and the web server is reloaded. |
--delete-docroot | keeps the files | Also deletes the document root and everything in it. Without it, the site's files are left on disk. |
--delete-cert | keeps the certificate | Also deletes the Let's Encrypt certificate, so it is no longer renewed. |
--dry-run | — | Prints what would be removed and deletes nothing. |
-h, --help | — | Lists every option. |
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.