Difference between revisions of "OLS: instalasi"

From OnnoWiki
Jump to navigation Jump to search
Line 141: Line 141:
  
 
  http://<YOURSERVERIP>/phpinfo.php
 
  http://<YOURSERVERIP>/phpinfo.php
 +
 +
 +
 +
==Pranala Menarik==
 +
 +
* [[openlitespeed]]

Revision as of 10:16, 10 November 2020

Siapkan Repo

sudo apt update
sudo apt 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

http://<YOURSERVERIP>:8088

Install PHP7

Upgrade ke php7.4

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

Cek

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

Install MariaDB

sudo apt 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 DATABASE testdb;
CREATE USER 'testuser' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON testdb.* TO 'testuser';
FLUSH PRIVILEGES;
exit


Konfigurasi OpenLiteSpeed

Set admin password

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

Default

username admin
password [harus kita isi]

Akses Web Konfigurasi

http://<YOURSERVERIP>:7080


Switch Port ke 80

Klik Listeners > View > 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
Environment: PHP_LSAPI_MAX_REQUESTS=500
             PHP_LSAPI_CHILDREN=35
             LSAPI_AVOID_FORK=200M
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


Restart Server

Dashboard > Lingkaran (Gracefull restart button)


Cek

http://<YOURSERVERIP>/phpinfo.php


Pranala Menarik