As we know that we phpmyadmin is a great GUI tool to handle mysql database, there are always security matters when we talk about the database, so it is important to secure the access of phpmyadmin, In this article we cover a complete server setup with LAMP,with secure phpmyadmin access by fake url.
first we need to install important repositories to install latest packages , I always prefer remi repository ,we can install this repository as
Install Epel repository as this is require for remi
for 32 bit
#wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm #rpm -Uvh epel-release-6*.rpm
for 64 bit
#wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm #rpm -Uvh epel-release-6*.rpm
Now download and install Remi repository
#wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm #sudo rpm -Uvh remi-release-6*.rpm
Here we are doing fresh installation of php and php module with mysql-server setup . You can left this step if already have below packages and softwares on server . please verify first. Install required packages as
#yum install httpd php php-devel php-common php-gd php-pdo php-mysql php-mcrypt php-mbstring mysql-server --enablerepo=remi
you can check php version
# php -v PHP 5.4.45 (cli) (built: Sep 2 2015 18:54:00) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
Now Start apache and mysql server
#chkconfig httpd on #service mysqld start #chkconfig mysqld on #configure Mysql Now configure mysql password , for this follow below steps as mentioned
#mysql_secure_installation Enter current password for root (enter for none): Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! Remove anonymous users? [Y/n] Set root password? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y
Now next step to configure phpmyadmin ,
go to /usr/share direcory and download latest version of phpmyadmin .
#cd /usr/share/ #wget https://files.phpmyadmin.net/phpMyAdmin/4.4.14/phpMyAdmin-4.4.14-english.tar.gz #tar xvzf phpMyAdmin-4.4.14-english.tar.gz #mv phpMyAdmin-4.4.14-english phpmyadmin
Now edit apache’s configuration file add Alias for phpmyadmin
#vi /etc/httpd/conf/httpd.conf Alias /PMAX /usr/share/phpmyadmin
Now restart the apache
#service httpd restart
go to browser and open phpmyadmin with[box] http://your-server-ip/PMAX[/box]
for any query or concern please comment.