How to Remove Service Proxying for Migrated cPanel Accounts on the Source Server

0
2

If you’ve recently migrated your cPanel accounts to a new server, there’s one crucial task you must take care of—removing service proxying on the old server. If this step is skipped, your source server could continue to process requests for the migrated accounts, leading to unnecessary resource usage, confusion, and potential performance issues. Here’s a step-by-step guide to help you manually remove service proxying from the source server.

What is Service Proxying in cPanel?

Before we dive into the removal process, let’s quickly define what service proxying is. When cPanel accounts are transferred to a new server, the original server might still act as a proxy for services like email, web hosting, or MySQL databases. This means that even though your websites are now hosted on the new server, the old server might still be handling some of the traffic, causing issues like delays or errors. Removing this proxying ensures that all services are properly routed to the new server, reducing unnecessary load and potential problems.

Step-by-Step Guide to Removing Service Proxying

Step 1: Verify Proxy Settings

The first thing you need to do is check if service proxying is still active on your source server. To do this, log into your server via SSH and run the following command:

bash
grep -Ri proxy /var/cpanel/

This will display all configurations where proxying is enabled. You may see references to services like email, MySQL, or web requests. Once you’ve identified the areas where proxying is still active, it’s time to begin cleaning things up.

Step 2: Disable Email Proxying

One of the most common services that continue to proxy even after migration is email. If the old server is still managing email for your migrated accounts, you’ll need to stop it. Here’s how to do that:

  1. Open the Exim configuration file:

bash
nano /etc/exim.conf.local
  1. Look for any lines referencing the old server acting as a mail proxy.

  2. Either remove or comment out those lines.

  3. Save the file and restart the Exim service to apply the changes:

bash
systemctl restart exim

At this point, your old server will no longer be responsible for handling emails for the migrated accounts.

Step 3: Remove Proxy Subdomains

Another important task is to remove any proxy subdomains that may have been created during the migration. These subdomains, such as webmail.domain.com or cpanel.domain.com, can often be left behind. To remove them:

  1. Navigate to the directory:

bash
cd /var/cpanel/userdata/USERNAME/
  1. Locate and delete files related to proxy subdomains (like webmail.domain.com or cpanel.domain.com).

  2. Rebuild the Apache configuration by running the following command:

bash
/scripts/rebuildhttpdconf
  1. Restart the Apache service:

bash
systemctl restart httpd

This will ensure that the source server no longer tries to redirect requests for cPanel, WHM, or webmail services.

Step 4: Update DNS Records

Sometimes, issues arise because the DNS records haven’t been updated properly. To fix this:

  1. Log into WHM on the old server.

  2. Go to Edit DNS Zone.

  3. Remove any records pointing to the old server’s IP address.

  4. Make sure all DNS records are pointing to the new server’s IP.

  5. Save the changes and restart the DNS service:

bash
systemctl restart named

This will ensure that all requests are correctly directed to the new server without interference from the old one.

Step 5: Clear Cached Settings

Even after making all the necessary changes, cached settings may still cause service proxying to be active. To clear these settings:

  1. Run the following command:

bash
rm -f /var/cpanel/proxydomains
/scripts/updateuserdomains
  1. Restart the cPanel services:

bash
systemctl restart cpanel

Once these steps are complete, the old server will no longer be involved with the migrated accounts.

Why This Matters & How Lease Packet Can Help

Properly removing service proxying ensures that your new server handles all requests for the migrated accounts, improving performance and eliminating confusion. If you’re unsure about doing this manually or need assistance with your server setup, Lease Packet offers expert support to ensure your migration goes smoothly and all configurations are handled correctly.

Conclusion

After migrating your cPanel accounts to a new server, it’s important to remove service proxying from the old server. By following these steps, you ensure that all services are properly routed to your new server, reducing unnecessary load and preventing issues. If you run into any difficulties, Lease Packet is always available to assist with server management and support.

Leave a reply