About Me

My photo
Hi Friends, I am Sandeep CC and some people know me as System Administrator. I have started my professional career from 2008. I have been working as System Administrator on Linux Server and Windows Client. I am here to share my Knowledge in which I have experienced and which I have come across till now, It could be help to you people. In case anything wrong or any improvements in my post steps, Please comment to the post, Feel free to contact me by posting comments on this blog. Thanks and Regards, Sandeep CC

Monday, April 5, 2010

Install & Configure phpMyAdmin tool on REDHAT LINUX-4





Install & Configure phpMyAdmin tool
Download Required Package From bellow Site:

Click on this link & download this package phpmyadmin-2.11.9.3-1.el4.rf
http://rpm.pbone.net/index.php3/stat/4/idpl/11978420/dir/redhat_el_4/com/phpmyadmin-2.11.9.3-1.el4.rf.noarch.rpm.html
[root@sandeeplinux3 ~]# ls -ltr
-rw-r--r-- 1 root root 4438372 Mar 24 13:08 phpmyadmin-2.11.9.3-1.el4.rf.noarch.rpm

Install phpMyAdmin Package:
[root@sandeeplinux3 IMP_rpm_packages]# rpm -i phpmyadmin-2.11.9.3-1.el4.rf.noarch.rpm
warning: phpmyadmin-2.11.9.3-1.el4.rf.noarch.rpm: V3 DSA signature: NOKEY, key ID 1aa78495
[root@sandeeplinux3 IMP_rpm_packages]#

Check & Edit config.inc.php file:
[root@sandeeplinux3 ~]# cd /usr/share/phpmyadmin/
[root@sandeeplinux3 phpmyadmin]# ls -ltr config.inc.php
-rw-r----- 1 root apache 1751 Oct 31 2008 config.inc.php
[root@sandeeplinux3 phpmyadmin]#

Note: Keep Original file as backup then edit the file
[root@sandeeplinux3 phpmyadmin]# cp config.inc.php config.inc.php.20100324
[root@sandeeplinux3 phpmyadmin]# ls -ltr config.inc.php*
-rw-r----- 1 root apache 1751 Oct 31 2008 config.inc.php
-rw-r----- 1 root root 1751 Mar 24 14:27 config.inc.php.20100324

[root@sandeeplinux3 phpmyadmin]#vi config.inc.php
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'YOURPASSWORD'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

Note: In config.inc.php file modify with password, password should be any mysql user's password, should not enter root password for secure purpose. This password will allow for temp cookies.

Testing With Localhost: [Befor testing check with firewall settings, firewall setting given in the last]
Click On Browser and enter bellow address
http://localhost.localdomain/phpMyAdmin
Enter mysql user name & password
User name: sandeep
Password: sandeep123

Edit phpMyAdmin.conf file:

[root@sandeeplinux3 ~]# cd /etc/httpd/conf.d/
[root@sandeeplinux3 conf.d]# ls -ltr
-rw-r--r-- 1 root root 269 Mar 24 16:43 phpmyadmin.conf
Note: Keep Original file as backup then edit the file
[root@sandeeplinux3 conf.d]# cp phpmyadmin.conf phpmyadmin.conf.20100324
[root@sandeeplinux3 conf.d]# ls -ltr phpmyadmin*
-rw-r--r-- 1 root root 268 Mar 24 16:42 phpmyadmin.conf.20100324
-rw-r--r-- 1 root root 269 Mar 24 16:43 phpmyadmin.conf
[root@sandeeplinux3 conf.d]# vi phpmyadmin.conf
#
# Web application to manage MySQL
#

Order Deny,Allow
# Deny from all
Allow from 127.0.0.1
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
[root@sandeeplinux3 conf.d]#

Testing With Clienthost:
Click On Browser and enter bellow address
http://192.168.1.11/phpMyAdmin OR http://sandeeplinux3/phpMyAdmin
Enter mysql user name & password
User name: sandeep
Password: sandeep123

Note: In phpmyadmin.conf file Deny from all this line make it as un-use/un-commant, modify this line starting with #, after modifiying this line should look like as # Deny from all. After editing this file we can access mysql databases from windows/client host by browsing as
http://192.168.1.11/phpMyAdmin or http://sandeeplinux3/phpMyAdmin

Firewall With php & phpMyAdmin:
Edit iptables file for enable 80 & 443 port
[root@sandeeplinux3 ~]# vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -d 192.168.1.0/24 -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -d 192.168.1.0/24 -p udp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -d 192.168.1.0/24 -p tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -d 192.168.1.0/24 -p udp --dport 443 -j ACCEPT

Service Restart:
[root@sandeeplinux3 ~]# service iptables restart
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
Applying iptables firewall rules: [ OK ]

Thanks & Regards,
Sandeep CC

2 comments: