8 Best Practices for CloudPanel Subdomains Management
Need an easy way to manage subdomains? CloudPanel Subdomain allows you to create and manage subdomains in your hosting setup. It’s great for staging websites, running custom apps, or organizing content.
This tutorial covers how to set up CloudPanel subdomains in clear steps.
Key Takeaways
-
CloudPanel Subdomain allows you to create and manage subdomains with convenience.
-
Using subdomains in CloudPanel keeps you organized. They allow you to test new features.
-
6 steps to set up a subdomain in CloudPanel are quick and easy.
-
Manage many subdomains in CloudPanel and maintain the organization.
-
Managing subdomains in CloudPanel with recommended methods keeps your websites protected.
What is a CloudPanel Subdomain?
A CloudPanel subdomain is a secondary domain. The CloudPanel control panel ties it to your main domain. Subdomains help you organize your website into sections or run apps on the same domain. For example, you might have blog.example.com or shop.example.com.
You can add a subdomain in CloudPanel with minimal effort. Set up SSL certificates and DNS records with little effort.
Why Use Subdomains in CloudPanel?
1. Organized Website Structure
Subdomains allow you to break your site into clear sections. For example:
-
blog.example.com is for your blog
-
shop.example.com is for your store.
This keeps your site organized and accessible. Plus, it all stays under one root domain.
2. Management and Control
With CloudPanel, you can add and manage a subdomain by clicking a few buttons. You can set root directories. You can also configure DNS records and add SSL certificates for each subdomain. This gives you full oversight over your site’s structure.
3. Security and Isolation
CloudPanel keeps subdomains separate by using different document roots and PHP-FPM pools. This setup lowers the chance of problems affecting many subdomains. Add SSL certificates and access controls for each subdomain. Keep CloudPanel updated to the v2.5.1 release. This will help fix known vulnerabilities.
4. Flexibility for Development and Testing
Subdomains are great for testing new features and design changes. You can do this without affecting your main website. They are perfect for staging sites or private testing. You can password-protect them until they are ready for the public.
5. SEO and Audience Targeting Benefits
Subdomains help you create unique experiences. You can have region-specific content. This can serve different audiences better.
6. Simplified Collaboration and User Roles
CloudPanel lets you manage many users with different permissions. You can give team members or clients access to specific subdomains. This way, they do not need full server access. This keeps your site secure while making collaboration easier.
6 Steps to Create a Subdomain in CloudPanel
Step 1: Log in to CloudPanel
Start by logging into your CloudPanel account with your credentials.
Step 2: Add the Subdomain
-
Go to the Sites section > Add Site button.
-
Enter your subdomain name (e.g., blog.example.com).
-
Set the Document Root to store your files.
-
Choose the right Vhost Template and PHP Version based on your application needs.
Step 3: Configure DNS Settings
-
Head to your DNS provider’s dashboard.
-
Add an A record for your subdomain.
-
Point it to your server’s IP address.
-
Be patient as DNS propagation takes time. It can take up to 48 hours.
Step 4: Set Up SSL/TLS
-
In CloudPanel’s SSL section, you can get a free Let’s Encrypt certificate.
-
Upload your certificate. This secures your subdomain with HTTPS, which is important for production sites.
Step 5: (Optional) Adjust Advanced Settings
If needed, you can make further adjustments in CloudPanel:
-
Change the document root.
-
Change NGINX vhost settings.
-
Select or create a PHP-FPM pool for resource management.
-
Enable Basic Auth to protect staging or development environments.
Step 6: Upload Content
Upload the files for your new website or application to the document root of your subdomain.
5 Steps to Manage Multiple Subdomains in CloudPanel?
Step 1: Set Up DNS Records for Each Subdomain
-
Log in to your DNS provider and add A or CNAME records for each subdomain.
-
Point them to your server’s IP address.
-
If using AWS, CloudPanel supports managing DNS entries via AWS Route 53.
-
After creating records, check if DNS propagation is complete before moving ahead.
Step 2: Organize Files by Document Root
-
Each subdomain has its root folder (e.g., /home/cloudpanel/htdocs/blog.example.com).
-
Keep files for each site separate.
-
This setup helps manage your applications better.
Step 3: Create PHP-FPM Pools for Each Subdomain (Optional)
-
You can create separate PHP-FPM pools if your sub-domains run different applications. This strengthens protection and oversight.
-
Assign the pool when you add a new sub-domain or later from the settings.
Step 4: Customize Vhost Settings in NGINX
-
Use the Vhost Editor to fine-tune NGINX configurations for each subdomain.
-
You can set up redirects, headers, or extra caching.
-
Add aliases by updating the server_name entry.
Step 5: Adjust PHP and Site Options
-
You can change the PHP tab's memory limits, timeouts, and other settings.
-
Enable Basic Auth to lock down staging or dev environments. This is helpful when testing or sharing a demo.
-
A Few Extra Notes
-
CloudPanel v2 supports this process for managing subdomains.
-
Sign in to your account once and manage everything from one dashboard.
-
For help, see the CloudPanel v2 docs or the official documentation.
-
If you need help or want to send a request, CloudPanel’s resources are available.
-
You can also suggest enhancements to the platform.
-
Managing CloudPanel Subdomains: 9 Best Practices
Managing subdomains in CloudPanel strengthens reliability and protection. Below are methods that will assist you in managing subdomains:
1. Configure DNS with External Providers
CloudPanel works with external DNS providers like Cloudflare and AWS Route 53. This ensures reliable performance and protects against DDoS attacks.
-
Set up A or CNAME records for each subdomain. Point them to your server’s public IP.
-
Use TTL values between 300 and 600 seconds for quick updates.
-
For AWS Route 53, manage records through CloudPanel.
-
Check propagation with tools like whatsmydns.net. Once stable, raise the TTL for caching.
2. Protect Subdomains with SSL/TLS
You need SSL/TLS certificates to protect your subdomains.
-
Use Let’s Encrypt or another trusted certificate authority to protect your subdomains.
-
If using Cloudflare, set the SSL mode to "Full" for complete encryption.
-
Disable the proxy during certificate issuance if needed.
-
Automate renewal to ensure certificates stay up-to-date.
3. Enable DNSSEC and Privacy Options
DNSSEC adds protection to your subdomains.
-
Enable DNSSEC through your DNS provider. It protects against spoofing and attacks.
-
Consider using DNS over HTTPS (DoH) to encrypt DNS queries.
4. Control Access and Permissions
Control who can access and change your DNS settings. It helps to avoid security risks.
-
Use strong passwords and multi-factor authentication (MFA). It is for extra protection.
-
Assign specific IAM roles with limited permissions in AWS Route 53 for those who need access.
-
Keep your credentials secure and never share them with unauthorized users.
5. Track and Maintain DNS Health
Monitoring lets you spot potential issues before they become problems.
-
Set up alerts for DNS failures or issues with record accuracy.
-
Track uptime with monitoring tools to ensure your subdomains are always available.
-
Review your DNS records at regular intervals to confirm their accuracy and currency.
6. Use Basic Authentication for Staging or Migration Subdomains
Keep testing or staging subdomains private to prevent unauthorized access.
-
Enable Basic Authentication to block public access while working on the site.
-
This will also keep search engines from indexing pages not ready for public view.
-
Share access only with the team working on the site.
7. Adjust Server and Application Settings
Each subdomain should be set up for performance and protection.
-
Use the Vhost Editor in CloudPanel to configure HTTP-to-HTTPS redirection and manage caching.
-
Assign separate document roots and PHP-FPM pools to separate each subdomain. This separation strengthens protection and resource management.
8. Lack of Backups and Documentation
Use CloudPanel’s backup tools to protect subdomain files and databases.
-
You can use automated Amazon Machine Images (AMIs) for AWS instances.
-
Consider using CLI database backups.
-
Log DNS settings and configurations in one central place. This helps with quick troubleshooting and recovery.
FAQs
1. How do I protect a subdomain with SSL in CloudPanel?
CloudPanel supports auto-renewal for Let’s Encrypt certificates, ensuring ongoing protection. If renewal fails, check your DNS settings or cron jobs.
2. How do I set up DNS settings for my subdomain?
Go to your DNS provider and create an A or CNAME record. This will point to your CloudPanel server’s IP address. If you use AWS Route 53, you can manage DNS in CloudPanel. This provides an effective setup.
3. Can I assign different PHP settings to each subdomain?
CloudPanel allows you to set different PHP settings for each subdomain. You can change settings for each subdomain. This includes the PHP version, memory limits, and execution time. This is important if it runs different apps.
4. How do I track performance and traffic for my subdomains?
CloudPanel offers logs for every subdomain. You can use these logs to find issues. Check the NGINX logs for server problems. Also, look at the PHP logs for application issues. Periodic checks will maintain everything in good working order.
5. Why isn’t my subdomain resolving or SSL failing?
If your subdomain isn’t loading, check your A or CNAME records. Make sure they match your server’s IP. You can also use whatsmydns.net to check propagation. Check your DNS settings. Also, make sure the /.well-known/acme-challenge path is open.
Summary
A CloudPanel subdomain sorts sections of your website under your main domain. CloudPanel makes setting up and managing subdomains straightforward. You can set options for each subdomain. Follow these tips to manage your CloudPanel subdomains:
-
Configure DNS Records: Set up A or CNAME records for each subdomain.
-
Protect Subdomains with SSL/TLS: Confirm each subdomain has an SSL certificate.
-
Control Access and Permissions: Use strong passwords. Activate multi-factor authentication for added protection.
Want an easier way to manage your subdomains? Try CloudPanel Free Hosting and use its powerful tools for subdomain management.