phpMyAdmin is a popular open-source tool for managing MySQL, MariaDB, and other database systems. In this tutorial, we’ll walk you through the step-by-step process of how to install phpMyAdmin on Oracle Linux. By the end of this tutorial, you will have a fully functioning phpMyAdmin installation on your Oracle Linux server.
Table of Contents
- Prerequisites
- Update the System
- Install EPEL Repository
- Install LAMP Stack
- Install phpMyAdmin
- Configure Apache
- Secure phpMyAdmin
- Access phpMyAdmin
- Conclusion
Prerequisites
Before we proceed, you need to have the following:
- A server running Oracle Linux (7 or 8)
- A user with root or sudo privileges
How to Install phpMyAdmin on Oracle Linux
Update the System
First, make sure your system is up-to-date. Run the following command to update your Oracle Linux server:
sudo yum update -y
Install EPEL Repository
phpMyAdmin is available in the EPEL (Extra Packages for Enterprise Linux) repository. To install the EPEL repository, run the following command:
sudo yum install epel-release -y
Install LAMP Stack on Oracle Linux
To run phpMyAdmin, you need to have a LAMP (Linux, Apache, MySQL, PHP) stack installed on your server. If you haven’t already installed the LAMP stack, follow our tutorial on how to install and configure LAMP stack on Oracle Linux.
Install phpMyAdmin on Oracle Linux
Now that the EPEL repository is installed and your LAMP stack is ready, you can install phpMyAdmin. Run the following command to install phpMyAdmin:
sudo yum install phpmyadmin -y
Configure Apache on Oracle Linux
Next, you need to configure Apache to serve phpMyAdmin. Create a new configuration file by running the following command:
sudo nano /etc/httpd/conf.d/phpmyadmin.conf
Copy and paste the following content into the file:
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 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
Save the file and exit the editor. Then, restart Apache by running the following command:
sudo systemctl restart httpd
Secure phpMyAdmin
It’s essential to secure your phpMyAdmin installation. One way to do this is by creating an **.htpasswd** file with a username and password. First, install the httpd-tools
package:
sudo yum install httpd-tools -y
Create a new .htpasswd file for phpMyAdmin:
sudo htpasswd -c /etc/phpmyadmin/.htpasswd admin
Replace admin
with your desired username. You will be prompted to enter a password for the user.
Next, modify the phpmyadmin.conf file to include authentication directives:
sudo nano /etc/httpd/conf.d/phpmyadmin.conf
Add the following lines inside the <Directory /usr/share/phpmyadmin/>
block:
AuthType Basic
AuthName "phpMyAdmin"
AuthUserFile /etc/phpmyadmin/.htpasswd
Require valid-user
Save the file and exit the editor. Then, restart Apache:
sudo systemctl restart httpd
Access phpMyAdmin
Now you can access phpMyAdmin by navigating to http://your_server_ip/phpmyadmin
in your web browser. You will be prompted for the username and password you created earlier.
Enter your MySQL or MariaDB root username and password to log in. If you haven’t installed MariaDB yet, follow our tutorial on how to install MariaDB server on Oracle Linux.
Conclusion
Congratulations! You have successfully installed phpMyAdmin on Oracle Linux. You can now manage your MySQL or MariaDB databases through a user-friendly web interface.
If you’re looking to further enhance your Oracle Linux server, check out our tutorials on how to install Python on Oracle Linux, how to install TensorFlow on Oracle Linux, and how to set up a MySQL database server on Oracle Linux.