Site icon Learning & Doing

Install LAMP pada Rocky Linux

lamp

Pada kesempatan kali ini saya akan membahas cara Install LAMP pada Rocky Linux , LAMP sendiri merupaka istilah dari Linux, Apache, MySQL, PHP (LAMP).

  1. Install Apache
- install
dnf install -y @httpd
- enable service
systemctl enable --now httpd
- setting firewall
firewall-cmd --permanent --add-service={http,https}
firewall-cmd --reload
- akses via browser
http://ipaddr

2. Install PHP

- cek list module
dnf module list php
- reset php
dnf module reset php
- pilih versi php yg mau di install
# PHP 7.4
sudo dnf -y module install php:7.4

# PHP 7.3
sudo dnf -y module install php:7.3

# PHP 7.2
sudo dnf -y module install php:7.2

- install php
dnf -y install php php-fpm php-mysqlnd php-opcache php-gd php-xml php-mbstring php-zip

- cek version
php --version

- start service 
systemctl enable --now php-fpm
systemctl status php-fpm

- restart httpd
systemctl restart httpd

- test load file
nano /var/www/html/info.php

<?php
phpinfo();
?>

- akses 
http://ipaddr/info.php

3. Install Mariadb / mysql server

- install
dnf -y install @mariadb

- start service
systemctl enable --now mariadb

- config mysql 

mysql_secure_installation

- test login

mysql -u root -p
Exit mobile version