Open Lite Speed: Difference between revisions

No edit summary
Line 1: Line 1:
 
<syntaxhighlight lang="shell">
wget -O - <nowiki>http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh</nowiki> | sudo bash
wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | sudo bash
 
</syntaxhighlight><syntaxhighlight lang="shell">
sudo apt install -y openlitespeed
sudo apt install -y openlitespeed
 
</syntaxhighlight><syntaxhighlight lang="shell">
sudo systemctl enable lshttpd
sudo systemctl enable lshttpd
 
</syntaxhighlight><syntaxhighlight lang="shell">
sudo systemctl start lshttpd
sudo systemctl start lshttpd
 
</syntaxhighlight><syntaxhighlight lang="shell">
sudo systemctl status lshttpd
sudo systemctl status lshttpd
</syntaxhighlight>
*Output
*Output
<syntaxhighlight lang="shell">
● lshttpd.service - OpenLiteSpeed HTTP Server
    Loaded: loaded (/etc/systemd/system/lshttpd.service; enabled; vendor preset: enabled)
    Active: active (running) since Mon 2021-05-31 04:59:06 EDT; 14min ago
  Main PID: 7213 (litespeed)
    CGroup: /system.slice/lshttpd.service
            ├─7213 openlitespeed (lshttpd - main)
            ├─7224 openlitespeed (lscgid)
            ├─7253 openlitespeed (lshttpd - #01)
            └─7254 openlitespeed (lshttpd - #02)


<span style="color:#00FF00">●</span> lshttpd.service - OpenLiteSpeed HTTP Server
May 31 04:59:04 focal systemd[1]: Starting OpenLiteSpeed HTTP Server...
      Loaded: loaded (/etc/systemd/system/lshttpd.service; enabled; vendor preset: enabled)
May 31 04:59:04 focal lswsctrl[7171]: [OK] litespeed: pid=7213.
      Active: active (running) since Mon 2021-05-31 04:59:06 EDT; 14min ago
May 31 04:59:06 focal systemd[1]: Started OpenLiteSpeed HTTP Server.
    Main PID: 7213 (litespeed)
      CGroup: /system.slice/lshttpd.service
              ├─7213 openlitespeed (lshttpd - main)
              ├─7224 openlitespeed (lscgid)
              ├─7253 openlitespeed (lshttpd - #01)
              └─7254 openlitespeed (lshttpd - #02)
May 31 04:59:04 focal systemd[1]: Starting OpenLiteSpeed HTTP Server...
May 31 04:59:04 focal lswsctrl[7171]: [OK] litespeed: pid=7213.
May 31 04:59:06 focal systemd[1]: Started OpenLiteSpeed HTTP Server.


</syntaxhighlight>
*Check OpenLiteSpeed version.
*Check OpenLiteSpeed version.
 
<syntaxhighlight lang="shell">
/usr/local/lsws/bin/openlitespeed -v
/usr/local/lsws/bin/openlitespeed -v
 
</syntaxhighlight>
*Output
*Output
LiteSpeed/1.6.21 Open
<syntaxhighlight lang="shell">
module versions:
LiteSpeed/1.6.21 Open
modgzip 1.1
module versions:
cache 1.62
modgzip 1.1
modinspector 1.1
cache 1.62
uploadprogress 1.1
modinspector 1.1
mod_security 1.4
uploadprogress 1.1
  (built: Tue Apr  6 13:20:57 UTC 2021)  
mod_security 1.4
module versions:
(built: Tue Apr  6 13:20:57 UTC 2021)  
modgzip 1.1
module versions:
cache 1.62
modgzip 1.1
modinspector 1.1
cache 1.62
uploadprogress 1.1
modinspector 1.1
mod_security 1.4
uploadprogress 1.1
 
mod_security 1.4
</syntaxhighlight>
*Secara default, OpenLiteSpeed mendengarkan pada port 8088, kita perlu membuatnya mendengarkan pada port 80. Edit file konfigurasi utama dengan editor teks baris perintah seperti Nano.
*Secara default, OpenLiteSpeed mendengarkan pada port 8088, kita perlu membuatnya mendengarkan pada port 80. Edit file konfigurasi utama dengan editor teks baris perintah seperti Nano.
 
<syntaxhighlight lang="shell">
sudo nano /usr/local/lsws/conf/httpd_config.conf
vim /usr/local/lsws/conf/httpd_config.conf
 
</syntaxhighlight>
*Temukan baris berikut
*Temukan baris berikut
listener Default{
<syntaxhighlight lang="lighttpd">
    address                  *:8088
listener Default{
    secure                  0
    address                  *:8088
    map                      Example *
    secure                  0
}
    map                      Example *
 
}
</syntaxhighlight>
*Change 8088 to 80.
*Change 8088 to 80.
*Output
*Output
listener Default{
<syntaxhighlight lang="lighttpd">
    address                  *:80
listener Default{
    secure                  0
    address                  *:80
    map                      Example *
    secure                  0
}
    map                      Example *
 
}
</syntaxhighlight>
*Simpan dan tutup file. Kemudian restart OpenLiteSpeed.
*Simpan dan tutup file. Kemudian restart OpenLiteSpeed.
 
<syntaxhighlight lang="shell">
sudo systemctl restart lshttpd
sudo systemctl restart lshttpd
 
</syntaxhighlight><blockquote>Catatan: Jika Anda memiliki server web lain seperti Nginx yang berjalan di server, Anda harus menghentikannya, lalu restart OpenLiteSpeed.</blockquote><syntaxhighlight lang="shell">
<blockquote>Catatan: Jika Anda memiliki server web lain seperti Nginx yang berjalan di server, Anda harus menghentikannya, lalu restart OpenLiteSpeed.</blockquote>
sudo systemctl stop nginx
 
</syntaxhighlight>
sudo systemctl stop nginx
 
*Sekarang ketikkan alamat IP publik server Ubuntu 20.04/18.04 Anda di bilah alamat browser. Anda akan melihat halaman Web “Selamat”, yang berarti server Web OpenLiteSpeed berjalan dengan baik.
*Sekarang ketikkan alamat IP publik server Ubuntu 20.04/18.04 Anda di bilah alamat browser. Anda akan melihat halaman Web “Selamat”, yang berarti server Web OpenLiteSpeed berjalan dengan baik.
*Jika koneksi ditolak atau gagal diselesaikan, mungkin ada firewall yang mencegah permintaan masuk ke port TCP 80. Jika Anda menggunakan firewall iptables, maka Anda perlu menjalankan perintah berikut untuk membuka port TCP 80.
*Jika koneksi ditolak atau gagal diselesaikan, mungkin ada firewall yang mencegah permintaan masuk ke port TCP 80. Jika Anda menggunakan firewall iptables, maka Anda perlu menjalankan perintah berikut untuk membuka port TCP 80.
 
<syntaxhighlight lang="shell">
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
 
</syntaxhighlight>
*Jika Anda menggunakan firewall UFW, jalankan perintah ini untuk membuka port TCP 80.
*Jika Anda menggunakan firewall UFW, jalankan perintah ini untuk membuka port TCP 80.
 
<syntaxhighlight lang="shell">
sudo ufw allow http
sudo ufw allow http
</syntaxhighlight>


==Source==
==Source==