The most commonly used webserver in the world today is Apache. Used also from developers to create a php-mysql area on their machines, to test their work. In the Linux server world one of the most rock solid and stable distro is Centos, a free version of RedHat. This tutorial cover a basic part of Apache installation, Apache have a lot of options and configuration but most of the users use the basic, for specific configuration please refer to the official page of Apache. Let’s start. Open the Centos terminal and install two required package:
yum install –y httpd mod_ssl
With the following command
rpm -qa | grep http
verify that the package needed was installed correctly. Should display the following package or a similar one depending from the package version and if is Centos 32bit or 64bit
httpd-tools-2.2.15-29.el6.centos.i686
httpd-2.2.15-29.el6.centos.i686

The same verification with the next
rpm -qa | grep ssl
and will display the following package, depending from the package version and if is Centos 32bit or 64bit
mod_ssl-2.2.15-29.el6.centos.i686

openssl-1.0.0-27.el6.i6
After checked the package are correctly installed start the apache service:
service httpd start
And put Apache on start up with the following command:
chkconfig httpd on
After that open the browser and write “localhost” , if you see display this page every thing is correctly installed

Apache on Centos 6
Apache on Centos 6

If you are in a local network and want to share you web via internal ip, you should disable the Centos firewall writing “setup” on terminal and go to the firewall option. Now better to install also phpmyadmin for easier work with mysql. Depending from the Centos version and also from the architecture write the following command:
CentOS/RHEL 6, 32 Bit (i386):
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

CentOS/RHEL 6, 64 Bit x86_64):
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
CentOS/RHEL 5, 32 Bit (i386):
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
CentOS/RHEL 5, 64 Bit (x86_64):
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

and after that
yum -y install phpmyadmin mysql mysql-server php
restart the apache server
service mysqld start && chkconfig mysqld on
service httpd restart

After this will set the rrot password for mysql db to enter from phpmyadmin. Type in terminal:
mysql -u root
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new-password');
exit

After this restart the apache service
service httpd restart
And with the root user and the new password you enter you should be able to enter on phpmyadmin. Now you have installed a webserver and a phpmyadmin to work with the database. The working directory where the files should be stored are in /var/www/ , here you can put your project or create subfolder on it if you have multi project.

Enjoy