How to Install Apache, PHP, and MySQL on Virtual Private Server (VPS) Centos

How to Install Apache, PHP, MySQL on Virtual Private Server (VPS) Centos - Now I will try to share how to setup VPS. What is VPS?? you can klik here.
There are many the example of webserver is Apache, nginx, etc.

Now, I will explaining How to Install Apache, PHP, MySQL on Virtual Private Server (VPS) Centos:

First, INSTALL MYSQL
yum install mysql mysqlserver
After it, Let's we setup mysql for runnung automatic when starting up
chkconfig –levels 235 mysqld on
And than, start mysql using command
/etc/init.d/mysqld start
or
service mysqld start 
Creating password for mysql database

mysqladmin -u root password yourpassword
mysqladmin -h server.latihan.com -u root password yourpassword
Second , INSTALL APACHE2
yum install httpd
 Let's we setup apache for runnung automatic when starting up
chkconfig –levels 235 httpd on
 And than, start apache using command
/etc/init.d/httpd start
or
service httpd start
And than, test apache using web browser, access your VPS IP or if you are using Server PC write http://localhost or http://127.0.0.1
If you are see Apache 2 Test Page, it is work :D
In the CentOS, the default of directory webserver is /var/www/html
and files of configuration is on /etc/httpd/conf/httpd.conf and direktory /etc/httpd/conf.d/

Third, INSTALL PHP5
After you are install Apache, you can install PHP using command
yum install php
And than, restart your apache
/etc/init.d/httpd restart
or
service httpd restart 
You can testing the service of php using this file. run below command
vi /var/www/html/info.php
Then, press i , and than insert/write the script of below
<?php
phpinfo();
?>
Then, press ESC, then :w and exit :q
After it, you can check it file on your browser, access using http://ipvps/info.php IP VPS  or localhost http://localhost/info.php or http://127.0.0.1/info.php

Fouth, SETTING PHP5 SUPPORT ON MYSQL
For php service can supporting on MySQL, so we must install moduls of php, you can search moduls of php using this command
yum search php
Install the moduls
yum install -y php php-devel php-gd php-mbstring php-mcrypt php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel 

And than, restart your apache
/etc/init.d/httpd restart
or
service httpd restart 
Finish, Now your CentOS were running nginx apache2 webserver, PHP, and MySQL.

Paper 4Share -  How to Install Apache, PHP, MySQL on Virtual Private Server (VPS) Centos