To uninstall LiteSpeed from a server running DirectAdmin via the command line, follow these steps:

---

### **Step 1: Stop LiteSpeed**
First, stop the LiteSpeed service to ensure it is not running during the uninstallation process.

```bash
systemctl stop litespeed
```

---

### **Step 2: Remove LiteSpeed Packages**
Use the package manager to remove LiteSpeed and its associated packages.

#### For CentOS/RHEL/AlmaLinux/RockyLinux:
```bash
yum remove litespeed
```

#### For Ubuntu/Debian:
```bash
apt-get remove --purge openlitespeed
```

---

### **Step 3: Remove LiteSpeed Configuration Files**
LiteSpeed configuration files and directories may remain after uninstallation. Remove them manually.

```bash
rm -rf /usr/local/lsws
rm -rf /etc/litespeed
```

---

### **Step 4: Remove LiteSpeed from DirectAdmin**
If LiteSpeed was integrated with DirectAdmin, you need to remove its configuration from DirectAdmin.

1. **Remove LiteSpeed Plugin (if installed):**
```bash
rm -rf /usr/local/directadmin/plugins/litespeed
```

2. **Revert to Apache or another web server:**
- Edit the DirectAdmin configuration file to switch back to Apache or another web server.
```bash
nano /usr/local/directadmin/conf/directadmin.conf
```
- Look for the line `webserver=` and set it to `apache` or another supported web server:
```
webserver=apache
```
- Save and exit the file.

3. **Restart DirectAdmin:**
```bash
systemctl restart directadmin
```

---

### **Step 5: Clean Up Remaining Files**
Check for any remaining LiteSpeed-related files and remove them.

```bash
find / -name "*litespeed*" -exec rm -rf {} \;
find / -name "*lsws*" -exec rm -rf {} \;
```

---

### **Step 6: Restart Services**
Restart DirectAdmin and the web server to ensure everything is functioning correctly.

```bash
systemctl restart directadmin
systemctl restart httpd # If using Apache
```

---

### **Step 7: Verify Uninstallation**
Confirm that LiteSpeed has been completely removed:

1. Check if LiteSpeed is still running:
```bash
ps aux | grep litespeed
```

2. Verify that the web server is now Apache or another configured server:
```bash
systemctl status httpd # For Apache
```

---

### **Optional: Reinstall Apache (if needed)**
If Apache was removed during the LiteSpeed installation, reinstall it:

#### For CentOS/RHEL/AlmaLinux/RockyLinux:
```bash
yum install httpd
systemctl enable httpd
systemctl start httpd
```

#### For Ubuntu/Debian:
```bash
apt-get install apache2
systemctl enable apache2
systemctl start apache2
```

---

By following these steps, LiteSpeed should be completely uninstalled from your DirectAdmin server. Let me know if you encounter any issues!

Ця відповідь Вам допомогла? 0 Користувачі, які знайшли це корисним (0 Голосів)