phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB over the web. This guide will walk you through the installation of phpMyAdmin on Rocky Linux 9 and show you how to secure your installation with a free SSL certificate from Let's Encrypt.
Before you begin, ensure that you have the following:
Start by updating the package repository and upgrading all installed packages:
sudo dnf update -y phpMyAdmin is included in the EPEL repository, which is not enabled by default. You need to enable it:
sudo dnf install epel-release -y With the EPEL repository enabled, you can now install phpMyAdmin:
sudo dnf install phpMyAdmin -y The next step is to configure Apache to serve phpMyAdmin by editing the configuration file:
Open the configuration file in a text editor of your choice:
sudo nano /etc/httpd/conf.d/phpMyAdmin.conf Adjust the permissions to allow connections only from specific IPs or networks. By default, phpMyAdmin is configured to deny access from any IP address that is not the local host (127.0.0.1).
To allow access from a specific IP (e.g., 123.123.123.123), find:
Require ip 127.0.0.1
Require ip ::1 Add the following line:
Require ip 123.123.123.123 Hint: For testing in a secure environment, you might temporarily allow access to all (Require all granted), but ensure this is closed in production.
Save and close the file.
Apply the changes by restarting the Apache service:
sudo systemctl restart httpd
Now you can log into phpMyAdmin:
Certbot is a client that fetches and deploys SSL certificates from the Let's Encrypt CA.
sudo dnf install certbot python3-certbot-apache -y Run Certbot to obtain a certificate for your domain:
sudo certbot --apache To verify if SSL is successfully installed, try accessing your domain using https://yourdomain.com/phpmyadmin. Ensure that your browser shows a lock icon indicating a secure connection.
Let's Encrypt certificates are valid for 90 days. It's crucial to automate the renewal process:
Certbot includes a systemd timer to handle automatic renewals. Ensure it is enabled:
sudo systemctl enable --now certbot-renew.timer Check the timer's status to ensure it is set:
sudo systemctl status certbot-renew.timer You've successfully installed and secured phpMyAdmin on Rocky Linux 9 using Let's Encrypt SSL. This setup enables you to manage your databases securely via a web interface and ensures encrypted communication over the network. Routine checks and updates on both your server and phpMyAdmin installations are recommended as part of standard maintenance and security practices.
Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…
ISPConfig is an open-source control panel that allows users to manage multiple servers from a…
As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…
Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…
Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…
In the IT world, it is important to keep a copy of your data as…