Panduan cara install Apache, MariaDB/MySQL, PHP (LAMP stack) di Linux Ubuntu 16.04. Untuk memulai tutorial ini bagi teman-teman pengguna windows, silahkan menggunakan aplikasi Putty.
Langkah 1 – Update system
Biasakan update system linux dengan menjalankan baris perintah berikut. Perintah dengan opsi -y = yes biar nanti tidak perlu konfirmasi ulang menekan abjad y.
apt-get update -yLangkah 2 – Install Apache
apt-get install apache2 -y
systemctl enable apache2
Cek melalui browser http://ip/, jikalau sukses, ada tulisan It works!.
Langkah 3 – Install MariaDB/MySQL
Ada dua opsi, silahkan pilih mau pakai MariaDB atau MySQL (rekomendasi pakai MariaDB saja)
Instalasi untuk MariaDB
apt-get install mariadb-serverJika ingin MySQL sebagai database (tidak disarankan)
apt-get install mysql-serverSelanjutnya ialah menigkatkan keamanan instalasi MariaDB/MySQL, menyerupai mengatur password dan lain-lain.
mysql_secure_installationAda beberapa pertanyaan yang perlu dijawab, dan diantaranya sebagai berikut, lihat bab yang aku warnai
Securing the MySQL server deployment.
Enter password for user root: ketik password kemudian tekan Enter
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: Enter saja
Using existing password for root.
Change the password for root ? ((Press y|Y for Yes, any other key for No) : Enter saja
... skipping.
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.
- Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done!Pastikan service MariaDB/MySQL auto start ketika mesin restart
untuk MariaDB
systemctl enable mariadbuntuk MySQL
systemctl enable mysqlLangkah 4 – Install PHP
Langkah selanjutnya, install PHP dan modul-modul yang umum di-install.
apt-get install php7.0 php7.0-common php7.0-mbstring php7.0-gd php7.0-mcrypt libapache2-mod-php7.0 php7.0-curl php7.0-zip php7.0-mysqlBuat file info.php untuk mengecek keberhasilan dari tutorial ini.
nano /var/www/html/info.phpIsi dengan baris isyarat berikut
<?php phpinfo();Simpan, cara menyimpan di nano editor, dengan menekan Ctrl+O kemudian Ctrl+X
Kemudian kita perlu me-restart apache2,
systemctl restart apache2Terakhir, cek melalui browser http://ip/info.php
Selesai, selamat mencoba 😀
Sumber https://idnetter.com
Mari berteman dengan saya
Follow my Instagram _yudha58
0 Response to "Cara Install Lamp Di Ubuntu 16.04"
Posting Komentar