LAMP is a basic server installation of open source software that is also an acronym. The acronym stands for: Linux, Apache, MySQL and PHP.
Since the server comes with CentOS 7 installed, we just need to install Apache, MySQL, and PHP.
The VPS or server you perform this installation on needs to be CentOS 7. This tutorial was installed successfully on a 1GB RAM VPS with CentOS 7 installed.
Step one: Update
To start, lets go ahead and update the VPS repositories. Run the command:
sudo yum update
The sudo argument runs each of these commands with root privileges. Great! Your VPS will now update its repositories. Once it has finished, you are ready to onto step two!
Step two: Install Apache
Apache is free webserver software that is very commonly used worldwide.
To install apache, we need to run:
sudo yum install httpd
Now that we have installed apache, we need to start it of course! Run:
sudo systemctl start httpd.service
To make sure apache starts everytime we boot the VPS, also run:
sudo systemctl enable httpd.service
Perfect! We have installed and started the webserver, Apache. We also made it so apache starts upon boot of the VPS. Time to go on to step three.
Step three: Install MySQL
MySQL is a advanced database system that is used to send and retrieve data. It is very commonly used on virtual private servers.
To install MySQL, we are going to run:
sudo yum install mariadb-server mariadb
Once MySQL has finished installing, its time to start MySQL. Run:
sudo systemctl start mariadb
Great! Now that we have installed and started MySQL, its time to setup MySQL. Run:
After you run that command, it will start asking you questions. The first question asks you to enter the current root password for MySQL. If you have it set, type it in and hit enter. If you have not set it, just hit enter then hit Y when it asks you if you would like to set a root password. Below I have pasted how I went through this step:
Now that you have set the root password or entered the root password, use Y to answer the rest of the questions.
To finish this step, lets enable MySQL to start upon the server boot. Run:
sudo systemctl enable mariadb.service
Step five: Install PHP
PHP is an extremely common web scripting language. Just like PHP, it is open source.
To install PHP, we need to run:
sudo yum install php php-mysql
After PHP installs, you are finished! You have installed the LAMP setup on your CentOS 7 VPS server!