Saturday, May 21, 2022
PHPmyadmin Rocky Linux

Install phpMyAdmin pada rocky linux


Pada hari ini saya akan membahas cara Install phpMyAdmin pada rocky linux.

1. Install nginx

- update OS
sudo dnf -y update

- install
dnf -y install nginx

2. install mariadb/mysql

- install
dnf -y install mariadb mariadb-server

- start service
systemctl start mariadb
systemctl enable mariadb

- config mysql


- Buat DB nya

mysql -u root -p
CREATE DATABASE phpmyadmin CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY '123passwd';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%';

3. Install php

dnf -y install
dnf module -y reset php
dnf module install php:remi-7.4 -y
dnf -y install php php-{cli,common,fpm,curl,gd,mbstring,process,snmp,xml,zip,memcached,mysqlnd,json,mbstring,pdo,pdo-dblib,xml}

- setting time
vi  /etc/php.ini
date.timezone = Asia/Jakarta

- setting php-fpm
vi /etc/php-fpm.d/www.conf

user = nginx

; RPM: Keep a group allowed to write in log dir.
group = nginx

;listen =
listen = /run/php-fpm/www.sock

listen.owner = nginx = nginx
listen.mode = 0660

- start service

systemctl enable php-fpm
systemctl restart php-fpm
systemctl start nginx
systemctl enable nginx

4. install phpmyadmin

gpg --keyserver hkp:// --recv-keys 3D06A59ECE730EB71B511C17CE752F178259BD92
gpg --verify phpMyAdmin-$VER-english.tar.gz.asc
mkdir /usr/share/nginx/phpmyadmin
tar xzf phpMyAdmin-${VERSION}-all-languages.tar.gz -C /usr/share/nginx/phpmyadmin --strip-components=1

5. setting nginx

vi /etc/nginx/conf.d/phpmyadmin.conf

server {
    listen       80;
    root         /usr/share/nginx/phpmyadmin;
    access_log /var/log/nginx/phpmyadmin_access.log;
    error_log /var/log/nginx/phpmyadmin_error.log;

    index   index.php;

    location / {
        try_files    $uri $uri/ /index.php?$args;
    location ~ \.php$ {
         try_files $uri =404;
         fastcgi_intercept_errors on;
         include        fastcgi_params;
         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
         fastcgi_pass unix:/run/php-fpm/www.sock;

chown nginx:nginx /etc/nginx/nginx.conf

- cek file
nginx -t

systemctl restart nginx

6. Config phpmyadmin

cp /usr/share/nginx/phpmyadmin/config{.sample,}.inc.php
vi /usr/share/nginx/phpmyadmin/

ganti line

/** $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */


$cfg['blowfish_secret'] = 'm[a9LgO=Yo:n1ayWfi:UcR=sDx;vceBn';

- set permission

chown -R nginx:nginx  /var/lib/php/session/
chown -R nginx:nginx /usr/share/nginx/phpmyadmin

- restart service

systemctl restart nginx php-fpm

- tambahkan firewall

firewall-cmd --zone public --add-service http
firewall-cmd --permanent --zone public --add-service http
firewall-cmd --reload

- set hosts

vim /etc/hosts

- akses web


(Visited 25 times, 1 visits today)
Klik untuk berbagi dengan orang lain
Baca Juga :  Cara Install phpMyAdmin dengan Nginx pada CentOS 7

Similar Posts