After install your Operating System (could be CentOS), the first thing you may think about install Apache, PHP and MySQL on the server.
This tutorial will let you know how to Install LAMP (Apache, MySQL and PHP in Linux) on CentOS. We will use YUM program to install LAMP in CentOS.
Below are the steps:
1. Open a terminal and type following command and follow on screen instructions to install Apache web server.
[text] yum install httpd[/text]
2. Once Apache has been installed, continue to install PHP, type:
[text] yum install php[/text]
3. After PHP installed, continue to install MySQL database server:
[text] yum install mysql-server mysql[/text]
That’s all, once everything finished, type following command to start Apache web server:
[text] service httpd start[/text]
And type below command to start MySQL database server
[text] service mysqld start[/text]
Once apache & mysql services are started successfully, it’s time to check if both of them are running.
1. Apache/PHP
To test if php is running, go to /var/www/html and create an index.php with the content below:
[php] <?phpphpinfo();
?>
[/php]
Then open a web browser and go to http://localhost and you should see a purple PHP information page showing all the php configuration variables, it means PHP is running. Awesome!
2. MySQL
Open the terminal again and type:
[text] mysql -u root -p[/text]
It will ask the password, leave it blank by pressing enter and you should see something like this:
[text] mysql>[/text]
It means MySQL database server is running on your server. That’s perfect!
Congratulation, you just successfully installed LAMP in your CentOS server.
This tutorial may apply for others Linux system, I think.