CentOS 8.x phpMyAdmin
From Notes_Wiki
<yambe:breadcrumb self="phpMyAdmin">CentOS 8.x Web based tools|Web based tools</yambe:breadcrumb>
CentOS 8.x phpMyAdmin
To setup phpMyAdmin use:
- Install required packages
- dnf -y install wget epel-release php httpd tar php-mysqlnd expect php-json php-xml
- Download latest version of phpMyAdmin from https://www.phpmyadmin.net/downloads/ For Example
- wget https://files.phpmyadmin.net/phpMyAdmin/5.1.0/phpMyAdmin-5.1.0-english.tar.gz
- Extract the downloaded archive using tar. For example:
- tar xzf phpMyAdmin-5.1.0-english.tar.gz
- Move extracted folder to /usr/share/phpmyadmin location. For example
- mv phpMyAdmin-5.1.0-english /usr/share/phpmyadmin
- Go to /usr/share/phpmyadmin and rename config file.
- cd /usr/share/phpmyadmin
- mv config.sample.inc.php config.inc.php
- Edit config.inc.php file and insert 32 byte random secret for '$cfg['blowfish_secret']'. For example 'mkpasswd -l 32 -s 0'
- $cfg[‘blowfish_secret’]=’brsfgegjvxwRCoeeencssmmsq1athw7n’;
- Create temporary folder and set appropriate permissions
- mkdir /usr/share/phpmyadmin/tmp
- chown -R apache:apache /usr/share/phpmyadmin
- chmod 777 /usr/share/phpmyadmin/tmp
- Create '/etc/httpd/conf.d/phpmyadmin.conf' with
- Alias /phpmyadmin /usr/share/phpmyadmin
- <Directory /usr/share/phpmyadmin/>
- AddDefaultCharset UTF-8
- <IfModule mod_authz_core.c>
- # Apache 2.4
- <RequireAny>
- 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
- </IfModule>
- </Directory>
- <Directory /usr/share/phpmyadmin/setup/>
- <IfModule mod_authz_core.c>
- # Apache 2.4
- <RequireAny>
- 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
- </IfModule>
- </Directory>
- Start and enable httpd
- systemctl start httpd
- systemctl enable httpd
- Optionally configure SELinux, Firewall and restrict access to phpMyAdmin to some IPs/via password
Refer:
<yambe:breadcrumb self="phpMyAdmin">CentOS 8.x Web based tools|Web based tools</yambe:breadcrumb>