Navrangpura, Ahmedabad, Gujarat
Follow us :

Do you need all this service

httpd  web Serve ( Apache )
PHP
MARIYADB
phpMyAdmin

Install and Configure phpMyAdmin on RHEL 8.9

Install Apache Web Server make sure that you have a web server installed on your system. Apache is the most commonly used web server on Linux systems. You can install it using the following

Step 1: httpd service

[root@server ~]# yum install httpd -y

Step 2: Use of this command  ” enable ”  automatically boot time. start httpd service

[root@server ~]# systemctl enable httpd.service

Step 3: Stop the running httpd service and immediately start it again –

[root@server ~]# systemctl restart httpd.service

Step 4: Check service running

[root@server ~]# systemctl status httpd.service

Install PHP service

Step 1: phpMyAdmin is written in PHP and you’ll need it installed on your RHEL server. yum install

[root@server ~]#  yum install php -y
[root@server ~]# yum install php-zip php-json php-fpm -y

Step 2: Ensure the PHP-MySQL extension is installed.

[root@server ~]# yum install php-mysqlnd -y

Step3: Start and enable FPM service

[root@server ~]# systemctl enable --now php-fpm -y

Install MariaDB/MySQL Database Server

The next step is to install the MariaDB/MySQL database server. Follow the guides below to install MariaDB or MySQL on RHEL 8.

Installing MariaDB on RHEL 8 using the yum command

Step 1: Installing the MariaDB on RHEL 8, type:

[root@server ~]# yum install mariadb-server

Step 2: Securing the MariaDB server in  run

[root@server ~]# mysql_secure_installation

Step 3: Finally test your installation by running

[root@server ~]# mysql -u root -p

Step 4:  How to enable mariadb. service at  boot time

[root@server ~]# systemctl enable mariadb.service

Step 5:   Start/stop/restart mariadb. service on

[root@server ~]# systemctl start mariadb.service
[root@server ~]# systemctl restart mariadb.service
[root@server ~]# systemctl status mariadb.service

Install phpMyAdmin on RHEL 8.9

Step 1: Download the file to your local system

[root@server ~]# wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz

Step 2: Extract downloaded
class=”wp-block-code”>

[root@server ~]# tar xvf phpMyAdmin-latest-all-languages.tar.gz

Step 3: mv (Move) the folder

[root@server ~]# mv phpMyAdmin-*/ /usr/share/phpmyadmin

Step 4: Create the directory for phpMyAdmin temp files.

[root@server ~]# mkdir -p /var/lib/phpmyadmin/tmp
[root@server ~]# chown -R apache:apache /var/lib/phpmyadmin

Step 5: Create the directory for phpMyAdmin configuration files such as pass file.

[root@server ~]# mkdir /etc/phpmyadmin/

Step 6: Create a phpMyAdmin configuration file

[root@server ~]# cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php

Step7: Edit files

[root@server ~]#vim /usr/share/phpmyadmin/config.inc.php

Step 8: Needs to be 32 chars long

$cfg['blowfish_secret'] = 'H2OxcGXxflSd8JwrwVlh6KW6s2rER63i';

Step 9: Add Configure the Temp directory

$cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';

Step 10: Create the phpMyAdmin Apache configuration file.

[root@server ~]# vim /etc/httpd/conf.d/phpmyadmin.conf
# Apache configuration for phpMyAdmin
Alias /phpMyAdmin /usr/share/phpmyadmin/
Alias /phpmyadmin /usr/share/phpmyadmin/

<Directory /usr/share/phpmyadmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     Require all granted
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 192.168.65.128
     Allow from ::1
    </IfModule>
 </Directory>

Then can restrict access from specific IPs by adding lines like the below  ( your IP )

Step 11: Validate httpd configuration

[root@server ~]# apachectl configtest

Syntax OK

Step 12: Then httpd service restart

[root@server ~]# systemctl restart httpd

 SELinux and Firewall Configure

Step 1: access the phpMyAdmin page. Allow httpd to serve content in the phpmyadmin directory.

[root@server ~]# semanage fcontext -a -t httpd_sys_content_t "/usr/share/phpmyadmin(/.*)?"

Step 2: This command Apply the policy by running

[root@server ~]# restorecon -Rv /usr/share/phpmyadmin

Step 3: Allow http service in the firewall.

[root@server ~]# firewall-cmd --permanent--add-service=http

Step 4: Firewall reload

[root@server ~]# firewall-cmd --reload

Access  Web interface phpMyAdmin on RHEL 8.9
Open the URL and Check
http://192.168.65.128/phpmyadmin/
http://server.example.com/phpmyadmin/

Author

by admin

bg

Subscribe to our Newslatter

Sign Up to Our Newsletter to Get Latest Updates & Services

mail box
logo-footer
HighSky IT Solutions Pvt. Ltd. is a leading IT training and certification programs in Red hat, RSCSA Cloud, Open-source, AWS, Devops and various domains.
Contact Info

2nd floor, Rohera Arcade, opp SOTC office, Near Navrangpura police station, Navrangpura, Ahmedabad -380009 Gujarat

Copyright ©2024 Design & Developed by HighSky IT