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-
[root@sandeeplinux3 ~]# ls -ltr
-rw-r--r-- 1 root root 4438372 Mar 24 13:08 phpmyadmin-

Install phpMyAdmin Package:
[root@sandeeplinux3 IMP_rpm_packages]# rpm -i phpmyadmin-
warning: phpmyadmin- 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
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
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 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 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 -d -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -s -d -p udp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -s -d -p tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -s -d -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

Configuration Of PHP with MySQL on REDHAT LINUX-4

Server: sandeeplinux3 ( Local Network IP)

php-pear-4.3.9-3.8 (default installed)
php-ldap-4.3.9-3.8 (default installed)
php-mysql-4.3.9-3.8 (Need to install)

Download Required Packages From RHEL4 CD:
(Packages are available on 4th CD)
[root@sandeeplinux3 ~]# cd /media/cdrecorder/
[root@sandeeplinux3 cdrecorder]#
[root@sandeeplinux3 RPMS]# ls -ltr php-mysql*
[root@sandeeplinux3 RPMS]# cp php-mysql-4.3.9-3.8.x86_64.rpm /root/IMP_rpm_packages/

Note: Need to Install php-mysql package.

Installation Of Required Packages:
[root@sandeeplinux3 IMP_rpm_packages]# rpm -i php-mysql-4.3.9-3.8.x86_64.rpm
warning: php-mysql-4.3.9-3.8.x86_64.rpm: V3 DSA signature: NOKEY, key ID db42a60e

[root@sandeeplinux3 RPMS]# rpm -qa |grep php

Start Services:

[root@sandeeplinux3 php]# service httpd start/stop/restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not determine the server's fully qualified domain name, using for ServerName [ OK ]

Testing With PHP & HTTPD Services:
Create one php directory on /var/www/html

[root@sandeeplinux3 ~]# cd /var/www/html
[root@sandeeplinux3 html]#mkdir php
[root@sandeeplinux3 html]# ls -ltr
drwxr-xr-x 2 root root 4096 Mar 25 12:15 php
Create one example.php file and keep in /var/www/html/php directory
[root@sandeeplinux3 html]# cd php
[root@sandeeplinux3 php]# vi example.php
[hello, world! with PHP]
:wq [Save & Exit]

Click On Browser and enter bellow address from localhost or any client machine
http://localhost/php/example.php OR OR http://sandeeplinux3/php/example.php

Note: If open the html web page by php directory then we can make sure that our php & httpd services are working fine.