How to Install LiteSpeed Web Server on AlmaLinux with CSF Firewall
Step 1: Login to Server
- SSH into your server as root.
Step 2: Install Required Packages
- Update system:
yum update -y
- Install wget and Perl if missing:
yum install wget perl -y
Step 3: Install LiteSpeed Web Server
- Download the LiteSpeed installer:
wget --no-check-certificate https://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh
- Make it executable:
chmod +x lsws_whm_plugin_install.sh
- Run the installation script:
./lsws_whm_plugin_install.sh
Step 4: Install LiteSpeed Plugin for cPanel
- After installation completes, login to WHM:
https://your-server-ip:2087
- Go to:
Home » Plugins » LiteSpeed Web Server Plugin
- Click "Install LiteSpeed Web Server"
- Enter your LiteSpeed license key or get a free trial license.
Step 5: Switch from Apache to LiteSpeed
- In WHM, go to:
LiteSpeed Web Server Plugin -> Switch to LiteSpeed
- Click "Switch to LiteSpeed" button to replace Apache with LiteSpeed.
Step 6: Configure CSF Firewall for LiteSpeed
- Open port 7080 (LiteSpeed Admin Panel) and 443 (SSL):
- Go to WHM -> ConfigServer Security & Firewall (CSF)
- Edit **Firewall Configuration**.
- Add **7080** to **TCP_IN** and **TCP_OUT** (for LiteSpeed Admin Console access).
- Add **443** to **TCP_IN** and **TCP_OUT** (for SSL connections).
- Restart CSF firewall:
- In WHM, go to **Firewall Configuration** -> **Restart CSF+LFD**.
Step 7: Verify LiteSpeed Installation
- In WHM, go to LiteSpeed Web Server Plugin and check that LiteSpeed is running.
- Or, SSH into the server and run:
ps aux | grep litespeed
- You should see processes related to LiteSpeed.
Step 8: Access LiteSpeed Admin Console
- Go to:
https://your-server-ip:7080
- Default login credentials:
- Username: admin
- Password is set during the installation.
Step 9: Restart LiteSpeed if Needed
- From WHM LiteSpeed Plugin, you can restart LiteSpeed.
- Or via SSH, use:
service lsws restart
Step 10: Enjoy LiteSpeed Performance!
- Use LiteSpeed Cache (LSCache) for supported applications like WordPress, Magento, etc.
- Fine-tune LiteSpeed settings from the Admin Panel.
Important Notes:
- Ensure that CSF is properly configured before switching to LiteSpeed.
- If CSF blocks port 7080, you won’t be able to access the LiteSpeed admin panel.
- LiteSpeed Enterprise requires a paid license, but a 15-day free trial is available.
- OpenLiteSpeed (free version) does not have full cPanel support but can be used for basic setups.