Secure phpMyAdmin using Command with Apache on Ubuntu 22.04

03-Apr-2023

.

Admin

Secure phpMyAdmin using Command with Apache on Ubuntu 22.04

Hi Guys,

In this tutorial, you will learn How to Install and Secure phpMyAdmin with Apache on Ubuntu 22.04?. step by step explain How to phpMyAdmin Secure with Apache on Ubuntu 22.04. This article goes in detailed on Ubuntu 22.04 Secure phpMyAdmin. This tutorial will give you simple example of Ubuntu 22.04 Secure and Access phpMyAdmin.

You can use this post for ubuntu 14.04, ubuntu 16.04, ubuntu 18.4, ubuntu 20.04, ubuntu 21 and ubuntu 22.04 versions.

you can see the following two solutions to secure PHPMyAdmin login

Solution 1: Change PhpMyAdmin Login Page URL in Apache 2 Ubuntu


The default phpmyadmin login url can be located on apache named apache.conf

You can use the sudo nano /etc/phpmyadmin/apache.conf command to open the apache.conf file:

sudo nano /etc/phpmyadmin/apache.conf

You can attach the following line to the phpmyadmin url:

Alias /my-phpmyadmin /usr/share/phpmyadmin

Type the following command on your ssh terminal to restart the Apache service:

sudo service apache2 restart

Solution 2: Secure PHPMyAdmin Access in ubuntu aws

Open terminal and create a password using the htpasswd tool and Apache package following command.

sudo htpasswd -c /etc/phpmyadmin/.htpasswd myAdmin

can add password and confirm password here

New password:

Re-type new password:

Adding password for user myAdmin

Type the following command to open the phpmyadmin.conf file.

sudo nano /etc/apache2/conf-available/phpmyadmin.conf

Add the following lines to the phpmyadmin.conf file and save it:

Options +FollowSymLinks +Multiviews +Indexes # edit this line

DirectoryIndex index.php

AllowOverride None

AuthType basic

AuthName "Authentication Required"

AuthUserFile /etc/phpmyadmin/.htpasswd

Require valid-user

Restart the Apache web server using the following command:

sudo service apache2 restart

#Ubuntu