What is LAMP?
L = operating system, Linux
A = web server, Apache
M = database server, MySQL
P = programming language, PHP
1. First of all, make sure that your server already has CentOS 7 installed
- Once you login to the CentOS 7 please make sure the version is up to date
yum update
2. Install Apache
- You can easily install Apache by using the yum package by typing the command below
sudo yum install httpd -y
- Once installed, make sure the apache is activate by typing the command below
sudo systemctl start httpd.service
- To verify it you may type your IP address on your browser and you will get the result below
- The second options to verify it is to type command systemctl status httpd.service
3. Install MYSQL (MariaDB)
- Here we will use MaridDB as our database SQL server which is open source. The command to install is as follows:
sudo yum install mariadb-server mariadb -y
- Now, let’s start the MariaDB service and check on the status
sudo systemctl start mariadb
sudo systemctl status mariadb
4. Install PHP
- First, you have to install yum-utils and enable EPEL (Extra Packages for Enterprise Linux) repository:
yum install epel-release yum-utils
- Install and enable remirepo:
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php73
- Install php with the following command
yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd
- Verify php version by typing command yum info php
- Restart your Apache server to make sure it working with the new installed PHP
systemctl restart httpd.service
You have successfully installed LAMP to your system