I really have no issue with using a terminal, in fact I quite love the geekiness associated with it, but for some reason I never feel comfortable using a terminal to manage mySQL, which is why I love phpMyAdmin.
I am installing phpMyAdmin in a machine that hosts Joomla, see this post for more details, in practical terms this means that a second website will be needed to host phpMyAdmin, whether you host this site on a different port or a host header it's up to you, the process is fairly similar. Do bear in mind that using a different port has implications to your firewall configuration, in this post I will be using a different port.
It is worth bearing in mind that this configuration is not secure and as such should only be used on internal networks. Although running the website on a non-standard port will provide obscurity, it does not provide security. Have a look at this post for a secure phpMyAdmin installation guide.
Unfortunately phpMyAdmin is not, at the time of writing, included with RHEL based systems. Luckily, it is part of the Extra Packages for Enterprise Linux (EPEL) interest group. This means that the EPEL repository can be used to install phpMyAdmin thus obviating the need to install it from source.
Here are the steps needed to install phpMyAdmin in a CentOS 6.2 server:
I am installing phpMyAdmin in a machine that hosts Joomla, see this post for more details, in practical terms this means that a second website will be needed to host phpMyAdmin, whether you host this site on a different port or a host header it's up to you, the process is fairly similar. Do bear in mind that using a different port has implications to your firewall configuration, in this post I will be using a different port.
It is worth bearing in mind that this configuration is not secure and as such should only be used on internal networks. Although running the website on a non-standard port will provide obscurity, it does not provide security. Have a look at this post for a secure phpMyAdmin installation guide.
Unfortunately phpMyAdmin is not, at the time of writing, included with RHEL based systems. Luckily, it is part of the Extra Packages for Enterprise Linux (EPEL) interest group. This means that the EPEL repository can be used to install phpMyAdmin thus obviating the need to install it from source.
Here are the steps needed to install phpMyAdmin in a CentOS 6.2 server:
- Set SELinux to allow Apache to bind to a non-default port:
setsebool -P allow_ypbind 1
- Download EPEL Release to enable usage of EPEL Repository:
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
- Install EPEL Release package:
yum install epel-release-6-5.noarch.rpm -y
- Install phpMyAdmin:
yum install phpmyadmin -y
- Create new directory to host the phpMyAdmin website:
mkdir /var/www/phpMyAdmin
- Copy phpMyAdmin installation to the directory created in the previous step:
cp -r /usr/share/phpMyAdmin/. /var/www/phpMyAdmin
- Add a new virtual host to Apache, by editing the Apache configuration file /etc/httpd/conf/httpd.conf, see this post for more details. Relevant parts of httpd.conf:
Listen 80
Listen 8888
NameVirtualHost *:80
NameVirtualHost *:8888
<VirtualHost *:80>
ServerAdmin manyrootsofallevil@myhost.com
DocumentRoot /var/www/html
ServerName Joomla
ErrorLog logs/Joomla_error
CustomLog logs/Joomla-access_log common
</VirtualHost>
<VirtualHost *:8888>
ServerAdmin manyrootsofallevil@myhost.com
DocumentRoot /var/www/phpMyAdmin
ServerName Joomla
ErrorLog logs/phpMyAdmin_error
CustomLog logs/phpMyAdmin-access_log common
</VirtualHost> - You can check that the apache configuration file is correct by using:
apachectl -t
- Restart Apache:
apachectl -k restart or service httpd restart
- Open firewall for port 8888 and save IPTables configuration:
iptables -I INPUT -p tcp --dport 8888 -j ACCEPT; service iptables save
- From a browser navigate to http://localhost:8888/setup :
- Click New Server. I only changed the name and compression, accepted defaults for everything else:
- Go To Authentication Tab. See this link for an overview of the authentication types:
- Click Save, which will bring you to the screen below:
- Download the configuration file (config.inc.php) and copy it to /var/www/phpMyAdmin.
- You can now start using phpMyAdmin on http://192.168.1.65:8888
Note that steps 2 & 3 simply add repository for the EPEL repository to your yum repository collection and install the repository key.
In theory, the setup script should be able to generate the configuration file for you, but I've not been able to get it to work. Instructions can be found here if you are interested.
Thanks!! You have helped me so much!! Very fast, easy and user-friendly :-D
ReplyDeleteI have posted you in my blog:
ReplyDeletehttp://golpeandoelteclado.blogspot.com/2012/02/instalando-phpmyadmin-en-centos-62.html
I'm glad that you found the article useful
ReplyDeleteThank you for this useful information, if you please visit my blog, there should be little information that might be useful, such Lusca Squid: Install High Performance Proxy CentOS 6x
ReplyDeleteWhether we can exchange follower FriendConnect with your blog?
Hi,
ReplyDeleteThanks for the details. Every thing works except the php file which is in the /var/www/html/ folder. can you help me further?
which php file are you referring to?
DeleteThe config.inc.php file?
Excellent article!!
ReplyDeleteThank you
This comment has been removed by the author.
ReplyDeleteHello,
ReplyDeleteI configure my server with root user, but I can't connect to phpmyadmin (connection refused for this user)
Can you help me ?
Thank you
have you checked the log files?
Delete