{"id":1140,"date":"2024-07-04T16:10:00","date_gmt":"2024-07-04T09:10:00","guid":{"rendered":"https:\/\/focusnic.com\/blog\/?p=1140"},"modified":"2024-11-22T23:43:35","modified_gmt":"2024-11-22T16:43:35","slug":"cara-install-lamp-stack-almalinux-8","status":"publish","type":"post","link":"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/","title":{"rendered":"Cara Install LAMP Stack di Cloud VPS Server AlmaLinux 8"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Apa_itu_LAMP_Stack\" >Apa itu LAMP Stack?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Persyaratan\" >Persyaratan<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Persiapan\" >Persiapan<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Langkah_1_%E2%80%94_Install_Apache\" >Langkah  1 &#8212; Install Apache<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Konfigurasi_Virtual_Host\" >Konfigurasi Virtual Host<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Langkah_2_%E2%80%94_Install_Database\" >Langkah 2 &#8212; Install Database<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Install_MySQL\" >Install MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Install_MariaDB\" >Install MariaDB<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Konfigurasi_Keamanan_MySQL\" >Konfigurasi Keamanan MySQL<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Langkah_3_%E2%80%94_Install_PHP\" >Langkah 3 &#8212; Install PHP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Langkah_4_%E2%80%94_Install_phpMyAdmin_Opsional\" >Langkah 4 &#8212; Install phpMyAdmin (Opsional)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Langkah_5_%E2%80%94_Install_SSL_Lets_Encrypt_Opsional\" >Langkah 5 &#8212; Install SSL Let&#8217;s Encrypt (Opsional)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Langkah_6_%E2%80%94_Ujicoba\" >Langkah 6 &#8212; Ujicoba<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/focusnic.com\/blog\/cara-install-lamp-stack-almalinux-8\/#Penutup\" >Penutup<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Apa_itu_LAMP_Stack\"><\/span>Apa itu LAMP Stack?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>LAMP stack adalah kumpulan software yang sering digunakan untuk membangun situs web atau aplikasi web. LAMP adalah singkatan dari:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>L &#8211; Linux<\/strong>, adalah sistem operasi yang digunakan untuk menjalankan komputer.<\/li>\n\n\n\n<li><strong>A &#8211; Apache<\/strong>, adalah web server yang digunakan untuk menampilkan situs web di internet.<\/li>\n\n\n\n<li><strong>M &#8211; MySQL<\/strong>, adalah software database untuk menyimpan data yang digunakan oleh situs web atau aplikasi.<\/li>\n\n\n\n<li><strong>P &#8211; PHP<\/strong>, adalah bahasa pemrograman yang digunakan untuk membuat logika dan fitur-fitur pada situs web atau aplikasi.<\/li>\n<\/ul>\n\n\n\n<p>Jadi, LAMP stack adalah kumpulan empat perangkat lunak berbeda yang bekerja sama untuk membangun situs web atau aplikasi web. Linux menyediakan sistem operasi, Apache menampilkan situs web, MySQL menyimpan data, dan PHP membuat fitur-fiturnya.<\/p>\n\n\n\n<p>Dalam tutorial ini, kami akan menginstal dan mengonfigurasi setiap komponen LAMP stack menggunakan <a href=\"https:\/\/focusnic.com\/compute-ssd\">Cloud VPS Compute SSD<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Persyaratan\"><\/span>Persyaratan<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Akses SSH ke server, baik sebagai root atau pengguna dengan hak sudo.<\/li>\n\n\n\n<li>Koneksi internet yang stabil untuk mengunduh paket-paket yang diperlukan.<\/li>\n\n\n\n<li>Pengetahuan dasar tentang sistem operasi Linux.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Persiapan\"><\/span>Persiapan<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Update server terlebih dahulu agar mendapatkan pembaruan<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">dnf update -y<\/pre><\/div>\n\n\n\n<p>Kemudian install repository <strong>EPEL<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">dnf install epel-release -y<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Langkah_1_%E2%80%94_Install_Apache\"><\/span>Langkah  1 &#8212; Install Apache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Jalankan perintah berikut untuk menginstall Apache pada server,<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">dnf install httpd -y<\/pre><\/div>\n\n\n\n<p>Kemudian enable service Apache agar otomatis <em>auto-start<\/em> ketika server di reboot<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">systemctl enable --now httpd<\/pre><\/div>\n\n\n\n<p>Cek status Apache<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">systemctl status httpd<\/pre><\/div>\n\n\n\n<p>Jika Anda menggunakan firewalld silahkan jalankan perintah berikut untuk membuka port 80 dan 443<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">firewall-cmd --add-port={80,443}\/tcp --permanent<\/pre><\/div>\n\n\n\n<p>Kemudian reload firewalld menggunakan perintah berikut<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">firewall-cmd --reload<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Konfigurasi_Virtual_Host\"><\/span>Konfigurasi Virtual Host<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><\/p>\n\n\n\n<p>Virtual host atau VirtualHost adalah fitur pada Apache web server yang memungkinkan Anda menjalankan beberapa situs web (domain) pada satu server web fisik yang sama. <\/p>\n\n\n\n<p>Kami akan menggunakan domain <strong>lamp.focusnic.biz.id<\/strong> yang sudah kami pointing ke server. Anda dapat mengikuti tutorial <a href=\"https:\/\/focusnic.com\/blog\/cara-mengakses-server-dengan-domain\/\">Cara Mengakses Server dengan Domain<\/a>. Selanjutnya, jalankan perintah berikut untuk membuat file VirtualHost dan silahkan sesuaikan dengan nama domain yang akan Anda gunakan<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">nano \/etc\/httpd\/conf.d\/lamp.focusnic.biz.id.conf<\/pre><\/div>\n\n\n\n<p>Isi script berikut pada file diatas<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">&lt;VirtualHost *:80&gt;\n    ServerName lamp.focusnic.biz.id\n    DocumentRoot \/var\/www\/lamp.focusnic.biz.id\/public_html\n\n    ErrorLog logs\/lamp.focusnic.biz.id_error.log\n    CustomLog logs\/lamp.focusnic.biz.id_access.log combined\n\n    &lt;Directory \/var\/www\/lamp.focusnic.biz.id\/public_html&gt;\n        AllowOverride All\n        Require all granted\n        DirectoryIndex index.html index.php\n    &lt;\/Directory&gt;\n&lt;\/VirtualHost&gt;<\/pre><\/div>\n\n\n\n<p>Kemudian buat direktori root untuk penyimpanan file website pada domain <strong>lamp.focusnic.biz.id<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">mkdir -p \/var\/www\/lamp.focusnic.biz.id\/public_html<\/pre><\/div>\n\n\n\n<p>Selanjutnya sesuaikan permission<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">chown -R apache:apache \/var\/www\/lamp.focusnic.biz.id\/<\/pre><\/div>\n\n\n\n<p>Buat test file <strong>index.html<\/strong> <\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">chown -R apache:apache \/var\/www\/lamp.focusnic.biz.id\/<\/pre><\/div>\n\n\n\n<p>Setelah melakukan penambahan virtual host kemudian restart Apache dengan perintah berikut<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">systemctl restart httpd<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">nano index.html<\/pre><\/div>\n\n\n\n<p>Isi script simple html<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n    &lt;body&gt;\n        &lt;h1&gt;Hello world!&lt;\/h1&gt;\n    &lt;\/body&gt;\n&lt;\/html&gt;<\/pre><\/div>\n\n\n\n<p>Anda dapat mengakses melalui web browser dengan mengetik nama domain dari virtual host yang sudah Anda buat, berikut adalah tampilan test index.html kami<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"615\" height=\"264\" src=\"https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-28.png\" alt=\"\" class=\"wp-image-1158\" style=\"width:770px;height:auto\" title=\"\" srcset=\"https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-28.png 615w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-28-300x129.png 300w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-28-450x193.png 450w\" sizes=\"(max-width: 615px) 100vw, 615px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Langkah_2_%E2%80%94_Install_Database\"><\/span>Langkah 2 &#8212; Install Database<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>MySQL adalah<\/strong> salah satu sistem database relasional (DBMS) yang paling terkenal dan digunakan di seluruh dunia, disamping itu ada <strong>MariaDB<\/strong> yang dikembangkan sebagai alternatif open source dari MySQL. Kami akan akan memberikan dua pilihan cara instalasi MySQL dan MariaDB lalu Anda dapat memilih salah satu dari DBMS tersebut.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Install_MySQL\"><\/span>Install MySQL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Berikut adalah perintah untuk menginstall MySQL, kami akan menggunakan default repository dari <strong>AppStream<\/strong> namun jika aplikasi Anda memiliki versi database MySQL tertentu Anda dapat mengikuti artikel <a href=\"https:\/\/focusnic.com\/blog\/tag\/mysql\/\">berikut<\/a><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">dnf module install mysql:8.0<\/pre><\/div>\n\n\n\n<p>Enable service MySQL agar otomatis <em>auto-start<\/em> ketika server di reboot<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">systemctl enable --now mysqld<\/pre><\/div>\n\n\n\n<p>Cek status MySQL<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">systemctl status mysqld<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Install_MariaDB\"><\/span>Install MariaDB<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Jalankan perintah berikut untuk menginstall MariaDB. Jika Anda memiliki versi tertentu dari MariaDB silahkan ikuti artikel <a href=\"https:\/\/focusnic.com\/blog\/cara-install-mariadb-8\/\">berikut<\/a><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">dnf module install mariadb:10.3<\/pre><\/div>\n\n\n\n<p>Enable service MariaDB agar otomatis <em>auto-start<\/em> ketika server di reboot<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">systemctl enable --now mariadb<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Konfigurasi_Keamanan_MySQL\"><\/span>Konfigurasi Keamanan MySQL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Jalankan perintah berikut untuk melakukan konfigurasi basic security dari MySQL<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">mysql_secure_installation<\/pre><\/div>\n\n\n\n<p>Berikut adalah output diatas, Anda dapat<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">Securing the MySQL server deployment.\n\nConnecting to MySQL using a blank password.\n\nVALIDATE PASSWORD COMPONENT can be used to test passwords\nand improve security. It checks the strength of password\nand allows the users to set only those passwords which are\nsecure enough. Would you like to setup VALIDATE PASSWORD component?\n\nPress y|Y for Yes, any other key for No: Y\n\nThere are three levels of password validation policy:\n\nLOW    Length &gt;= 8\nMEDIUM Length &gt;= 8, numeric, mixed case, and special characters\nSTRONG Length &gt;= 8, numeric, mixed case, special characters and dictionary                  file\n\nPlease enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0\nPlease set the password for root here.\n\nNew password: \n\nRe-enter new password: \n\nEstimated strength of the password: 50 \nDo you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Yes\nBy default, a MySQL installation has an anonymous user,\nallowing anyone to log into MySQL without having to have\na user account created for them. This is intended only for\ntesting, and to make the installation go a bit smoother.\nYou should remove them before moving into a production\nenvironment.\n\nRemove anonymous users? (Press y|Y for Yes, any other key for No) : Yes\nSuccess.\n\n\nNormally, root should only be allowed to connect from\n'localhost'. This ensures that someone cannot guess at\nthe root password from the network.\n\nDisallow root login remotely? (Press y|Y for Yes, any other key for No) : Yes    \nSuccess.\n\nBy default, MySQL comes with a database named 'test' that\nanyone can access. This is also intended only for testing,\nand should be removed before moving into a production\nenvironment.\n\n\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : Yes\n - Dropping test database...\nSuccess.\n\n - Removing privileges on test database...\nSuccess.\n\nReloading the privilege tables will ensure that all changes\nmade so far will take effect immediately.\n\nReload privilege tables now? (Press y|Y for Yes, any other key for No) : Yes\nSuccess.\n\nAll done! <\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Langkah_3_%E2%80%94_Install_PHP\"><\/span>Langkah 3 &#8212; Install PHP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Kami akan menggunakan repository default dari <strong>AppStream<\/strong> dan akan menginstall PHP versi 8.2<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">dnf module install php:8.2<\/pre><\/div>\n\n\n\n<p>Anda dapat menggunakan perintah berikut untuk mengecek versi PHP dan untuk memastikan bahwa PHP sudah terinstall pada server<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">php -v<\/pre><\/div>\n\n\n\n<p>Berikut adalah contoh outputnya:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">PHP 8.2.13 (cli) (built: Nov 21 2023 09:55:59) (NTS gcc x86_64)\nCopyright (c) The PHP Group\nZend Engine v4.2.13, Copyright (c) Zend Technologies<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Langkah_4_%E2%80%94_Install_phpMyAdmin_Opsional\"><\/span>Langkah 4 &#8212; Install phpMyAdmin (Opsional)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>phpMyAdmin biasanya dibutuhkan jika Anda ingin melakukan manajemen database secara web based.<\/p>\n\n\n\n<p>Tambahkan repository <strong>REMI<\/strong><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">dnf install https:\/\/rpms.remirepo.net\/enterprise\/remi-release-8.rpm -y<\/pre><\/div>\n\n\n\n<p> Jalankan perintah berikut untuk menginstall phpMyAdmin<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">dnf --enablerepo=remi install phpmyadmin -y<\/pre><\/div>\n\n\n\n<p>Konfigurasi lanjutan untuk phpMyAdmin agar dapat diakses<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">nano \/etc\/httpd\/conf.d\/phpMyAdmin.conf<\/pre><\/div>\n\n\n\n<p>Kemudian sesuaikan parameter berikut:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \"># phpMyAdmin - Web based MySQL browser written in php\n# \n# Allows only localhost by default\n#\n# But allowing phpMyAdmin to anyone other than localhost should be considered\n# dangerous unless properly secured by SSL\n\nAlias \/phpMyAdmin \/usr\/share\/phpMyAdmin\nAlias \/phpmyadmin \/usr\/share\/phpMyAdmin\n\n&lt;Directory \/usr\/share\/phpMyAdmin\/&gt;\n   AddDefaultCharset UTF-8\n\n   Require all granted\n&lt;\/Directory&gt;<\/pre><\/div>\n\n\n\n<p>Setelah melakukan perubahan pada virtualhost silahkan restart web server menggunakan perintah berikut<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">systemctl restart httpd<\/pre><\/div>\n\n\n\n<p>Jika Anda sudah melakukan pointing dan mengkonfigurasi virtualhost Anda dapat mengakses phpMyAdmin melalui web browser dengan mengetik <strong>http:\/\/namadomain.tld\/phpmyadmin<\/strong> lalu isi dengan username dan password MySQL<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"477\" src=\"https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-29-1024x477.png\" alt=\"\" class=\"wp-image-1169\" title=\"\" srcset=\"https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-29-1024x477.png 1024w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-29-300x140.png 300w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-29-768x358.png 768w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-29-450x210.png 450w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-29-780x363.png 780w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-29.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Langkah_5_%E2%80%94_Install_SSL_Lets_Encrypt_Opsional\"><\/span>Langkah 5 &#8212; Install SSL Let&#8217;s Encrypt (Opsional)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let&#8217;s Encrypt adalah SSL authority gratis, otomatis, dan open source yang dikelola oleh Internet Security Research Group (ISRG). Website atau domain Anda akan terlindungi dengan SSL selama 3 bulan dan dapat di renew kembali.<\/p>\n\n\n\n<p>Jalankan perintah berikut untuk menginstall certbot<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">dnf -y install certbot python3-certbot-apache mod_ssl<\/pre><\/div>\n\n\n\n<p>Sebelumnya kita sudah menentukan domain yang akan digunakan adalah <strong>lamp.focusnic.biz.id<\/strong> selanjutnya kami akan menginstall SSL pada domain tersebut<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">certbot --apache -d lamp.focusnic.biz.id<\/pre><\/div>\n\n\n\n<p>Kemudian setelah Anda menjalankan perintah diatas akan muncul output berikut:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">Saving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nError while running apachectl configtest.\n\nEnter email address (used for urgent renewal and security notices)\n (Enter 'c' to cancel): nama@domain.tld\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nPlease read the Terms of Service at\nhttps:\/\/letsencrypt.org\/documents\/LE-SA-v1.4-April-3-2024.pdf. You must agree in\norder to register with the ACME server. Do you agree?\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n(Y)es\/(N)o: Yes\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nWould you be willing, once your first certificate is successfully issued, to\nshare your email address with the Electronic Frontier Foundation, a founding\npartner of the Let's Encrypt project and the non-profit organization that\ndevelops Certbot? We'd like to send you email about our work encrypting the web,\nEFF news, campaigns, and ways to support digital freedom.\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n(Y)es\/(N)o: No\nAccount registered.\nRequesting a certificate for lamp.focusnic.biz.id\n\nSuccessfully received certificate.\nCertificate is saved at: \/etc\/letsencrypt\/live\/lamp.focusnic.biz.id\/fullchain.pem\nKey is saved at:         \/etc\/letsencrypt\/live\/lamp.focusnic.biz.id\/privkey.pem\nThis certificate expires on 2024-09-28.\nThese files will be updated when the certificate renews.\nCertbot has set up a scheduled task to automatically renew this certificate in the background.\n\nDeploying certificate\nSuccessfully deployed certificate for lamp.focusnic.biz.id to \/etc\/httpd\/conf.d\/lamp.focusnic.biz.id-le-ssl.conf\nCongratulations! You have successfully enabled HTTPS on https:\/\/lamp.focusnic.biz.id\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nIf you like Certbot, please consider supporting our work by:\n * Donating to ISRG \/ Let's Encrypt:   https:\/\/letsencrypt.org\/donate\n * Donating to EFF:                    https:\/\/eff.org\/donate-le\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<\/pre><\/div>\n\n\n\n<p>Setelah Anda menginstall SSL Let&#8217;s Encrypt, maka saat ini website Anda sudah terlindungi dengan SSL dan dapat berjalan pada port 443 atau HTTPS<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"498\" height=\"306\" src=\"https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-31.png\" alt=\"\" class=\"wp-image-1175\" title=\"\" srcset=\"https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-31.png 498w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-31-300x184.png 300w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-31-450x277.png 450w\" sizes=\"(max-width: 498px) 100vw, 498px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Langkah_6_%E2%80%94_Ujicoba\"><\/span>Langkah 6 &#8212; Ujicoba<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Selanjutnya kita akan menguji coba script sederhana untuk mengetes PHP yang sudah diinstall. Anda hanya perlu membuat sebuah file <strong>hello-world.php<\/strong> pada root directory<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">nano \/var\/www\/lamp.focusnic.biz.id\/public_html\/hello-world.php<\/pre><\/div>\n\n\n\n<p>Isi script sederhana berikut lalu simpan:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:php decode:true \">&lt;?php\necho \"Hello, World!\";\necho \"&lt;br&gt;\";\necho \"PHP Version: \" . phpversion();\n?&gt;<\/pre><\/div>\n\n\n\n<p>Akses melalui browser, berikut adalah contoh tampilannya<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"465\" height=\"132\" src=\"https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-32.png\" alt=\"\" class=\"wp-image-1179\" title=\"\" srcset=\"https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-32.png 465w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-32-300x85.png 300w, https:\/\/focusnic.com\/blog\/wp-content\/uploads\/2024\/06\/image-32-450x128.png 450w\" sizes=\"(max-width: 465px) 100vw, 465px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Penutup\"><\/span>Penutup<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Dengan mengikuti langkah-langkah di atas, Anda telah berhasil menginstal LAMP stack pada server VPS AlmaLinux 8 serta mengamankan dengan SSL Sertifikat Let&#8217;s Encrypt. LAMP stack merupakan kombinasi yang sangat berguna untuk membangun aplikasi web dinamis. Selamat, Anda sekarang siap untuk mulai membangun aplikasi web Anda!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apa itu LAMP Stack? LAMP stack adalah kumpulan software yang sering digunakan untuk membangun situs web atau aplikasi web. LAMP adalah singkatan dari: Jadi, LAMP stack adalah kumpulan empat perangkat lunak berbeda yang bekerja sama untuk membangun situs web atau aplikasi web. Linux menyediakan sistem operasi, Apache menampilkan situs web, MySQL menyimpan data, dan PHP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1152,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44],"tags":[13,15,28,40],"class_list":{"0":"post-1140","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tutorial","8":"tag-apache","9":"tag-mysql","10":"tag-php","11":"tag-phpmyadmin"},"_links":{"self":[{"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/posts\/1140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/comments?post=1140"}],"version-history":[{"count":34,"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/posts\/1140\/revisions"}],"predecessor-version":[{"id":1193,"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/posts\/1140\/revisions\/1193"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/media\/1152"}],"wp:attachment":[{"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/media?parent=1140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/categories?post=1140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/focusnic.com\/blog\/wp-json\/wp\/v2\/tags?post=1140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}