How to Easily Uninstall LiteSpeed Web Server

Uninstalling LiteSpeed Web Server might seem like a daunting task, but with the right guidance, it can be a straightforward process. Whether you’re troubleshooting, switching to another web server like Apache, or simply no longer need the enhanced performance features of LiteSpeed, this comprehensive guide will walk you through every step. By following our detailed instructions, you’ll be able to confidently uninstall LiteSpeed Web Server from your server, ensuring a smooth transition and minimal downtime. Dive into our guide to learn how to effectively manage and maintain your web server environment.

Step-by-Step Procedure to Uninstall LiteSpeed Web Server

To uninstall LiteSpeed Web Server from your server, follow these detailed steps:

1. Access the Server’s Command Line

First, access your server’s command line as the ‘root’ user. You can do this via SSH or by using the “Terminal” in WHM.

2. Switch the Web Server to Apache

Run the following command to switch your web server from LiteSpeed to Apache:

/usr/local/lsws/admin/misc/cp_switch_ws.sh apache

3. Verify Apache is Running

After switching to Apache, verify that it is running by executing:

systemctl status httpd

The output should show that Apache is the active web server. Look for the “Active” line to confirm that the service is running.

Example output:

[root@server ~]cPs# systemctl status httpd
● httpd.service - Apache web server managed by cPanel EasyApache
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
      Active: active (running) since Fri 2022-12-16 14:07:52 UTC; 8s ago
        Process: 3381 ExecStop=/usr/local/cpanel/scripts/restartsrv_httpd stop --no-verbose (code=exited, status=0/SUCCESS)
  Process: 3392 ExecStart=/usr/local/cpanel/scripts/restartsrv_httpd --no-verbose (code=exited, status=0/SUCCESS)
   Main PID: 3437 (httpd)

4. Uninstall the LiteSpeed Web Server Plugin

To remove the LiteSpeed Web Server plugin from your server, run:

/usr/local/cpanel/whostmgr/docroot/cgi/lsws/lsws_whm_plugin_uninstall.sh

Note: This command removes the LiteSpeed Web Server plugin but does not remove the LiteSpeed Web Server itself.

5. Remove LiteSpeed Web Server Files

To completely remove LiteSpeed Web Server files from your server, execute:

/usr/local/lsws/admin/misc/uninstall.sh

6. Prevent Reinstallation via cPanel & WHM Update

If you purchased LiteSpeed Web Server through the cPanel Store, you need to create a touch file to prevent the upcp script from reinstalling LiteSpeed during the next cPanel & WHM update. Create the touch file with this command:

touch /var/cpanel/disable_auto_lsws

Frequently Asked Questions (FAQs)

1. Why should I uninstall LiteSpeed Web Server?

You might want to uninstall LiteSpeed Web Server for troubleshooting purposes, to switch back to Apache, or if you no longer need the performance benefits provided by LiteSpeed.

2. Will uninstalling LiteSpeed affect my websites?

Uninstalling LiteSpeed and switching to Apache should not negatively impact your websites, provided Apache is configured correctly. It’s always a good idea to back up your server before making any changes.

3. How can I confirm that LiteSpeed is uninstalled?

After running the uninstallation commands, you can check for any remaining LiteSpeed processes or files. Ensure Apache is running as your web server by using the command:

systemctl status httpd

4. Can I reinstall LiteSpeed Web Server later?

Yes, you can reinstall LiteSpeed Web Server at any time by following the installation procedures provided by LiteSpeed or through the cPanel Store.

5. What should I do if I encounter issues during the uninstallation?

If you encounter issues, review the command outputs for error messages. Ensure you have the necessary permissions and that no dependent services are causing conflicts. You may also consult the LiteSpeed documentation or seek assistance from your hosting provider.

By following these steps, you can successfully uninstall LiteSpeed Web Server and switch back to Apache, ensuring your server continues to run smoothly.