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 mysqlserverAfter it, Let's we setup mysql for runnung automatic when starting up
chkconfig –levels 235 mysqld onAnd than, start mysql using command
/etc/init.d/mysqld startCreating password for mysql database
or
service mysqld start
mysqladmin -u root password yourpasswordSecond , INSTALL APACHE2
mysqladmin -h server.latihan.com -u root password yourpassword
yum install httpdLet's we setup apache for runnung automatic when starting up
chkconfig –levels 235 httpd onAnd than, start apache using command
/etc/init.d/httpd startAnd 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
or
service httpd start
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 phpAnd than, restart your apache
/etc/init.d/httpd restartYou can testing the service of php using this file. run below command
or
service httpd restart
vi /var/www/html/info.phpThen, press i , and than insert/write the script of below
<?phpThen, press ESC, then :w and exit :q
phpinfo();
?>
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 phpInstall 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 restartFinish, Now your CentOS were running
or
service httpd restart
Paper 4Share - How to Install Apache, PHP, MySQL on Virtual Private Server (VPS) Centos