Save and close the file when you are finished. htaccess file within the phpmyadmin directory: nano /var/www/html/phpmyadmin/.htaccess Provide a secure password as shown below: New password: You can also add an extra layer of password protection on phpMyAdmin by setting up basic authentication.įirst, create an authentication file using the following command: htpasswd -c /etc/httpd/.htpasswd phpadmin Your phpMyAdmin interface is now only accessible from a specified IP address. To do so, open the nf file: nano /etc/httpd/conf.d/nf It is always a good idea to allow phpMyAdmin only to be accessible from a specific IP address. You can now access the phpMyAdmin interface using the URL Allow phpMyAdmin from Specific IP Save and close the file, then restart the Apache service to implement the changes: systemctl restart httpd Replace it with the following line: Alias /securelocation /var/www/html/phpmyadmin You can change it by editing the nf file: nano /etc/httpd/conf.d/nfįind the following line: Alias /phpmyadmin /var/www/html/phpmyadmin It is a good idea to change the access URL of your phpMyAdmin interface. In this section, we will show different ways to secure your phpMyAdmin web interface. Log in with your MySQL credentials created earlier. Now, open your web browser and visit the URL You should see the phpMyAdmin web interface in the following screen: Then, start the Apache service and enable it to start after system reboot with the following command: systemctl start httpd Then, import the tables for phpMyAdmin with the following command: mysql Next, edit the file and define your secure password: nano įind the line below and update with your secure password, as shown below: $cfg = 'your-secure-password' Next, rename the file: cd /var/www/html/phpmyadmin Next, change the ownership of the phpmyadmin directory to the apache user: chown -R apache:apache /var/www/html/phpmyadmin Next, rename the extracted directory to phpmyadmin as shown below: mv phpMyAdmin-4.9.4-all-languages phpmyadmin Once downloaded, unzip the downloaded file with the following command: unzip phpMyAdmin-4.9.4-all-languages.zip Reload privilege tables now? Y Step 3 – Install phpMyAdminįirst, download the latest version of phpMyAdmin to the Apache web root directory using the following command: cd /var/www/html This script will set the MySQL root password, remove anonymous users, disallow root login remotely and remove the test database and access to it, as shown below:Įnter current password for root (enter for none): Set root password? Y Next, set the MySQL root password using the following script: mysql_secure_installation Step 2 – Set MariaDB Root Passwordįirst, start the MariaDB service and enable it to start on boot time with the following command: systemctl start mariadb Step 4 - Configure Apache for phpMyAdminīefore starting, install Apache, MariaDB, PHP and other required PHP extensions with the following command: dnf update -yĭnf install httpd mariadb-server php php-cli php-json php-mbstring php-pdo php-pecl-zip php-mysqlnd -yĪfter installing all the packages, you can proceed to the next step.Step 1 - Install Apache, MariaDB and PHP.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |