Plesk

βœ… Requirements

Before configuring, ensure:

  • Your Concord CRM instance is successfully hosted on Plesk.

  • You have root or admin access to Plesk.

  • Your server supports Let's Encrypt extension (pre-installed in most Plesk environments).

  • Your domain’s DNS is managed via Plesk or you can modify DNS records.

  • SaaS module is installed and activated in Concord CRM.


🧭 Goal

Enable multi-tenant SaaS routing with:

  1. Automatic database provision for new tenants

  2. Wildcard Subdomain Support (e.g. tenant1.yoursaas.com)

  3. Custom Domain Support (e.g. clientdomain.com)

  4. Automatic SSL (via Let’s Encrypt) for both


βš™οΈ Step-by-Step Configuration

1. Set Public Document Root

Ensure your web root for Concord CRM (usually /httpdocs/public) is correctly set in Plesk:

  • Go to Websites & Domains > Hosting Settings

  • Set Document Root to:

    httpdocs/public

This ensures all tenants and domains serve from the same entry point.


2. Configure Wildcard Subdomain Support

πŸ›  A. Set Wildcard DNS Record

  1. Go to Websites & Domains > DNS Settings

  2. Add a record:

    Type: A  
    Domain: *.yoursaas.com  
    Points to: Your Plesk server's IP

πŸ“Œ This allows all subdomains like tenant1.yoursaas.com, tenant2.yoursaas.com, etc. to resolve to your server.

πŸ” B. Enable Wildcard SSL (Let's Encrypt)

  1. Go to Websites & Domains > SSL/TLS Certificates

  2. Click Install Let's Encrypt

  3. Select:

    • yoursaas.com

    • *.yoursaas.com βœ… (Wildcard)

  4. Click Install

Note: Wildcard SSL requires DNS-based validation. Plesk handles this automatically if DNS is managed within Plesk.


Plesk internally manages Nginx/Apache, but if you're using custom server configuration via root SSH access:

For Apache:

<VirtualHost *:80>
    ServerName _
    DocumentRoot /var/www/vhosts/yoursaas.com/httpdocs/public
    CustomLog "|/usr/bin/tee -a /var/log/apache2/vhost_%v.access.log" vhost_combined
    ErrorLog /var/log/apache2/vhost_%v.error.log
</VirtualHost>

For Nginx (If used):

server {
    listen 80 default_server;
    server_name _;
    root /var/www/vhosts/yoursaas.com/httpdocs/public;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

4. Configure Custom Domain Support for Tenants

When a client wants to use a custom domain (e.g., clientdomain.com):

πŸͺͺ Ask the Client to Point DNS

The client should set their A record like so:

Type: A  
Host: @ (or root)  
Value: <Your Server IP>  

Optionally:

makefileCopyEditType: CNAME  
Host: www  
Value: clientdomain.com  

πŸ”„ SSL Renewal & Maintenance

  • Let’s Encrypt in Plesk auto-renews SSL certificates every 60–90 days.

  • Ensure:

    • Port 80 and 443 are open

    • DNS continues to resolve correctly

  • You can verify SSL status via:

    • Plesk Dashboard

    • SSL Labs


πŸ“Œ Troubleshooting

Issue
Resolution

Subdomain doesn’t resolve

Check wildcard DNS record (*.yoursaas.com)

Custom domain shows default

Ensure it is added as a separate domain with correct document root

SSL error on custom domain

Ensure Let’s Encrypt is installed and domain points to the server IP


Last updated