More

    Panduan Cara Install LAMP di CentOS 7

    Cara Install LAMP di CentOS 7 – LAMP merupakan akronim dari Linux, Apache, MariaDB, PHP adalah sebuah bundel untuk kebutuhan aplikasi web, Apache akan digunakan sebagai server web, MariaDB akan digunakan sebagai server database, PHP akan digunakan sebagai engine, dan berjalan pada sistem operasi GNU/Linux. Pada tutorial kali ini saya akan membahas tentang bagaimana cara install LAMP di centos 7. Baca juga: Cara Setting VPS Linux Untuk Web Hosting

    Tutorial ini akan saya jelaskan secara singkat, jadi pastikan anda minimal paham tentang alur dari linux khususnya centos 7. Jadi, saya tidak perlu menjelaskan basic-basic dari linux, yang mana itu akan membuat tulisan ini semakin panjang.

    Free $100
    Coupon

    Daftar gunakan link berikut ini, untuk mendapatkan free $100 Selama 60 hari selama Hacktoberfest! Anda juga akan mendapatkan $10 tambahan ketika sudah melakukan topup min $10 dan membelanjakan $10.

    More Less

    Berikut panduan cara install LAMP di CentOS 7.

    Panduan Cara Install LAMP di CentOS 7

    Install Apache

    1. Untuk installasi apache di centos 7 gunakan perintah dibawah ini:

    yum install httpd -y

    2. Menjalankan service apache

    systemctl start httpd

    3. Agar apache otomatis berjalan ketika server mengalami reboot

    systemctl enable httpd

    4. Anda bisa mengecek status apache berjalan atau tidak menggunakan perintah berikut

    systemctl status httpd

    5. Lalu coba akses alamat ip server anda di browser untuk memastikan apakah apache tersebut sudah berjalan.

    Install MariaDB

    MariaDB Merupakan fork dari Mysql dan sekarang digunakan sebagai pengganti Mysql pada sebagian besar distribusi GNU/Linux, MariaDB 100% compatible dengan Mysql jadi anda tidak perlu khawatir jika anda sebelumnya menggunakan Mysql, dipastikan tidak akan ada masalah saat anda migrasi ke MariaDB

    1. Install MariaDB

    yum install mariadb mariadb-server

    2. Jalankan service maria DB

    systemctl start mariadb

    3. selanjutnya anda diharuskan untuk mengkonfigurasi MariaDB, dengan mengeset kata sandi, membatasi akses, dan menghapus pengguna dan database yang tidak digunakan, gunakan perintah berikut

    mysql_secure_installation
    NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
    SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
    In order to log into MySQL to secure it, we'll need the current
    password for the root user.  If you've just installed MySQL, and
    you haven't set the root password yet, the password will be blank,
    so you should just press enter here.
    Enter current password for root (enter for none):     ## Press Enter ## 
    OK, successfully used password, moving on...
    Setting the root password ensures that nobody can log into the MySQL
    root user without the proper authorisation.
    Set root password? [Y/n]   Y  ## Press Enter ##
    New password:                ## Enter new password ##
    Re-enter new password:       ## Re-enter new password ##
    Password updated successfully!
    Reloading privilege tables..
    ... Success!
    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? [Y/n]  Y   ## Press Enter ##
     ... 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]     ## Press Enter ## 
    ... Success!
    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? [Y/n]     ## Press Enter ##
     - 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? [Y/n]     ## Press Enter ##
     ... Success!
    Cleaning up...
    All done!  If you've completed all of the above steps, your MySQL
    installation should now be secure.
    Thanks for using MySQL!

    4. Agar mariaDB otomatis berjalan ketika server mengalami reboot

    systemctl enable mariadb

    Install PHP

    versi PHP yang terdapat pada repositori CentOS 7 merupakan PHP Versi 5.4 yang sudah usang dan sudah tidak ada dukungan dari upstream, dan saat ini sudah banyak yang beralih ke php versi 7. Untuk itu kita perlu menambahkan repository php 7 di centos.

    1. Menambah repository PHP 7 dari repository pihak ketiga

    rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

    2. lalu pasang php56 dan ektensi yang dibutuhkan

    yum install php56w php56w-gd php56w-mbstring php56w-mcrypt php56w-intl php56w-mysqlnd php56w-fpm

    3. untuk ektensi lain bisa anda cari dengan peintah berikut

    yum search php56w

    Tes Web Server
    tambahkan berkas info.php pada direktori baku web server apache

    vim /var/www/html/info.php

    dan tambahkan skrip berikut

    <?php phpinfo(); ?>

    lalu coba anda akses pada peramban tautan berikut

    http://alamat-ip-atau-domain/info.php

    jika menampilkan halaman info php berarti instalasi lamp anda telah berhasil

    Recent Articles

    [td_block_21]

    Related Articles

    Leave A Reply

    Please enter your comment!
    Please enter your name here

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Dapatkan konten terbaik dari kami!