Categories: Linux

Install LAMP Centos 7

Salah satu alasan dari memiliki server sendiri adalah menjadikannya sebuah hosting web. Dengan hosting menggunakan server sendiri, performa/harga yang didapatkan bisa jauh lebih banyak daripada ketika di hosting menggunakan hostingan CPanel. Oleh karena itu, pada tutorial ini ada langkah-langkah dasar untuk melakukan instalasi LAMP (Linux Apache Mysql PHP)

  • Install dan update centos 7
    yum update -y
  • Install semua software yang dibutuhkan
    yum install httpd mariadb-server php php-mysql epel-release nano
    yum install phpmyadmin
  • Lakukan konfigurasi file /etc/httpd/conf.d/phpMyAdmin.conf  menjadi kurang lebih seperti berikut
    <Directory /usr/share/phpMyAdmin/>
       AddDefaultCharset UTF-8
    
       <IfModule mod_authz_core.c>
         # Apache 2.4
         <RequireAny>
    #       Require ip 127.0.0.1
    #       Require ip ::1
            Require all granted
         </RequireAny>
       </IfModule>
       <IfModule !mod_authz_core.c>
         # Apache 2.2
         Order Deny,Allow
         Deny from All
         #Allow from 127.0.0.1
         #Allow from ::1
         Allow from all
       </IfModule>
    </Directory>
    
    <Directory /usr/share/phpMyAdmin/setup/>
       <IfModule mod_authz_core.c>
         # Apache 2.4
         <RequireAny>
    #       Require ip 127.0.0.1
    #       Require ip ::1
            Require all granted
         </RequireAny>
       </IfModule>
       <IfModule !mod_authz_core.c>
         # Apache 2.2
         Order Deny,Allow
  • Jalankan dan enable software yang telah diinstall agar dapat berjalan saat server booting
    systemctl start httpd
    systemctl start mariadb
    systemctl enable httpd
    systemctl enable mariadb
  • Lakukan konfigurasi untuk mengamankan mysql
    mysql_secure_installation
    Enter current password for root (enter for none):
    OK, successfully used password, moving on...
    
    Setting the root password ensures that nobody can log into the MariaDB
    root user without the proper authorization.
    
    New password: password
    Re-enter new password: password
    Password updated successfully!
    Reloading privilege tables..
     ... Success!
    
    By default, a MariaDB installation has an anonymous user, allowing anyone
    to log into MariaDB 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? [Y/n] Y
     ... Success!
    
    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? [Y/n] Y
     ... Success!
    
    By default, MariaDB 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? [Y/n] Y
     - Dropping test database...
    ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
     ... Failed!  Not critical, keep moving...
     - 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? [Y/n] Y
     ... Success!
    
    Cleaning up...
    
    All done!  If you've completed all of the above steps, your MariaDB
    installation should now be secure.
    
    Thanks for using MariaDB!
  • Untuk mengakses server, masukkan http://<ip-server>
  • Untuk mengakses phpmyadmin, jalankan http://<ip-server>/phpmyadmin

Credit images: 1

Akhmad Fakhoni Listiyan Dede

Share
Published by
Akhmad Fakhoni Listiyan Dede

Recent Posts

Mengimplementasikan AI untuk Melakukan Review pada Pull Request Github

Halo semua Github memiliki fitur terkait Pull Request yang cukup luar biasa, yaitu dapat melakukan…

3 days ago

Install kubernetes cluster using kubeadm

Hello everyone! 👋 Welcome to our step-by-step guide on using kubeadm to install Kubernetes. It's…

10 months ago

Meningkatkan Efisiensi Memory Proxmox Lebih dari 20%

Proxmox adalah hypervisor yang populer digunakan karena penggunaannya yang cukup simpel jika dibandingkan dengan hypervisor…

4 years ago

Longhorn Failed Upgrade from v0.8.1 to v1.0.0 caused by pv created before v0.6.2

This post is mirror of https://forums.rancher.com/t/failed-upgrade-from-v0-8-1-to-v1-0-0-caused-by-pv-created-before-v0-6-2/17586 I scale down all pods that has vpc to…

4 years ago

Cara Setup Network Ubuntu Server 18.04 pada Proxmox

Ubuntu Konfigurasi network pada Ubuntu Server 18.04 berbeda dengan ubuntu versi sebelumnya. Versi sebelumnya menggunakan…

5 years ago

VSCode Terminal Font Fix on MacOS

For detailed problems, see https://notulensiku.com/2019/02/fix-integrated-terminal-font-vscode/ To solve on mac, you need to install powerline fonts…

5 years ago