Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

  

  

YouTube 467

sudo timedatectl set-timezone Asia/Karachi

sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm


sudo dnf config-manager --set-enabled PowerTools
sudo dnf -y upate

sudo ARCH=$( /bin/arch )


sudo subscription-manager repos --enable "codeready-builder-for-rhel-8-${ARCH}-rpms"
sudo dnf config-manager --set-enabled PowerTools

1 de 11 03/11/2023, 16:38
Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

sudo dnf -y install php php-common php-process php-xmlrpc php-xml php-soap php-snmp php-re

sudo dnf -y install httpd httpd-devel mod_ssl openssl

sudo systemctl start httpd


sudo systemctl enable httpd

sudo dnf -y install mariadb-server

sudo systemctl start mariadb


sudo systemctl enable mariadb

sudo dnf -y install mysql-server mysql

sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank, 

so you should just press enter here.

2 de 11 03/11/2023, 16:38
Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

Enter current password for root (enter for none):


OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y


New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone


to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y


... Success!

Normally, root should only be allowed to connect from 'localhost'. This


ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y


... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y


- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y


... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

3 de 11 03/11/2023, 16:38
Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

Thanks for using MariaDB!

info.php /var/www/html

sudo vi /var/www/html/info.php

<?php
phpinfo();
?>

sudo mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/bkpwelcome

sudo systemctl reload httpd

sudo firewall-cmd --zone=public --permanent --add-service=http


sudo firewall-cmd --reload

http://your_server_name_or_ip

4 de 11 03/11/2023, 16:38
Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

mod_ssl

sudo firewall-cmd --zone=public --permanent --remove-service=http


sudo firewall-cmd --zone=public --permanent --add-service=https
sudo firewall-cmd --reload

export VER="5.0.0"

curl -o phpMyAdmin-5.0.0-all-languages.zip https://files.phpmyadmin.net/phpMyAdmin/5.0.0/p


sudo unzip -q phpMyAdmin*.zip
sudo mv phpMyAdmin-5.0.0-all-languages /usr/share/phpmyadmin

config.sample.inc.php

5 de 11 03/11/2023, 16:38
Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php

config.inc.php

sudo vi /usr/share/phpmyadmin/config.inc.php

$cfg['blowfish_secret'] = '$2a$07$H6V9J74bK5S5qez6CRXt7OviIqRlFwJiniEFAaBsGXoz8MCukudia';
$cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';

sudo mkdir /var/lib/phpmyadmin


sudo mkdir /var/lib/phpmyadmin/tmp
sudo chown -R apache:apache /var/lib/phpmyadmin/tmp

phpmyadmin.conf

sudo vi /etc/httpd/conf.d/phpmyadmin.conf

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.137.1
Allow from ::1
</IfModule> 
</Directory>

6 de 11 03/11/2023, 16:38
Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

Allow from
192.168.137.1

sudo apachectl configtest


sudo systemctl restart httpd

sudo semanage fcontext -a -t httpd_sys_content_t "/usr/share/phpmyadmin(/.*)?"


sudo restorecon -Rv /usr/share/phpmyadmin

sudo setenforce 0

https://your_server_name_or_ip/phpmyadmin

7 de 11 03/11/2023, 16:38
Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

8 de 11 03/11/2023, 16:38
Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

9 de 11 03/11/2023, 16:38
Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

    

10 de 11 03/11/2023, 16:38
Install PhpMyAdmin with Apache on CentOS, RHEL 8 - TechSupport https://www.techsupportpk.com/2019/12/how-to-set-up-phpmyadmin-o...

 

Enter Comment

  

11 de 11 03/11/2023, 16:38

You might also like