In this tutorial I will explain how to install and setup LAMP on a RHEL/CentOS Linux 6.x server.
Before I start the tutorial, let’s know what is LAMP. LAMP stack is a group of open source software used to get web servers up and running. LAMP stands for Linux, Apache, MySQL, and PHP.
- Install Linux
- Install Apache
- Install MySQL
- Install PHP
Your VPS / dedicated server comes with pre-installed Linux OS. You can select your linux OS during order process. So, we do not need to install Linux. Select CentOS 6 Linux OS during order process.
Login to your server via SSH as root and run following commands
yum install httpd service httpd start
A more detailed tutorial is here: How to install Apache on a Linux Server
Run below commands to install MySQL
yum install mysql-server service mysqld start /usr/bin/mysql_secure_installation
MySQL server will ask MySQL server root password. Since you just installed mysql, there is no MySQL root password. So, just press enter. Create MySQL root password and complete the installation.
Please refer here for complete step by step installation: How To Install MySQL on a CentOS Server
After installing Apache and MySQL, we will install PHP. Run following commands
yum install php php-mysql service httpd restart
A more detailed tutorial for installing PHP is here: How To Install PHP on a CentOS server
Your server is ready to host and run websites.