Install LAMP on CentOS 7

LAMP is an archetypal model of web service solution stacks, named as an acronym of the names of its original four open-source components: the Linux operating system, the Apache HTTP Server, the MySQLrelational database management system (RDBMS), and the PHP programming language. The LAMP components are largely interchangeable and not limited to the original selection. As a solution stack, LAMP is suitable for building dynamic web sites and web applications.

In this tutorial, let us see how to setup LAMP server on RHEL/CentOS 7.

Install Apache
Apache is an open-source multi-platform web server. It provides a full range of web server features including CGI, SSL and virtual domains.
The following commands should be run with root user privileges.
[user@testmachine ~]$ sudo -i

To install Apache, enter the following command in your terminal:
[root@testmachine ~]# yum install -y httpd

Start the Apache service and make it to start automatically on every reboot:
[root@testmachine ~]# systemctl start httpd
[root@testmachine ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

Install MariaDB


MariaDB is one of the most popular database servers in the world. It’s made by the original developers of MySQL and guaranteed to stay open source. Notable users include Wikipedia, Facebook and Google.
MariaDB turns data into structured information in a wide array of applications, ranging from banking to websites. It is an enhanced, drop-in replacement for MySQL. MariaDB is used because it is fast, scalable and robust, with a rich ecosystem of storage engines, plugins and many other tools make it very versatile for a wide variety of use cases.
MariaDB is developed as open source software and as a relational database it provides an SQL interface for accessing data. The latest versions of MariaDB also include GIS and JSON features.

Adding the MariaDB YUM Repository

MariaDB.repo entry, add it to a file under /etc/yum.repos.d/. (suggest something like/etc/yum.repos.d/MariaDB.repo.)
An example MariaDB.repo file for CentOS 7 is:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Installing MariaDB with YUM

With the repo file in place you can now install MariaDB like so:
sudo yum install MariaDB-server MariaDB-client
If you don't have the MariaDB GPG Signing key installed, YUM will prompt you to install it after downloading the packages (but before installing them).
Start the MariaDB service and make it to start automatically on every reboot:
[root@testmachine ~]# systemctl start mariadb
[root@testmachine ~]# systemctl enable mariadb

Install PHP
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely used open-source general purpose scripting language that is especially suited for web development and can be embedded into HTML.
Install PHP with following command:
[root@testmachine ~]# yum install -y php php-mysql php-gd php-pear

That’s it. Your LAMP server is up and ready to use.




Comments

Popular posts from this blog

Configure & Install WMIC for Observium

Zabbix Proxies on CentOS 7

Join CentOS 7 into Active Directory using realm and sssd