Root Domains

Each tenant is assigned a subdomain on one of your root domains during setup. You may add multiple root domains to your server.

Creating root domains

The first step to creating a root domain is registering it in the admin panel. You can do so by accessing "Add domain" page (under the "Domains" menu item).

Root domain integration

You must ensure that all requests are redirected to your application. Depending on your server setup you will have to follow different steps.

WHM + Apache

1. Log in to cPanel and add the new root domain as an add-on domain (this will create the DNS entry)
2. Create a wildcard which points to your application's directory

Additional steps for multi-software mode:
3. Log in to your server via SSH or FTP
4. Navigate to /usr/local/apache/conf/userdata/std/2_4/CPANEL_USER/wildcard_safe.DOMAIN/ (Apache 2.4) or /usr/local/apache/conf/userdata/std/2_2/CPANEL_USER/wildcard_safe.DOMAIN/ (Apache 2.2)
5. Create multihoster.conf with the following content:

RewriteEngine On
RewriteMap rmap "txt:PATH_TO_MULTIHOSTER/software/cache/map/map.txt"
RewriteCond %{HTTP_HOST} (.*) [NC]
RewriteRule (.*) /PATH_TO_MULTIHOSTER/software/${rmap:%1}/$1 [L]

6. Execute /scripts/rebuildhttpdconf in SSH. This will rebuild the virtualhost file and include the extra configuration.
7. Reboot the server

Apache

1. Open your virtualhost file (httpd.conf)
2. Append the following virtual host to the file
<VirtualHost SERVER_IP:80>
    ServerName _wildcard_.YOURDOMAIN
    ServerAlias *.YOURDOMAIN
    DocumentRoot /PATH_TO_MULTIHOSTER/software/SOFTWARE
</VirtualHost>

If you are using multi-software mode you will have to use the following virtualhost instead:

<VirtualHost SERVER_IP:80>
    ServerName _wildcard_.YOURDOMAIN
    ServerAlias *.YOURDOMAIN
    DocumentRoot /PATH_TO_MULTIHOSTER/software/

    RewriteEngine On
    RewriteMap rmap "txt:PATH_TO_MULTIHOSTER/software/cache/map/map.txt"
    RewriteCond %{HTTP_HOST} (.*) [NC]
    RewriteRule (.*) /PATH_TO_MULTIHOSTER/software/${rmap:%1}/$1 [L]
</VirtualHost>

3. Reboot the server

You must create an root A entry pointing to your server's IP using the DNS management service provided by your registrar. Alternatively you can point the domain to your nameservers but you will have to create the appropriate DNS zone using your DNS management software.