{"id":7930,"date":"2020-03-23T16:05:10","date_gmt":"2020-03-23T08:05:10","guid":{"rendered":"http:\/\/rmohan.com\/?p=7930"},"modified":"2020-03-23T16:05:16","modified_gmt":"2020-03-23T08:05:16","slug":"lemp-is-an-acronym-for-linux-nginx-pronounced-engine-x-mariadb-mysql-and-php-centos-8-1","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7930","title":{"rendered":"LEMP is an acronym for Linux, Nginx (pronounced Engine X), MariaDB \/ MySQL, and PHP. Centos 8.1"},"content":{"rendered":"\n<p>LEMP is a software stack that includes a set of free open source tools that are used to power high traffic and dynamic websites. LEMP is an acronym for Linux, Nginx (pronounced Engine X), MariaDB \/ MySQL, and PHP.<\/p>\n\n\n\n<p>Nginx is an open source, powerful and high-performance web server that can also double as a reverse proxy. MariaDB is a database system for storing user data, while PHP is a server-side scripting language for developing and supporting dynamic web pages.<\/p>\n\n\n\n<p>Related:<\/p>\n\n\n\n<p>In this article, you will learn how to install a LEMP server on a CentOS 8 Linux distribution.<\/p>\n\n\n\n<p>Step 1: Update the package on CentOS 8<\/p>\n\n\n\n<p>First, update the repository and packages on CentOS 8 Linux by running the following dnf command.<\/p>\n\n\n\n<p>dnf update<\/p>\n\n\n\n<p>Step 2: Install Nginx web server on CentOS 8<\/p>\n\n\n\n<p>After the package update is complete, install Nginx with a simple command.<\/p>\n\n\n\n<p>dnf install nginx<\/p>\n\n\n\n<p>Install Nginx on CentOS 8<\/p>\n\n\n\n<p>The code snippet shows that the installation of Nginx went smoothly without any problems.<\/p>\n\n\n\n<p>After the installation is complete, configure Nginx to start automatically at system startup, and verify that Nginx is running by executing a command.<\/p>\n\n\n\n<p>systemctl enable nginx<br>\nsystemctl start nginx<br>\nsystemctl status nginx<\/p>\n\n\n\n<p>nginx -v<\/p>\n\n\n\n<p>Step 3: Install MariaDB on CentOS 8<\/p>\n\n\n\n<p>MariaDB is a free and open source branch of MySQL and provides the latest features that make it a better alternative to MySQL. To install MariaDB, run the command.<\/p>\n\n\n\n<p>dnf install mariadb-server mariadb -y<\/p>\n\n\n\n<p>To make MariaDB start automatically at system startup, run.<\/p>\n\n\n\n<p>systemctl start mariadb<br>\nsystemctl enable mariadb<\/p>\n\n\n\n<p>The MariaDB database engine is not secure and anyone can log in without credentials. To harden MariaDB and protect it to minimize the chance of unauthorized access, run the command.<\/p>\n\n\n\n<p>mysql_secure_installation<\/p>\n\n\n\n<p>Step 4: Install PHP 7 on CentOS 8<\/p>\n\n\n\n<p>Finally, we will install the last LEMP component, PHP, which is a scripted web programming language that is usually used to develop dynamic web pages.<\/p>\n\n\n\n<p>At the time of writing this guide, the latest version is PHP 7.4. We will install it using the Remi repository. The Remi database is a free database that comes with the latest cutting-edge software version and is not available on CentOS by default.<\/p>\n\n\n\n<p>Run the following command to install the EPEL repository.<\/p>\n\n\n\n<p>dnf install https:\/\/dl.Fedoraproject.org\/pub\/epel\/epel-release-latest-8.noarch.rpm<\/p>\n\n\n\n<p>dnf install dnf-utils http:\/\/rpms.remirepo.net\/enterprise\/remi-release-8.rpm<\/p>\n\n\n\n<p>dnf module list php<\/p>\n\n\n\n<p>CentOS-8 &#8211; AppStream<br>\nName    Stream        Profiles                      Summary                 <br>\nphp      7.2 [d][e]    common [d], devel, minimal    PHP scripting language <br>\nphp      7.3            common, devel, minimal        PHP scripting language <\/p>\n\n\n\n<p>Remi&#8217;s Modular repository for Enterprise Linux 8 &#8211; x86_64<br>\nName    Stream        Profiles                      Summary                 <br>\nphp      remi-7.2      common [d], devel, minimal    PHP scripting language <br>\nphp      remi-7.3      common [d], devel, minimal    PHP scripting language <br>\nphp      remi-7.4      common [d], devel, minimal    PHP scripting language <\/p>\n\n\n\n<p>dnf module reset php<\/p>\n\n\n\n<p>dnf module enable php:remi-7.4<\/p>\n\n\n\n<p>dnf install php php-opcache php-gd php-curl php-mysqlnd<\/p>\n\n\n\n<p>php -v<br>\nPHP 7.4.3 (cli) (built: Feb 18 2020 11:53:05) ( NTS )<br>\nCopyright (c) The PHP Group<br>\nZend Engine v3.4.0, Copyright (c) Zend Technologies<br>\n    with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies<\/p>\n\n\n\n<p>systemctl start php-fpm<br>\nsystemctl enable php-fpm    <\/p>\n\n\n\n<p>nano \/etc\/php-fpm.d\/www.conf<\/p>\n\n\n\n<p>user = apache<br>\ngroup = apache<\/p>\n\n\n\n<p>user = nginx<br>\ngroup = nginx<\/p>\n\n\n\n<p>systemctl restart nginx    <br>\nsystemctl restart php-fpm<\/p>\n\n\n\n<p>cd \/usr\/share\/nginx\/html\/<br>\n$echo &#8220;&#8221; &gt; index.php<\/p>\n","protected":false},"excerpt":{"rendered":"\n<p>LEMP is a software stack that includes a set of free open source tools that are used to power high traffic and dynamic websites. LEMP is an acronym for Linux, Nginx (pronounced Engine X), MariaDB \/ MySQL, and PHP.<\/p>\n<p>Nginx is an open source, powerful and high-performance web server that can also double as [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[99],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7930"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7930"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7930\/revisions"}],"predecessor-version":[{"id":7931,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7930\/revisions\/7931"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}