Thursday, November 7, 2019
Home »
» Install LAMP di ubuntu 19.04
Install LAMP di ubuntu 19.04
Ok Sobat, untuk kali ini saya akan berbagi tahapan - step by step untuk melakukan installasi LAMP di ubntu 19.04
LAMP ( Linux Apache Mysql PHP, Perl Python ), ok sobat kita langsung sja tahapanya sbb:
1. Lakukan Update dulu pada OS nya :
@@-lab:~$:~$ sudo apt-get update
2. @-lab:~$:~$ sudo apt-get install apache2
Selanjutnya kita akan menyesuaikan firewall untuk memberikan akses ke Web Traffic. pada langkah ini pastikan kalian sudah mengikuti instruksi pengaturan server awal dan mengaktifkan UFW, pastikan juga bahwa firewall kalian memungkinkan lalu lintas HTTP dan HTTPS. Kalian juga dapat memerika UFW kalian apakah memiliki profil Apache dengan cara ketik perintah berikut pada terminal:
3. @-lab:~$:~$ sudo ufw app list
Available applications:
Apache
Apache Full
Apache Secure
CUPS
4. Lakukan test dari hasil installlasi tersebut :
Ketikkan pada web address : localhost ----enter
5. Melakukan installasi mysql Server
@-lab:~$:~$ sudo install mysql-server
Do you want to continue? [Y/n] y
6. Melakukan install secure pada mysql
@-lab:~$ sudo mysql_secure_installation
Press y|Y for Yes, any other key for No: n
Please set the password for root here.
New password: " Masukan Passwrd" <enter>
Re-enter new password: " Ulangi password" <enter>
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done!
Lakukan uji hasil install Mysql Server dan secure install server
sudo mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.27-0ubuntu0.19.04.1 (Ubuntu)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Untuk Melihat user root login di mysql mysql
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user; <tekan enter>
Untuk melakukan perubahan user agar login tidak secara auth_socket
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
+------------------+-------------------------------------------+-----------------------+-----------+
| user | authentication_string | plugin | host |
+------------------+-------------------------------------------+-----------------------+-----------+
| root | | auth_socket | localhost |
Maka lakukan perubahan sbb:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'nama password; < tekan enter>
Query OK, 0 rows affected (0.01 sec)
Untuk melakukan permisi ketikkan
mysql> FLUSH PRIVILEGES;
Lakukan Pengecekkan kembali apakah user root sudah berubah dari plugin auth_socket menjadi mysql_native
| user | authentication_string | plugin | host |
+------------------+-------------------------------------------+-----------------------+-----------+
| root | *978774038244C00CE16FDDWQRTYU90046EE61BE | mysql_native_password | localhost |
untuk keluar dar mysql ketiikan
mysql> exit;
Bye
Lakukan pengujian lagi :
sudo mysql -u root -p
Enter password: " Masukan Password" <Enter>
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.27-0ubuntu0.19.04.1 (Ubuntu)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
untuk keluar dari mysql
mysql> exit;
Bye
Melakukan Isntallasi PHP sbb:
@-lab:~$ sudo apt install apache2 mysql-client mysql-server php libapache2-mod-phpReading package lists... Done
Building dependency tree
Reading state information... Done
apache2 is already the newest version (2.4.38-2ubuntu2.3).
mysql-server is already the newest version (5.7.27-0ubuntu0.19.04.1).
The following additional packages will be installed:
libapache2-mod-php7.2 php-common php7.2 php7.2-cli php7.2-common php7.2-json
php7.2-opcache php7.2-readline
Suggested packages:
php-pear
The following NEW packages will be installed:
libapache2-mod-php libapache2-mod-php7.2 mysql-client php php-common php7.2
php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-readline
0 upgraded, 11 newly installed, 0 to remove and 8 not upgraded.
Need to get 3.958 kB of archives.
After this operation, 17,6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php7.2
Setting up libapache2-mod-php (2:7.2+69ubuntu1) ...
Setting up php7.2 (7.2.24-0ubuntu0.19.04.1) ...
Setting up php (2:7.2+69ubuntu1) ...
Processing triggers for man-db (2.8.5-2) ...
Melakukan Installasi PHPMyadmin
@lab:~$ sudo apt-get install phpmyadminReading package lists... Done
Building dependency tree
Reading state information... Done
After this operation, 54,7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y







0 comments:
Post a Comment