11-03-2012, 09:18 AM
MySQL Installation:
yum install mysql mysql-server
Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
Set passwords for the MySQL root account:
mysql_secure_installation
~[root@server1 ~]# mysql_secure_installation ~
When It Asks To Set MySQL Pass [y/N] choose N
_________________________________________________________________________________________________
Installing Apache2
yum install httpd
Now configure your system to start Apache at boot time...
chkconfig --levels 235 httpd on
... and start Apache:
/etc/init.d/httpd start
Installing PHP5
We can install PHP5 and the Apache PHP5 module as follows:
yum install php
We must restart Apache afterwards:
/etc/init.d/httpd restart
_________________________________________________________________
Testing PHP5 / Getting Details About Your PHP5 Installation
The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.
vi /var/www/html/info.php
<?php
phpinfo();
?>
_________________________________________________________________________________________________
Getting MySQL Support In PHP5
To get MySQL support in PHP, we can install the php-mysql package. It's a good idea to install some other PHP5 modules as well as you might need them for your applications. You can search for available PHP5 modules like this:
yum search php
Pick the ones you need and install them like this:
yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc
APC can be installed as follows:
yum install php-pecl-apc
Now restart Apache2:
/etc/init.d/httpd restart
__________________________________________________________________________________________________
Installing phpMyAdmin
First we enable the RPMforge repository on our CentOS system as phpMyAdmin is not available in the official CentOS 6.3 repositories:
Import the RPMforge GPG key:
rpm --import 2
On x86_64 systems:
yum install 2
On i386 systems:
yum install 2
phpMyAdmin can now be installed as follows:
yum install phpmyadmin
Now we configure phpMyAdmin. We change the Apache configuration so that phpMyAdmin allows connections not just from localhost (by commenting out the <Directory "/usr/share/phpmyadmin"> stanza):
vi /etc/httpd/conf.d/phpmyadmin.conf
Press: Shift + : and write: wq
Next we change the authentication in phpMyAdmin from cookie to http:
vi /usr/share/phpmyadmin/config.inc.php
Change Like It:
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';
Restart Apache:
/etc/init.d/httpd restart
Afterwards, you can access phpMyAdmin under 2 ip/phpmyadmin/
To get Ip Adress
ifconfig
Credits to www.howtoforge.com

