How To Install a LAMP Stack on CentOS 6
LAMP stands for Linux Apache MySQL and PHP. It is the easiest and yet most effective installations you will have to perform.
First we install Apache
1. sudo yum install httpd
2. sudo service httpd start
Now go to your domain or public IP in a web browser to check if Apache is working correctly
Our next step is to install MySQL
1. sudo yum install mysql-server
2. sudo service mysqld start
MySQL should prompt you for permission a few times during the installation.
Set your root password next:
1. sudo /usr/bin/mysql_secure_installation
Since this is a new install, you should not have a root password yet so live it blank and click enter.
Now, as the following prompts appear enter:
1. Y
2. Y
3. Y
4. Y
5. Y
And now you are done installing MySQL
For the final portion of our LAMP stack we must install PHP
To install PHP you must start by:
1. sudo yum install php php-mysql
If you feel you need other modules, enter:
1. yum search php-
Now that we have everything installed correctly, make sure it all runs on reboot:
1. sudo chkconfig httpd on
2. sudo chkconfig mysqld on
3. sudo service httpd restart
4. sudo service mysqld restart
Now you can start to upload your website to the following directory:
1. /var/www/html