LAMP, which is a brief word for Linux, Apache, MySQL, PHP, means building a complete web server by installing three Apache and MySQL and PHP services on Linux and communicating with them. In this article, we will check how to install LAMP, Apache webserver, Maria DB, and PHP along with its modules on CentOS 7 operating system, using EPEL repository and YUM command. let’s find out what is LAMP services deeper and how can we install that one by one.
What is Apache?
Apache is a free open source HTTP web server that can be installed and run on all Linux distributions as well as Windows operating systems. The Apache web server is capable of servicing programmable pages (.htm .php .pl .cgi .js) and much more. According to statistics released in March 2020, about 33.5% of web sites are serviced by Apache.
What is MariaDB?
MariaDB is one of the most popular database interfaces in the world that can run on any type of server, allowing multiple users to access multiple databases. MariaDB is the new name for MySQL for CentOS 7 servers.
What is PHP?
A free open-source server-centric programming language is one of the best options for expanding web pages. This interpreter is capable of producing Dynamic Sites.
Step by step guide to install LAMP
- Installing the EPEL Repository
rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
- Install MariaDB, Apache, and PHP(latest version)
yum -y install mariadb-server mariadb httpd php
- Install PHP Modules
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel mod_ssl mod_security php-ioncube-loader php-mcrypt php-suhosin php-xml php-magickwand libexif php-imap openssl zip zlib
- Enable Apache and MariaDB services on Run-Levels
- Start and enable Apache Commands
systemctl start httpd.service
systemctl enable httpd.service
- Start and enable MariaDB Commands
systemctl start mariadb.service
systemctl enable mariadb.service
- Start and enable Apache Commands
- MariaDB Setting
Apply MariaDB settings using the following commandmysql_secure_installation
- Firewall Setting
We release/allow the ports 80 and 443 which are related to HTTP and HTTPS, and reload the firewall settings using the below commandsfirewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
- Hostname Setting
set a server/hostname as neededhostnamectl set-hostname myserver.operavps.com
Note: Instead of myserver.operavps.com, you should put your own server/hostname
- Installation control of Apache, MySQL, and PHP
Create a file called phpinfo.php, put it below codes in and save it to /var/www/html/phpinfo.php<php phpinfo (); ?>
Now open Http: //SERVER_IP/phpinfo.php with your browser. Your output will look like the following page
Note: Instead of SERVER_IP, you should put your own server IP
Finally, you can buy VPS to start your magic configurations and run the website(s) on your own webserver!
If you have any problems don’t hesitate to leave a comment.
Be always victorious and successful!