Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Tuesday, August 03, 2010

Install phpMyAdmin on Server CentOS 5.5

      phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web. phpMyAdmin supports a wide range of operations with MySQL. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement.

Install repository from rpmforge to server
# cd /tmp

On Centos x86 (i386)
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
# rpm -Uvh rpmforge-release-0.5.1-1.el5.rf.i386.rpm

On Centos x64 (x86_64)
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
# rpm -Uvh rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
Command to view version of CentOS is x86 (32bit) or x86_64 (64bit)
# uname -i

Install phpMyAdmin
# yum -y install phpmyadmin
edit file phpmyadmin.conf
# vi /etc/httpd/conf.d/phpmyadmin.conf
delete the other settings and leave only the following:
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
save (press key "Esc" and then type ":wq")

edit file config.inc.php
# vi /usr/share/phpmyadmin/config.inc.php
find the following line
$cfg['Servers'][$i]['auth_type'] = 'cookie';
and replace 'cookie' with 'http'

Restart Apache
# service httpd restart

go to http://ServerIPaddress/phpmyadmin  and you'll find a page like this after login with user and password mysqladmin which was created when installing MySQL.


Install LAMP on Server CentOS 5.5

      LAMP is an acronym for a solution stack of free, open source software, originally coined from the first letters of Linux (operating system), Apache HTTP Server, MySQL (database software), and PHP, principal components to build a viable general purpose web server.

1. Install MySQL
# yum install mysql mysql-server
Adding MySQL to startup
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start
Create MySQLadmin User and Password
# mysqladmin -u root password YourPassSQL
# mysqladmin -h HostNameServer -u root password YourPassSQL
You can find HostNameServer on terminal console  [root@HostNameServer ~]#


2. Install Apache.
# yum -y install httpd
Adding Apache to startup, so it can automatic loaded if system restarted.
# chkconfig --levels 235 httpd on
# service httpd start
To check Apache has installed on server go to http://YourIPAddress/ and if you see as in the screenshoot that means Apache has been installed on your server.

If you get message "No Route To Host" that means you must open port 80 that still closed by firewall.
To open port 80 simply do this step:
# vi /etc/sysconfig/iptables
Add this command and save (to save press key "Esc" and then type ":wq")
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT
And then restart IPTABLES
# service iptables restart


3. Install PHP
# yum install php php-mysql php-mbstring php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
Restart Apache
# service httpd restart
To check php has been installed on server simply do following step:
# vi /var/www/http/php/index.php
and type following php code:
<?php
phpinfo();
?>
Save and go to http://YourIPAddress/php 
if php has been installed on your server, you will see a page like this:


DONE!!!
Now you can build a website on your server.