HowTo : Install LAMP on CentOS/RHEL
In this guide, I will show you, how to install LAMP (Linux, Apache, MySQL, PHP) - a stack of free, open source software for building a web server for general purpose.
1. Install Apache HTTP Server
Backup the apache configuration file 'httpd.conf'.
Set the apache service to start at boot.
Open the httpd configuration file and un-comment the line, containing the text "NameVirtualHost *:80".
Add the rules to IPTABLES.
Append the following lines before the REJECT line, to open http and https ports 80 and 443 :
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
Save and close the file. Restart the firewall.
Start the Apache HTTP Server daemon.
Visit http://localhost/ in your web browser, if you've installed server on your local machine, or enter the server's IP address. You should see an Apache Test Page.
2. Install MySQL
Set the MySQL service to start at boot.
Start the MySQL service.
Set the root password for MySQL.
Test connectivity to MySQL.
3. Install PHP
You should now have the latest PHP installed :