SaaS Module for Concord CRM
๐Ÿ‘‰ Get it now!Concord CRM modules ยป
  • ๐Ÿ™ŒSaaS module for Concord CRM
  • Getting Started
    • โšกRequirements
    • ๐Ÿ› ๏ธActivating the module
    • ๐Ÿ”ŒConfiguring the module
      • ๐Ÿ’ป1) Webhost Configuration
        • cPanel
        • Plesk
        • CloudPanel
        • Virtualmin
        • All other / No Panel (nude) setups
        • MySQL Root
      • ๐ŸŒ2) DNS & SSL Settings
        • cPanel DNS settings for Wildcard Subdomain + SSL Support
        • Plesk DNS settings for Wildcard Subdomain + SSL Support
        • CloudFlare DNS settings for Wildcard Subdomain + SSL Support
        • All other providers / Self hosted
      • โš™๏ธ3) Module's General Settings
      • ๐Ÿ”—4) Module's Integration Settings
  • How to use saas module
    • ๐ŸŽฏCreating a quota
    • ๐Ÿ“ฆCreating a package
    • ๐Ÿ›๏ธTenant Self-Registration (frontend)
    • ๐Ÿ—๏ธCreating a Tenant (backend)
    • โœ๏ธEditing a Tenant
    • โŒDeleting a Tenant
    • ๐ŸŒCustom Domain support
    • Common Tenant operations
    • ๐Ÿ“„Page & template management
    • ๐Ÿ“ฆInvoice Module Integration โ€“ Enabling monitization features
Powered by GitBook
On this page
  • โš™๏ธ Requirements
  • ๐Ÿš€ What Happens Automatically?
  • ๐Ÿ“„ Web Server Configuration
  1. How to use saas module

Custom Domain support

Our SaaS module supports custom domains, allowing tenants to connect their own branded domains (e.g., clientdomain.com) to access their tenant space.

PreviousDeleting a TenantNextCommon Tenant operations

Last updated 1 month ago

โš ๏ธ Automatic support for custom domains is only available on dedicated servers or VPS environments, as it requires direct web server configuration. For cPanel, enabling Addon domain with API access to addon domain will be enough.


โš™๏ธ Requirements

To enable custom domain routing and automatic resolution:

  • The SaaS must be hosted on a dedicated server or VPS.

  • You must have root access to configure Nginx or Apache2.

  • Tenants must correctly configure their DNS A record pointing to your server's IP which will be sent via email for the tenant.

  • SaaS public directory should be consistent for all domains (e.g., /srv/yourDomain.com/public).


๐Ÿš€ What Happens Automatically?

  • Once your web server is configured, any tenant that maps a custom domain will be automatically routed to the correct application entry point.

  • All tenants share the same codebase.

๐Ÿ’ก Note: If you don't have wildcard domain routing configured, you can download a set of instructions which will give you instructions on how to download and run an automated shell script to add the necessary configuration for each tenant.

Simply click the "Download Instructions" action on the Tenants list page to get started.


๐Ÿ“„ Web Server Configuration

Below are the configurations for Nginx and Apache2 to support wildcard/catch-all domain routing.


๐ŸŸฉ Nginx Configuration (Recommended)

1. Update Default Server Block

Open the default server block file:

sudo nano /etc/nginx/sites-available/default

Replace or update it with:

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name _;  # Catch-all for any domain

    root /srv/yourDomain.com/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;
    charset utf-8;

    access_log /var/log/nginx/vhost_$host.access.log;
    error_log  /var/log/nginx/vhost_$host.error.log;

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

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ ^/index\.php(/|$) {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; # Adjust PHP version
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_hide_header X-Powered-By;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

2. Configure Dynamic Logging

Open /etc/nginx/nginx.conf:

sudo nano /etc/nginx/nginx.conf

Add this inside the http block:

log_format vhost '$host $remote_addr - $remote_user [$time_local] '
                 '"$request" $status $body_bytes_sent '
                 '"$http_referer" "$http_user_agent"';

3. Test and restart Nginx

sudo nginx -t
sudo systemctl restart nginx

๐ŸŸฆ Apache2 Configuration

Apache requires enabling wildcard domain support in its VirtualHost setup.

1. Create a Catch-All Virtual Host

Open your default config file:

sudo nano /etc/apache2/sites-available/000-default.conf

Update it with:

<VirtualHost *:80>
    ServerName _default_

    # DocumentRoot should point to your Laravel public folder
    DocumentRoot /srv/yourDomain.com/public

    # Custom dynamic logging based on the domain name
    CustomLog "|/usr/bin/tee -a /var/log/apache2/vhost_%v.access.log" vhost_combined
    ErrorLog /var/log/apache2/vhost_%v.error.log

    <Directory /srv/yourDomain.com/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    # Pass PHP scripts to PHP-FPM (adjust sock path accordingly)
    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost"
    </FilesMatch>
</VirtualHost>

Replace /srv/yourDomain.com/public with your actual Laravel public path.

2. Enable Required Apache Modules

sudo a2enmod rewrite proxy_fcgi setenvif
sudo systemctl restart apache2

๐ŸŒ