30 Aralık 2010 Perşembe

Install PHPMyAdmin on Centos 5 Server

Install PHPMyAdmin on Centos 5 Server



PHPMyAdmin

Download and install the latest stable release of phpMyAdmin. At the time of writing this is 3.0.0

[root@cyber ~]# cd /usr/src/
[root@cyber src]wget http://internode.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-3.0.0-all-languages.tar.gz
tar -xzf phpMyAdmin-3.0.0-all-languages.tar.gz
mv /usr/src/phpMyAdmin-3.0.0-all-languages /var/www/html/phpMyAdmin
cd /var/www/html/phpMyAdmin
cp config.sample.inc.php config.inc.php
Next we need to configure phpMyAdmin to use the MySQL user and password specified earlier. (we’ll jump straight in at line 30)





vim +30 config.inc.php
change line 30 to read:

$cfg['Servers'][$i]['auth_type'] = ‘config’;
at line 35 add
$cfg['Servers'][$i]['user'] = ‘root’;
$cfg['Servers'][$i]['password'] = ‘mypassword’;
Browse to your server (e.g. http://192.168.0.10/phpMyAdmin) and check phpMyAdmin is working.
Next we need to secure the directory
To do this we first meed to tell Apache to act on .htacess files in the web folders. To do this we will modify line 326 of the http.conf file. 
vim +326 /etc/httpd/conf/httpd.conf
Change the line to read AllowOverride All
Save the file and restart the Apache service:
/etc/init.d/httpd restart
Next we need to create an access control file:
vim /var/www/html/phpMyAdmin/.htaccess
Insert the following text:
AuthName "phpMyAdmin"
AuthType Basic
AuthUserFile /var/www/html/phpMyAdmin/.htpasswd
AuthGroupFile /dev/null
require user MySQLAdmin
Save the file and create a password file containing the password for the user MySQLAdmin:
htpasswd -c /var/www/html/phpMyAdmin/.htpasswd MySQLAdmin
When prompted input your password and confirm.
Your phpMyAdmin page is now password protected with the user MySQLAdmin and the password you specified.

PhpInfo

phpInfo gives a handy output of installed options,versions and cofig of your LAMP server
mkdir  /var/www/html/phpInfo
vi /var/www/html/phpInfo/index.php
Insert the following text:
<?php
phpinfo();
?>
Save the file.

phpInfo can be viewed by browsing to http://yourdomain.com/phpInfo

Hiç yorum yok:

Yorum Gönder