Difference between revisions of "OLS: instalasi"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "==Siapkan Repo== sudo apt update sudo apt install net-tools ==Siapkan Firewall== Jika di perlukan, sudo ufw allow OpenSSH sudo ufw allow http sudo ufw allow https su...")
 
Line 6: Line 6:
 
==Siapkan Firewall==
 
==Siapkan Firewall==
  
Jika di perlukan,
+
'''Jika di perlukan saja,'''
  
 
  sudo ufw allow OpenSSH
 
  sudo ufw allow OpenSSH
Line 17: Line 17:
  
 
Default Server Ubuntu 20.04.1, kondisi firewall terbuka.
 
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

Revision as of 08:08, 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