Knowledge Base

How To Install Linux, Apache, MySQL, PHP (LAMP) stack On CentOS 7

A “LAMP” stack is a group of open-source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is an acronym which represents the Linux operating system, with the Apache web server. The site data is typically stored in a MySQL database and dynamic content is processed by PHP.

Installing the Apache Web Server
Apache is a popular open-source web server that is used to display web pages to visitors. You can configure it to serve PHP pages.

sudo yum install httpd
sudo systemctl start httpd
sudo systemctl enable httpd.service

Installing MySQL (MariaDB)
With your web server up and running, you can install MariaDB. It will organize and provide access to databases where your site can store information.

sudo yum install mariadb-server
sudo systemctl start mariadb
sudo systemctl enable mariadb.service

To improve the security of your database server, it’s recommended that you run a security script that comes pre-installed with MariaDB. This script will remove some insecure default settings and lock down access to your database system.

sudo mysql_secure_installation

Installing PHP
You have Apache installed to serve your content and MariaDB to store and manage your data. PHP will process code to display dynamic content to the user.

sudo yum install php php-mysql
sudo systemctl restart httpd.service
Please rate this article to help us improve our Knowledge Base.

9 0