Steps to install httpd in CentOS 8
- sudo yum install dnf
- sudo dnf update
- sudo dnf install httpd
- sudo systemctl start httpd
- sudo systemctl enablr httpd
- sudo systemctl enable httpd
- sudo firewall-cmd --add-service=http --permanent
- sudo firewall-cmd --reload
- sudo systemctl status httpd
- sudo dnf update
- sudo dnf update
- sudo dnf install epel-release
- sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
- sudo dnf module enable php:remi-8.2
- sudo dnf module reset php
- sudo dnf module enable php:remi-8.2
- sudo dnf module list php
- sudo dnf install php php-cli php-fpm php-mysqlnd php-pdo php-gd php-xml
- php -v
- sudo dnf update
- sudo dnf install https://dev.mysql.com/get/mysql80-community-release-el8- 3.noarch.rpm
- sudo dnf module enable mysql:8.0
- sudo dnf update
- sudo dnf install mysql-server
- sudo systemctl start php-fpm
- sudo systemctl enable php-fpm
- sudo systemctl restart httpd
- sudo systemctl start mysqld
- sudo systemctl enable mysqld
- Sudo dnf install epel-release
- sudo dnf update
- yum -y update
- yum -y install phpmyadmin
- dnf --enablerepo=remi install phpMyAdmin
- 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
<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/>
7. sudo systemctl restart httpd
8. You can verify the phpmyadmin installation by opening URL:
http://your_server_ip/phpMyAdmin
Alternative way to install phpmyadmin on CentOS 8
- sudo dnf update
- sudo dnf install tar
- sudo dnf install wget
- wget https://files.phpmyadmin.net/phpMyAdmin/5.1.3/phpMyAdmin-5.1.3-all-languages.tar.gz
- tar xzf phpMyAdmin-5.1.3-all-languages.tar.gz
- sudo mv phpMyAdmin-5.1.3-all-languages /usr/share/phpMyAdmin
- sudo mkdir /etc/phpMyAdmin
- sudo cp /usr/share/phpMyAdmin/config.sample.inc.php /etc/phpMyAdmin/config.inc.php
- sudo chmod 660 /etc/phpMyAdmin/config.inc.php
- sudo chown -R apache:apache /etc/phpMyAdmin
- sudo vi /etc/phpMyAdmin/config.inc.php
- add to config.inc.php,
13. sudo vi /etc/httpd/conf.d/phpMyAdmin.conf
Your phpMyAdmin.conf should be similar to given below,
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
<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/>
Note: "vi" command used above is an editor. I hope you know how to use it.
To insert, press i
To exit without saving, press esc then :q! and then enter
To exit along with saving, press esc then :wq! then enter