HostOnNet Blog

Install phpMyAdmin in RHEL/CentOS/Ubuntu/Debian

Download latest version of phpMyAdmin from

http://www.phpmyadmin.net/home_page/downloads.php

cd /usr/local/src
wget https://files.phpmyadmin.net/phpMyAdmin/4.7.4/phpMyAdmin-4.7.4-english.tar.xz
tar xvf phpMyAdmin-4.7.4-english.tar.xz
mkdir /usr/hostonnet
rm -rf /usr/hostonnet/phpmyadmin
mv phpMyAdmin-4.7.4-english /usr/hostonnet/phpmyadmin
cp /usr/hostonnet/phpmyadmin/config.sample.inc.php /usr/hostonnet/phpmyadmin/config.inc.php

You need to edit /usr/hostonnet/phpmyadmin/config.inc.php and set a random string for $cfg[‘blowfish_secret’]

vi /usr/hostonnet/phpmyadmin/config.inc.php

You can use any 32 char length random string, if you are on Ubuntu, generate one with command

pwgen 32

Configure CentOS

Now create apache configuration file

vi /etc/httpd/conf.d/phpmyadmin.conf

Add following to the file

Alias /phpmyadmin "/usr/hostonnet/phpmyadmin"

<Directory "/usr/hostonnet/phpmyadmin">
    AllowOverride All
    Options FollowSymlinks
    Order allow,deny
    Allow from all
</Directory>

Restart Apache web server

service httpd restart

Configure Ubuntu/Debian

Create file

vi /etc/apache2/conf-available/phpmyadmin.conf

Add

Alias /phpmyadmin "/usr/hostonnet/phpmyadmin"

<Directory "/usr/hostonnet/phpmyadmin">
    AllowOverride All
    Require all granted
    Options FollowSymlinks
    Order allow,deny
    Allow from all
</Directory>

Now enable config

a2enconf phpmyadmin

Restart Apache

service apache2 restart

Now you will be able to access phpMyAdmin by going to URL

http://your-server-ip/phpmyadmin

Posted in Linux