After the installation of a new CentOS platform, you can follow the steps in this article to setup some important configurations and install some important services. e.g. resetting the root password, set the server local time, install apache, mysql, php, php-mysql, sendmail services and so on.

1. Reset root password

[root@myserver ~]# passwd

2. Change Server Local time

[root@myserver ~]# cd /usr/share/zoneinfo (find what zone you would like)
[root@myserver ~]# cd /etc
[root@myserver ~]# ln -sf /usr/share/zoneinfo/Asia/Hong_Kong localtime

3. Install and Setup MySQL

[root@myserver ~]# yum install mysql mysql-server
[root@myserver ~]# chkconfig --levels 235 mysqld on
[root@myserver ~]# vi /etc/my.cnf

[mysqld]
default-character-set=utf8
[mysql]
default-character-set=utf8

[root@myserver ~]# service mysqld start
[root@myserver ~]# mysql_secure_installation

4. Install and Setup Apache

[root@myserver ~]# yum install httpd
[root@myserver ~]# chkconfig --levels 235 httpd on
[root@myserver ~]# edit /etc/httpd/conf/httpd.conf

ServerName your_server_name
NameVirtualHost *:80

[root@myserver ~]# service httpd start
[root@myserver ~]# vi /etc/sysconfig/iptables

-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

[root@myserver ~]# service iptables restart

5. Install and Setup PHP

[root@myserver ~]# yum install php
[root@myserver ~]# service httpd restart
[root@myserver ~]# vi /var/www/html/phpinfo.php
<?php phpinfo();?>

You should be able the access the the page http://your_server_ip/phpinfo.php.

6. Getting MySQL Support In PHP

[root@myserver ~]# yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc
[root@myserver ~]# service httpd restart

7. Install Wget

[root@myserver ~]# yum install wget

8. Install and Setup phpMyAdmin

Download phpMyAdmin (http://www.phpmyadmin.net/home_page/downloads.php)

[root@myserver ~]# wget phpMyAdmin_package
[root@myserver ~]# tar zxvf phpMyAdmin_package
[root@myserver ~]# mv untar_phpMyAdmin_package /home/pma
[root@myserver ~]# vi /etc/httpd/conf.d/pma.conf

#<Directory "/home/pma">
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#</Directory>Alias /phpmyadmin /home/pma
Alias /phpMyAdmin /home/pma
Alias /pma /home/pma

[root@myserver ~]# cd /home/pma/
[root@myserver ~]# cp -p config.sample.inc.php config.inc.php
[root@myserver ~]# service httpd restart

9. Install and Setup Sendmail

[root@myserver ~]# yum install sendmail
[root@myserver ~]# chkconfig --levels 235 sendmail on
[root@myserver ~]# service sendmail start