OLS: instalasi

From OnnoWiki
Jump to: navigation, search

Siapkan Repo

sudo apt update
sudo apt -y install net-tools

Siapkan Firewall

Jika di perlukan saja,

sudo ufw allow OpenSSH
sudo ufw allow http
sudo ufw allow https
sudo ufw allow 7080/tcp
sudo ufw allow 8088/tcp
sudo ufw enable

Default Server Ubuntu 20.04.1, kondisi firewall terbuka.

Install OpenLiteSpeed

wget -qO - https://rpms.litespeedtech.com/debian/lst_repo.gpg | sudo apt-key add -
echo "deb http://rpms.litespeedtech.com/debian/ focal main" | sudo tee /etc/apt/sources.list.d/openlitespeed.list
sudo apt update
sudo apt -y install openlitespeed

Cek Status atau Restart

sudo /usr/local/lsws/bin/lswsctrl status
sudo /usr/local/lsws/bin/lswsctrl start

Cek Web di


Install PHP7

Upgrade ke php7.4

sudo apt -y install lsphp74 lsphp74-common lsphp74-mysql lsphp74-curl lsphp74-intl

Kalau perlu

killall lsphp


/usr/local/lsws/lsphp74/bin/php7.4 -v
/usr/local/lsws/lsphp74/bin/php7.4 --modules

Install MariaDB

sudo apt -y install mariadb-server

Restart & Enable

sudo systemctl start mariadb
sudo systemctl enable mariadb

Secure Installation

sudo mysql_secure_installation
Enter current password for root (enter for none): 
Set root password? [Y/n] y
New password: 
Re-enter new password: 
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Cek & Test

sudo mysql -u root -p
CREATE USER 'testuser' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON testdb.* TO 'testuser';

Konfigurasi OpenLiteSpeed

Set admin password

sudo /usr/local/lsws/admin/misc/admpass.sh


username admin
password [harus kita isi]

Akses Web Konfigurasi


Switch Port ke 80

Klik Listeners > Default > Edit > Port = 80 > Save

Konfigure PHP

Klik Server Configuration > External App > + > LiteSpeed SAPI App > Next
Name: lsphp74
Address: uds://tmp/lshttpd/lsphp.sock
Max Connections: 35
Initial Request Timeout (secs): 60
Retry Timeout : 0
Persistent Connection: Yes
Response Buffering: no
Start By Server: Yes(Through CGI Daemon)
Command: lsphp74/bin/lsphp
Back Log: 100
Instances: 1
Priority: 0
Memory Soft Limit (bytes): 2047M
Memory Hard Limit (bytes): 2047M
Process Soft Limit: 1400
Process Hard Limit: 1500

Klik Server Configuration > Script Handler > +
Suffixes: php
Handler Type: LiteSpeed SAPI
Handler Name: lsphp74

Virtual Hosts

Virtual Hosts > Example > Edit > General > Index Files > Edit
Use Server Index Files	: Addition
Index Files	        : index.html index.php
Auto Index	        : Yes
Auto Index URI	        : /_autoindex/default.php

Restart Server

Dashboard > Lingkaran (Gracefull restart button)



Pranala Menarik