Install phpMyAdmin
phpMyAdmin is web-based PHP application for managing MySQL databases. It is fairly easy to install and configure.
Download the latest stable version from the phpMyAdmin web site, and extract it to a location of your choice. I prefer to keep the installation outside of the web root and use an apache alias to reference it.
[root@app3 ~]# cd /var/www
[root@app3 ~]# wget http://superb-west.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.11.5.2-all-languages-utf-8-only.tar.gz
[root@app3 ~]# tar xzf phpMyAdmin-2.11.5.2-all-languages-utf-8-only.tar.gz
Now that’s a lengthy directory name! Let’s create a link to that directory with a more friendly name.
[root@app3 ~]# ln -s phpMyAdmin-2.11.5.2-all-languages-utf-8-only phpMyAdmin
SELinux may generate a number of errors regarding this new directory that will be referenced by the apache web server. Let’s correct the security context of the entire phpMyAdmin directory structure.
[root@app3 ~]# chcon -R -h -t httpd_sys_content_t \
> phpMyAdmin-2.11.5.2-all-languages-utf-8-only
Configure the phpMyAdmin installation to use http authentication. We’ll make sure it is secure by forcing SSL encryption using apache directives in a later step.
[root@app3 ~]# cd phpMyAdmin
[root@app3 ~]# cp config.sample.inc.php config.inc.php
[root@app3 ~]# vi config.inc.php
Change the line:
$cfg['Servers'][$i]['auth_type'] = ‘cookie’;
to:
$cfg['Servers'][$i]['auth_type'] = ‘http’;
Now we need to configure the apache web server. To keep things modular, create a file phpmyadmin.conf in /etc/httpd/conf.d. Any configuration directives in this file will automatically be loaded into the main apache configuration when the daemon is restarted.
[root@app3 ~]# vi /etc/httpd/conf.d/phpmyadmin.conf
The phpmyadmin.conf file should contain the following directives. Just modify the paths to suit your installation.
Alias /phpmyadmin /var/www/phpMyAdmin
<Directory "/var/www/phpMyAdmin">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
SSLRequireSSL
</Directory>
Restart apache and see if your installation works.
[root@app3 ~]# service httpd restart
If there are problems, check your logs. It is possible that SELinux may be complaining about something.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments
No comments yet.
Leave a comment