Instalasi LAMPP (Linux Apache, MySQL, PHP, PHPMyAdmin) di CentOS 6

Persiapan

  1. Login kedalam server via ssh.
    ssh user@host -p password
  2. Update dan upgrade sistem.
    yum update && yum upgrade

Instalasi Apache

  1. Cari paket aplikasi :
    yum search httpd
  2. Install aplikasi :
    yum install httpd httpd-tools
  3. Verifikasi hasil instalasi :
    rpm -qa | grep httpd
  4. Backup konfigurasi default : cp /etc/httpd/conf/httpd.conf /pathfolder/httpd.conf.default
  5. Jalankan service apache : /etc/init.d/httpd/start
  6. Pastikan service apache sudah dalam keadaan running :
    ps aux | grep httpd; telnet localhost 80
  7. Set autostart : chkconfig httpd on

Instalasi MySQL

  1. Cari paket aplikasi :
    yum search mysql
  2. Install aplikasi :
    yum install mysql mysql-server
  3. Verifikasi hasil instalasi :
    rpm -qa | grep mysql
  4. Backup konfigurasi default :
    cp /etc/my.cnf /pathfolder/my.cnf.default
  5. Jalankan service mysql :
    /etc/init.d/mysqld start
  6. Pastikan service mysql sudah dalam keadaan running :
    ps aux | grep mysqld; telnet localhost 3306
  7. First setup mysql :
    /usr/bin/mysql_secure_installation
    – set root password
    – remove anonymous user
    – dissallow root login
    – remove test database
  8. Set autostart :
    chkconfig mysqld on

Instalasi PHP (+beberapa php modul yang penting untuk server)

  1. Instalasi php : yum install php php-cli php-common- php-devel php-gd php-mbstring php-mysql php-pdo php-soap php-xml php-xmlrpc
  2. Test instalasi php
    – Buka file konfigurasi apache : vi /etc/httpd/conf/httpd.conf
    – Buat web server mengeksekusi file php secara default dengan menambahkan value index.php di bagian DirectoryIndex.
    – Restart service apache : /etc/init.d/httpd restart
    – Buat file script phpinfo
    cat > /var/www/html/index.php
    <?php phpinfo(); ?>
    ctrl+c
    – Akses IP Web server di browser atau curl localhost

Instalasi PhpMyAdmin

  1. Update repository (install epel-release) : yum install epel-release
  2. Cari paket aplikasi :
    yum search phpmyadmin
  3. Install aplikasi :
    yum install phpmyadmin
  4. Verifikasi hasil instalasi : rpm -qa | grep phpmyadmin
  5. Backup konfigurasi default :
    cp /etc/phpMyAdmin/config.inc.php /pathfolder/config.inc.php.default
    cp /etc/httpd/conf.d/phpMyAdmin.conf /pathfolder/phpMyAdmin.conf.default
  6. Setup IP Addresss yang dapat mengakses dashboard PhpMyAdmin
    Require ip <ip-address>
    Allow from <ip-address>
  7. Restart service apache : /etc/init.d/httpd restart
  8. Akses dashboard myadmin (ipserver/phpmyadmin) di browser

 

Leave a Reply

Your email address will not be published. Required fields are marked *