Installing PHPMyAdmin on AlmaLinux: A Step-by-Step Guide

Installing PHPMyAdmin on AlmaLinux: A Step-by-Step Guide

Here is a step-by-step guide on how to install PHPMyAdmin on AlmaLinux:

1. Install PHPMyAdmin:

Open a terminal and use the following command to install PHPMyAdmin:

sudo dnf install phpmyadmin

You may be prompted for confirmation; press “y” to proceed with the installation.

2. Configure Apache Web Server:

If you’re using PHPMyAdmin with the Apache web server, you might need to make some configurations. Restart Apache with the following command:

sudo systemctl restart httpd

3. PHPMyAdmin Configuration:

Activate PHPMyAdmin with Apache by creating a symbolic link using the following command:

sudo ln -s /usr/share/phpMyAdmin /var/www/html/phpMyAdmin

This makes PHPMyAdmin accessible in the browser at http://localhost/phpMyAdmin.

4. Advanced Settings for Security:

For security reasons, access to PHPMyAdmin should be restricted. You can edit the Apache configuration file to limit access to a specific IP range or only allow certain IP addresses.

Edit the Apache configuration file with the following command:

sudo nano /etc/httpd/conf.d/phpMyAdmin.conf

Within the <Directory "/usr/share/phpMyAdmin"> section, add the following lines to restrict access:

<Directory "/usr/share/phpMyAdmin">
    Options FollowSymLinks
    DirectoryIndex index.php
    Require ip 127.0.0.1 ::1
</Directory>

This allows access only from localhost. You can add your own IP address to restrict access further.

5. Restart Apache:

Restart Apache to apply the changes:

sudo systemctl restart httpd

Now, you can access the PHPMyAdmin interface by opening your browser and navigating to http://localhost/phpMyAdmin. From there, you can manage your MySQL databases.

These steps cover the basic installation of PHPMyAdmin. Don’t forget to take necessary security measures for your system, and customize configurations with security considerations in mind.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.