Setting up the SaaS module on a VPS or dedicated server without cPanel. This guide covers Apache and Nginx configurations.
If your server doesn't have cPanel (for example, you're using a VPS from DigitalOcean, AWS, Linode, Vultr, etc.), you'll need to configure your web server manually. Don't worry β we'll walk you through every step.
What is a VPS? A VPS (Virtual Private Server) is like having your own mini-server in the cloud. It gives you full control over your server settings, which is actually better for running a SaaS platform because you have no limitations on databases, domains, etc.
Before You Start
Make sure you have:
SSH access to your server (you'll need to run commands in the terminal)
Root or sudo access (to edit server configuration files)
First, figure out which web server you're running. Connect to your server via SSH and run:
# Check if Apache is running:apache2-v# orhttpd-v# Check if Nginx is running:nginx-v
Now follow the section that matches your web server.
Apache Configuration
If you're running Apache (the most common web server for PHP applications):
For Subdirectory Mode (/ws/tenant-name)
Subdirectory mode usually works out of the box with Apache if mod_rewrite is enabled. Verify it's enabled:
Make sure your Perfex CRM's .htaccess file exists in the root directory. The module adds its own rewrite rules automatically.
For Subdomain Mode (tenant-name.yoursite.com)
You need to configure Apache to handle wildcard subdomains:
Edit your Apache virtual host configuration:
Add or modify the ServerAlias to include a wildcard:
Restart Apache:
What does ServerAlias *.yoursite.com mean? It tells Apache: "Any request that comes to ANY subdomain of yoursite.com should be handled by this virtual host." So whether someone visits acme.yoursite.com or bigco.yoursite.com, Apache knows to send it to your Perfex CRM, and the SaaS module figures out which tenant to show.
Nginx Configuration
If you're running Nginx:
For Subdirectory Mode
Subdirectory mode usually works with the standard Nginx configuration for Perfex CRM. Make sure your location block includes the try_files directive:
For Subdomain Mode
For wildcard subdomain support in Nginx:
The key change is adding *.yoursite.com to the server_name directive.
After editing, test and restart Nginx:
Step 2: Configure MySQL (No cPanel)
Since you don't have cPanel, you need to ensure your MySQL user has the right privileges:
Security tip: Replace 'your-strong-password-here' with an actual strong password! Use a password generator if needed. And NEVER use root as your MySQL user for the SaaS module in production.
Now go to your SaaS Settings and enter these MySQL credentials:
Field
Value
I have cPanel
No
MySQL Host
localhost
MySQL Port
3306
MySQL Root Username
saas_admin
MySQL Password
The password you set above
Click "Click here to verify server settings" to confirm everything works.
Step 3: Set Up DNS
Follow the DNS & Domain Configuration guide to set up your DNS records based on which URL structure you chose.
Step 4: File Permissions
Make sure the following directories are writable by the web server:
Testing Your Setup
Create a test plan in SaaS Management β Plans
Visit your landing page URL
Register a test tenant
Check that the tenant's database was created (look in MySQL: SHOW DATABASES;)
Access the tenant's CRM URL and verify it works
If everything works β congratulations! Your manual server setup is complete.
Common Issues on VPS/Dedicated Servers
Issue
Cause
Fix
Subdomains show "404 Not Found"
Apache/Nginx not configured for wildcard
Add ServerAlias *.yoursite.com (Apache) or server_name *.yoursite.com (Nginx)
"Access denied" MySQL errors
MySQL user lacks privileges
Run the GRANT ALL PRIVILEGES command above
File upload errors
Directory permissions too restrictive
Run the chown and chmod commands above
Blank white page
PHP error β check logs
Check /var/log/apache2/error.log or /var/log/nginx/error.log
All set? Next, configure SSL certificates to secure your platform with HTTPS.
sudo nginx -t # Test configuration (should say "OK")
sudo systemctl restart nginx # Apply changes
# Connect to MySQL as root:
sudo mysql -u root -p
# Create a dedicated user for the SaaS module (recommended):
CREATE USER 'saas_admin'@'localhost' IDENTIFIED BY 'your-strong-password-here';
# Grant all necessary privileges:
GRANT ALL PRIVILEGES ON *.* TO 'saas_admin'@'localhost' WITH GRANT OPTION;
# Apply the changes:
FLUSH PRIVILEGES;
# Exit MySQL:
EXIT;
# Set proper ownership (replace www-data with your web server user):
sudo chown -R www-data:www-data /var/www/html/perfex/modules/saas/
# Set proper permissions:
sudo chmod -R 755 /var/www/html/perfex/modules/saas/