How to Uninstall WHM on Ubuntu

How to Uninstall WHM on Ubuntu

Web Hosting Manager (WHM) is a powerful tool that many webmasters use to manage their hosting environments. However, there may come a time when you no longer need WHM on your Ubuntu machine.

Whether you’re migrating to a different control panel, optimizing web server resources, or simply cleaning up, uninstalling WHM is a crucial step.

In this guide, we’ll walk you through the step-by-step process of uninstalling WHM from an Ubuntu server.

Let’s get started.

Step 1: Log in to Your Server

Access your Ubuntu server using SSH. You can do this by opening a terminal and typing:

ssh username@your_server_ip

Replace username with your server’s username and your_server_ip with your server’s IP address.

You’ll then be prompted to enter the password for the admin user. Once authenticated, you’ll have access to your server’s command line.

Step 2: Backup Your Data

Before making any changes to your server, always ensure you have a recent backup of all critical data. This includes website files, databases, emails, and configurations. Use tools like rsync or tar to create backups and store them in a safe location.

To backup your website files from /var/www/html to a backup directory /backup/website_files, you can use the following command:

rsync -avz /var/www/html/ /backup/website_files/

To create a compressed backup of the same directory:

tar -czvf /backup/website_files_backup.tar.gz /var/www/html/

After creating the backup, ensure you store it in a safe location, preferably off-site or on a different server, to protect against hardware failures.

See also  How to Restart Network Interfaces on Ubuntu

Step 3: Stop All cPanel & WHM Services

Before uninstalling, ensure that all cPanel and WHM services are stopped.

sudo /usr/local/cpanel/scripts/restartsrv_cpsrvd stop

Step 4: Remove cPanel & WHM Packages

Use the following command to remove all cPanel and WHM packages:

sudo yum remove cpanel\*

Step 5: Remove All cPanel Directories

To ensure a clean uninstall, remove all directories associated with cPanel and WHM:

sudo rm -rf /usr/local/cpanel
sudo rm -rf /var/cpanel
sudo rm -rf /usr/local/cpaddons
sudo rm -rf /var/log/cpanel*
sudo rm -rf /etc/httpd/conf/httpd.conf*

Step 6: Remove cPanel Users

If you’ve created any users through WHM, you’ll want to remove them:

sudo userdel -r cpaneleximscanner
sudo userdel -r cpanelhorde

Step 7: Clean Up Remaining Files

Search for any remaining cPanel files and directories:

sudo find / -name '*cpanel*'

Review the list and manually remove any relevant files or directories.

Step 8: Reconfigure DNS (If Necessary)

If you were using WHM’s built-in DNS server, you might need to reconfigure your DNS settings or switch to a different DNS provider.

Commands Mentioned

  • ssh username@your_server_ip – Used to access your server via SSH.
  • sudo /usr/local/cpanel/scripts/restartsrv_cpsrvd stop – Stops all cPanel & WHM services.
  • sudo yum remove cpanel\* – Removes all cPanel & WHM packages.
  • sudo rm -rf /directory_name – Removes specified directories.
  • sudo userdel -r username – Removes specified users.
  • sudo find / -name ‘*cpanel*’ – Searches for remaining cPanel files and directories.
See also  How to Uninstall Tiki Wiki CMS Groupware on Ubuntu

FAQ

  1. Why would I want to uninstall WHM?

    There are several reasons to uninstall WHM, including migrating to a different control panel, optimizing server resources, or cleaning up unused software.

  2. Is it safe to uninstall WHM?

    Yes, but always ensure you have a backup of all critical data before proceeding. This ensures you can restore your server if something goes wrong.

  3. What happens to my websites after uninstalling WHM?

    Your websites’ data remains intact, but the management tools provided by WHM will no longer be available. You’ll need to manage your sites manually or migrate to another control panel.

  4. Can I reinstall WHM after uninstalling?

    Yes, you can reinstall WHM anytime. However, it’s essential to ensure that all configurations and settings are correctly set up after reinstallation.

  5. Do I need to reconfigure my DNS after uninstalling WHM?

    If you were using WHM’s built-in DNS server, you might need to reconfigure your DNS settings or switch to a different DNS provider.

Conclusion

Removing WHM from your Ubuntu server is a straightforward process when you follow the steps outlined in this guide. Always prioritize backing up your data to ensure you can recover any lost information.

See also  How to Remove Google Chrome from Ubuntu

As technology evolves, the tools and software we use may change based on our requirements. Whether you’re looking to optimize your server’s performance, switch to a different control panel, or simply want to declutter, understanding how to uninstall software like WHM is essential. This guide has provided a comprehensive walkthrough of the uninstallation process, ensuring that you can safely and effectively remove WHM from your Ubuntu server.

Remember, the key to any significant server change is preparation. Always have backups in place and understand the implications of the changes you’re making. This way, you can ensure a smooth transition and maintain the integrity and performance of your server.

Lastly, always stay updated with the latest trends and best practices in the web hosting industry. By doing so, you can make informed decisions that benefit your websites and online ventures. Whether you’re looking for the best dedicated servers or exploring VPS hosting options, always prioritize reliability, performance, and security.

Thank you for following this guide, and we wish you success in all your web hosting endeavors!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *