LiteSpeed Web Server: Installation and Performance Optimization Guide from A to Z
LiteSpeed nedir?
LiteSpeed Web Server (LSWS), Apache'ye %100 uyumlu, yüksek performanslı, tescilli bir web sunucusudur. OpenLiteSpeed, ücretsiz bir sürüm ve özellikle WordPress, WooCommerce gibi içerik yönetimi (CMS) sistemlerinde Apache'den daha hızlıdır.
Avantajları:
Event-based mimari (Apache’nin process/thread modeline göre çok daha verimli)
Gelişmiş LSCache entegrasyonu (sayfa önbellekleme)
Botnet saldırılarında güvenliği arttıran mekanizmalar
Desteklenen HTTP/3 ve QUIC
cPanel ve DirectAdmin ile entegre çalışabilir
Taraf 1-Smart Install LiteSpeed/OpenLiteSpeed
1.1 hangi versiyonu seçmelisiniz?
Version Description
OpenLiteSpeed open source and free. Feature complete but limited official LSCache plugins.
LiteSpeed Enterprise Commercial. Comes with cPanel/DirectAdmin integration, official support and advanced LSCache module. Installation will be broken down into 2 headings.
1.2 Install openlite-speed (FREE Version)
System Minimum requirements
CentOS 7, AlmaLinux, Ubuntu 20.04+, Debian 10+
1GB minimum (recommended at least 2 GB) root-privileged server
Step 1 - Add repo and Start to installation Ubuntu/Debian:
wget -O - https://repo.litespeed.sh | bash apt update apt install openlitespeed -y CentOS/AlmaLinux:
bash <( curl https://repo.litespeed.sh ) yum install openlitespeed -y
Step 2 - Set Admin Password for Web Panel
/usr/local/lsws/admin/misc/admpass.sh
Step 3 - Start Service and Enable Start
systemctl enable lsws systemctl start lsws
Step 4 - Web Panel Access
Input the following in your browser:
https://your-server-ip:7080
1.3 LiteSpeed Enterprise Installation (cPanel)
Step 1 - Install the cPanel plugin:
bash <( curl https://get.litespeed.sh ) When installation completed LiteSpeed replaces Apache.
Step 2 - Manage Web Admin
On cPanel, configuration can be done through WHM > Plugins > LiteSpeed Web Server.
SECTION 2 - Basic Configuration
2.1 Port Settings
By default, OpenLiteSpeed uses port 8088 and port 7080 for its admin panel. To change it:
/usr/local/lsws/admin/conf/admin_config.conf
or from admin panel
you can also update the ports through Listeners > View/Edit.
2.2 Set PHP Version
Install PHP:
/usr/local/lsws/admin/misc/lsup.sh -v 8.2
Update the php settings with:
/usr/local/lsws/lsphp*/bin/php -i
Or from the admin panel: Server Configuration > External App > lsphp.
SECTION 3 - LSCache installation and configuration
3.1 Install LSCache Plugin for WordPress
Log in to your WordPress admin control panel.
Plugin > Add New > LiteSpeed Cache
Install and activate
3.2 Cache Settings with .htaccess
In case it's OpenLiteSpeed, following lines should go to .htaccess:
CacheEnable public / RewriteEngine On RewriteCond %{REQUEST_METHOD} ^GET|HEAD$ RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ RewriteCond %{REQUEST_URI} !^/wp-admin/ RewriteRule .* - [E=Cache-Control:max-age=120]
3.3 LSCWP Settings
Cache TTL: Instead of the default 3600, it can be set to 120.
Object Cache: Speed boost with memcached or redis support.
Browser Cache: Active enabled