{"id":762,"date":"2015-05-08T16:59:20","date_gmt":"2015-05-09T01:59:20","guid":{"rendered":"http:\/\/blog.box.kr\/?p=762"},"modified":"2015-05-08T16:59:20","modified_gmt":"2015-05-09T01:59:20","slug":"install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7","status":"publish","type":"post","link":"https:\/\/blog.box.kr\/?p=762","title":{"rendered":"Install and configure Nginx, MariaDB &amp; PHP-FPM in CentOS 7 (RHEL7)"},"content":{"rendered":"<p><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7\">https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The following is a quick-N-dirty write-up on<span class=\"Apple-converted-space\">\u00a0<\/span><strong>how to install and configure the LEMP stack (Nginx, MariaDB and PHP-FPM) in<span class=\"Apple-converted-space\">\u00a0<\/span><a href=\"https:\/\/stavrovski.net\/blog\/tag\/centos\">CentOS 7<\/a><\/strong>. I use this as a reference\/guide whenever I need to deploy the<span class=\"Apple-converted-space\">\u00a0<\/span><a href=\"https:\/\/stavrovski.net\/blog\/tag\/lemp\">LEMP stack<\/a><span class=\"Apple-converted-space\">\u00a0<\/span>on RHEL based machines.<\/p>\n<hr \/>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">TABLE OF CONTENTS<\/h4>\n<ul>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#enable-epel\">Enable EPEL Repository<\/a><\/li>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#update-system\">Update CentOS 7<\/a><\/li>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#install-mariadb\">Install and configure MariaDB<\/a><\/li>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#install-nginx\">Install and configure Nginx<\/a>\n<ul>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#nginx-default-server-block\">Default VHOST<\/a><\/li>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#nginx-laravel-server-block\">Laravel VHOST<\/a><\/li>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#nginx-wordpress-server-block\">WordPress VHOST<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#install-php\">Install and configure PHP-FPM<\/a>\n<ul>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#php-etc-ini\">Set-up \/etc\/php.ini<\/a><\/li>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#php-etc-fpm\">Set-up \/etc\/php-fpm.conf<\/a><\/li>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#php-etc-fpm-pools\">Set-up FPM pools<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7#restart-services\">Enable and restart the services<\/a><\/li>\n<\/ul>\n<div id=\"enable-epel\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">ENABLE EPEL REPOSITORY<\/h4>\n<p>Install<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">wget<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>and<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">vim<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>using<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">yum<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>if they&#8217;re not present on the<span class=\"Apple-converted-space\">\u00a0<\/span><strong>CentOS 7<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>system:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">if ! type -path \"wget\" &gt; \/dev\/null 2&gt;&amp;1; then yum install wget -y; fi\nif ! type -path \"vim\" &gt; \/dev\/null 2&gt;&amp;1; then yum install vim -y; fi\n<\/code><\/pre>\n<p>Next, download the<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">rpm<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>package and install it using<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">yum<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>as in:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">wget -P \/tmp http:\/\/dl.fedoraproject.org\/pub\/epel\/beta\/7\/x86_64\/epel-release-7-0.2.noarch.rpm\nyum install \/tmp\/epel-release-7-0.2.noarch.rpm\nrm -f \/tmp\/epel-release-7-0.2.noarch.rpm\n<\/code><\/pre>\n<div id=\"update-system\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">UPDATE THE SYSTEM<\/h4>\n<p>Ok, first thing to do before<span class=\"Apple-converted-space\">\u00a0<\/span><strong>installing LEMP<\/strong>, is to make sure the<span class=\"Apple-converted-space\">\u00a0<\/span><strong>CentOS 7<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>system is fully up-to-date by running the following command in your terminal:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">yum update\n<\/code><\/pre>\n<p><em>if there is a kernel update, make sure you&#8217;re booted into it before proceeding further.<\/em><\/p>\n<div id=\"install-mariadb\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">INSTALL AND CONFIGURE MARIADB DATABASE SERVER<\/h4>\n<p>Default database server in CentOS 7 (RHEL 7) is<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">MariaDB<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>now. It is a drop in replacement for<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">MySQL<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>and can be installed using<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">yum<\/code>, so<span class=\"Apple-converted-space\">\u00a0<\/span><strong>install MariaDB<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>using:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">yum install mariadb mariadb-server\n<\/code><\/pre>\n<p>once installed,<span class=\"Apple-converted-space\">\u00a0<\/span><strong>restart MariaDB<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>using<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">systemctl<\/code>:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">systemctl restart mariadb\nsystemctl status mariadb\n<\/code><\/pre>\n<p>optionally,<span class=\"Apple-converted-space\">\u00a0<\/span><strong>set-up MariaDB<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>server using the<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">mysql_secure_installation<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>post-installation script:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">mysql_secure_installation\n<\/code><\/pre>\n<p>answer the questions when prompted, for example in my case:<\/p>\n<ul>\n<li>Enter current password for root (enter for none):<\/li>\n<li>Set root password? [Y\/n] y<\/li>\n<li>Remove anonymous users? [Y\/n] y<\/li>\n<li>Disallow root login remotely? [Y\/n] y<\/li>\n<li>Remove test database and access to it? [Y\/n] y<\/li>\n<li>Reload privilege tables now? [Y\/n] y<\/li>\n<\/ul>\n<p>next, edit<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">\/etc\/my.cnf.d\/server.cnf<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>and add<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">bind-address = 127.0.0.1<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>within the<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">[mysqld]<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>block:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">vim +\/^[mysqld \/etc\/my.cnf.d\/server.cnf\n\n[mysqld]\nbind-address = 127.0.0.1\n<\/code><\/pre>\n<p><strong>restart MariaDB<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>for the changes to take effect:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">systemctl restart mariadb\nsystemctl status mariadb\n<\/code><\/pre>\n<p>verify MariaDB is listening on localhost only using the<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">ss<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>command:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">ss -tnlp | grep 3306\nLISTEN  0  0   127.0.0.1:3306  *:* users:((\"mysqld\",1159,14))\n<\/code><\/pre>\n<div id=\"install-nginx\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">INSTALL AND CONFIGURE NGINX<\/h4>\n<p><strong>Install Nginx<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>on the<span class=\"Apple-converted-space\">\u00a0<\/span><strong>CentOS 7<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>system using<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">yum<\/code>:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">yum install nginx\n<\/code><\/pre>\n<p>next, navigate to<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">\/etc\/nginx<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>and backup your original Nginx configuration file<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">cd \/etc\/nginx\ncp nginx.conf{,.orig}\n<\/code><\/pre>\n<p>and edit<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">\/etc\/nginx.conf<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>to look like the one below:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">cat &gt; nginx.conf\n\n## NGINX MAIN CONFIGURATION FILE ##\nuser nginx nginx;\nworker_processes 2;\nerror_log  \/var\/log\/nginx\/error.log info;\nevents {\n    worker_connections  1024;\n    use epoll;\n}\nhttp {\n    include       \/etc\/nginx\/mime.types;\n    default_type  application\/octet-stream;\n    log_format main\n                '$remote_addr - $remote_user [$time_local] '\n                '\"$request\" $status $bytes_sent '\n                '\"$http_referer\" \"$http_user_agent\" '\n                '\"$gzip_ratio\"';\n    access_log  \/var\/log\/nginx\/access.log  main;\n    sendfile        on;\n    tcp_nopush on;\n    tcp_nodelay on;\n    ignore_invalid_headers on;\n    keepalive_timeout  30;\n    server_tokens off;\n    connection_pool_size 256;\n    client_header_buffer_size 1k;\n    large_client_header_buffers 4 2k;\n    request_pool_size 4k;\n    output_buffers 1 32k;\n    postpone_output 1460;\n    client_header_timeout 10m;\n    client_body_timeout 10m;\n    send_timeout 10m;\n    gzip on;\n    gzip_disable \"MSIE [1-6].(?!.*SV1)\";\n    gzip_http_version 1.1;\n    gzip_vary on;\n    gzip_proxied any;\n    gzip_comp_level 6;\n    gzip_buffers 16 8k;\n    gzip_types text\/plain text\/css application\/json application\/x-javascript text\/xml application\/xml application\/xml+rss text\/javascript application\/javascript text\/x-js;\n    include \/etc\/nginx\/sites-enabled\/*.conf;\n}\n## NGINX MAIN CONFIGURATION FILE ##\n<\/code><\/pre>\n<p>of course, feel free to change anything you think should be changed in order to suit your needs. for example, you may want to change the user\/group nginx runs under or you may want to set the<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">worker_processes<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>option, which is determined by the number of CPU&#8217;s the machine has.<\/p>\n<p>you can use the following command to find what number to use there:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">grep -c 'model name' \/proc\/cpuinfo\n<\/code><\/pre>\n<p>also as you may noticed, there is<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">include \/etc\/nginx\/sites-enabled\/*.conf<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>inside the Nginx main configuration file. This means, include all available configuration files in<code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">\/etc\/nginx\/sites-enabled\/<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>which end with<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">.conf<\/code>. The idea here is to store Nginx server-blocks that are going to be set-up later on, playing the<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">Debian-way<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>by having the files<span class=\"Apple-converted-space\">\u00a0<\/span><strong>created in sites-available<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>and then linking the ones I want enabled to<span class=\"Apple-converted-space\">\u00a0<\/span><strong>sites-enabled<\/strong><\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">mkdir \/etc\/nginx\/{sites-available,sites-enabled}\n<\/code><\/pre>\n<div id=\"nginx-default-server-block\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">DEFAULT NGINX SERVER BLOCK (VHOST)<\/h4>\n<p>set-up<span class=\"Apple-converted-space\">\u00a0<\/span><strong>default Nginx server block<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>in<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">\/etc\/nginx\/sites-available\/default.conf<\/code><\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">cat &gt; \/etc\/nginx\/sites-available\/default.conf\n\nserver {\n    listen       80 default_server;\n    server_name  _;\n    root   \/srv\/www\/default;\n    location \/ {\n        index  index.html index.htm;\n    }\n    error_page  404              \/404.html;\n    location = \/404.html {\n        root   \/srv\/www\/default;\n    }\n    error_page   500 502 503 504  \/50x.html;\n    location = \/50x.html {\n        root   \/srv\/www\/default;\n    }\n}\n<\/code><\/pre>\n<p>create the document root for the default Nginx server-block and set-up the default html files:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">mkdir -p \/srv\/www\/default\n\nCONTENT='&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n        &lt;title&gt;ViruSzZ&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body style=\"background:#000;color:#fff;\"&gt;\n        &lt;div style=\"color:#fff;width:100%;\"&gt;\n                &lt;h1 align=\"center\"&gt;you feel the silence?&lt;\/h1&gt;\n        &lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;'\n\necho ${CONTENT} &gt; \/srv\/www\/default\/index.html\n\n#------#\n\nCONTENT='&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n        &lt;title&gt;404&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body style=\"background:#000;color:#fff;\"&gt;\n        &lt;div style=\"color:#fff;width:100%;\"&gt;\n                &lt;h1 align=\"center\"&gt;404 straight in your face&lt;\/h1&gt;\n        &lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;'\n\necho ${CONTENT} &gt; \/srv\/www\/default\/404.html\n\n#------#\n\nCONTENT='&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n        &lt;title&gt;Whoooopsssss&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body style=\"background:#000;color:#fff;\"&gt;\n        &lt;div style=\"color:#fff;width:100%;\"&gt;\n                &lt;h1 align=\"center\"&gt;Whoooopssssssy... Something wrong happend back here!&lt;\/h1&gt;\n        &lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;'\n\necho ${CONTENT} &gt; \/srv\/www\/default\/50x.html\nunset CONTENT\n<\/code><\/pre>\n<div id=\"nginx-laravel-server-block\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">LARAVEL NGINX SERVER BLOCK (VHOST)<\/h4>\n<p><strong>set-up Nginx server block<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>for Laravel (PHP) based web application, served using<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">d.stavrovski.net<\/code><\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">cat &gt; \/etc\/nginx\/sites-available\/d.stavrovski.net.conf\n\nserver {\n    listen 80;\n    server_name d.stavrovski.net www.d.stavrovski.net daniel.stavrovski.net;\n    return 301 http:\/\/d.stavrovski.net$request_uri;\n\n    access_log \/var\/log\/nginx\/d.stavrovski.net.log;\n    error_log \/var\/log\/nginx\/d.stavrovski.net-error.log error;\n\n    root \/srv\/www\/d.stavrovski.net\/public;\n    index index.html index.php;\n\n    ### ROOT DIRECTORY ###\n    location \/ {\n        try_files $uri $uri\/ \/index.php?$args;\n    }\n\n    ### SECURITY ###\n    error_page 403 =404;\n    error_page 404 \/404-not-found.html;\n\n    location  \/404-not-found.html {\n        internal;\n    }\n\n    location ~* ^\/uploads\/.*.(html|htm|shtml|php)$ {\n        types { }\n        default_type text\/plain;\n    }\n\n    location ~* ^\/cache\/.* {\n        return 404;\n    }\n\n    #  location ~* admin {\n    #      allow &lt;YOUR_IP&gt;;\n    #      allow 127.0.0.1;\n    #      deny all;\n    #  }\n\n    ### DISABLE LOGGING ###\n    location = \/robots.txt { access_log off; log_not_found off; }\n    location = \/favicon.ico { access_log off; log_not_found off; }\n\n    ### CACHES ###\n    location ~* .(jpg|jpeg|gif|css|png|js|ico|html)$ { access_log off; expires max; }\n    location ~* .(woff|svg)$ { access_log off; log_not_found off; expires 30d; }\n    location ~* .(js)$ { access_log off; log_not_found off; expires 7d; }\n\n    location \/uploads\/ {\n        valid_referers none blocked d.stavrovski.net *.stavrovski.net;\n        if ($invalid_referer) {\n            return   403;\n        }\n    }\n\n    fastcgi_buffers 256 16k;\n    fastcgi_buffer_size 32k;\n    fastcgi_connect_timeout 300;\n    fastcgi_send_timeout 300;\n    fastcgi_read_timeout 300;\n\n    ### PHP BLOCK ###\n    location ~ .php?$ {\n        fastcgi_keep_conn on;\n        try_files $uri =404;\n        include fastcgi_params;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        fastcgi_intercept_errors on;\n        fastcgi_split_path_info ^(.+.php)(.*)$;\n        fastcgi_hide_header X-Powered-By;\n        # fastcgi_pass 127.0.0.1:9000;\n        fastcgi_pass unix:\/var\/run\/d.stavrovski.net.socket;\n        # fastcgi_pass unix:\/var\/run\/hhvm\/hhvm.sock;\n    }\n}\n<\/code><\/pre>\n<div id=\"nginx-wordpress-server-block\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">WORDPRESS NGINX SERVER BLOCK (VHOST)<\/h4>\n<p><strong>set-up Nginx server block<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>for WordPress based web application, served using<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">wordpress.stavrovski.net<\/code><\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">cat &gt; \/etc\/nginx\/sites-available\/wordpress.stavrovski.net.conf\n\nserver {\n    listen 80;\n    server_name wordpress.stavrovski.net www.wordpress.stavrovski.net;\n\n    client_max_body_size 5m;\n    client_body_timeout 60;\n\n    access_log \/var\/log\/nginx\/wordpress.stavrovski.net.log;\n    error_log \/var\/log\/nginx\/wordpress.stavrovski.net-error error;\n\n    root \/srv\/www\/wordpress.stavrovski.net;\n    index  index.html index.php;\n\n    ### ROOT DIRECTORY ###\n    location \/ {\n        try_files $uri $uri\/ \/index.php?$args;\n    }\n\n    ### SECURITY ###\n    error_page 403 =404;\n    location ~ \/. { access_log off; log_not_found off; deny all; }\n    location ~ ~$ { access_log off; log_not_found off; deny all; }\n    location ~* wp-admin\/includes { deny all; }\n    location ~* wp-includes\/theme-compat\/ { deny all; }\n    location ~* wp-includes\/js\/tinymce\/langs\/.*.php { deny all; }\n    location \/wp-includes\/ { internal; }\n    #location ~* wp-config.php { deny all; }\n    location ~* ^\/wp-content\/uploads\/.*.(html|htm|shtml|php)$ {\n        types { }\n        default_type text\/plain;\n    }\n    #  location ~* wp-admin {\n    #      allow &lt;YOUR_IP&gt;;\n    #      allow 127.0.0.1;\n    #      deny all;\n    #  }\n\n    ### DISABLE LOGGING ###\n    location = \/robots.txt { access_log off; log_not_found off; }\n    location = \/favicon.ico { access_log off; log_not_found off; }\n\n    ### CACHES ###\n    location ~* .(jpg|jpeg|gif|css|png|js|ico|html)$ { access_log off; expires max; }\n    location ~* .(woff|svg)$ { access_log off; log_not_found off; expires 30d; }\n    location ~* .(js)$ { access_log off; log_not_found off; expires 7d; }\n\n    ### php block ###\n    location ~ .php?$ {\n        try_files $uri =404;\n        include fastcgi_params;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        fastcgi_intercept_errors on;\n        fastcgi_split_path_info ^(.+.php)(.*)$;\n        fastcgi_hide_header X-Powered-By;\n        #fastcgi_pass 127.0.0.1:9001;\n        fastcgi_pass unix:\/var\/run\/wordpress.stavrovski.net.socket;\n    }\n}\n<\/code><\/pre>\n<p>with all that in place, let&#8217;s proceed with enabling the server-blocks and starting Nginx up:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">cd \/etc\/nginx\/sites-enabled\/\nfor d in ..\/sites-available\/*; do ln -s \/etc\/nginx\/sites-available\/${d##*\/}; done\n\nnginx -t\nsystemctl restart nginx\nsystemctl status nginx\n<\/code><\/pre>\n<div id=\"install-php\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">INSTALL AND CONFIGURE PHP-FPM<\/h4>\n<p><strong>Install PHP<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>support on the<span class=\"Apple-converted-space\">\u00a0<\/span><strong>CentOS 7<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>system using<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">yum<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>as in<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">yum install php-fpm php-mysql php-mcrypt\n<\/code><\/pre>\n<p>also, install any other PHP module that your application requires. the list is shown below or you can use<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">yum search php-<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>in the command line to get the list of available PHP modules on your CentOS 7 system:<\/p>\n<ul>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-bcmath<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications for using the bcmath library<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-cli<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; Command-line interface for PHP<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-common<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; Common files for PHP<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-dba<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A database abstraction layer module for PHP applications<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-devel<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; Files needed for building PHP extensions<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-embedded<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; PHP library for embedding in applications<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-enchant<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; Enchant spelling extension for PHP applications<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-fpm<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; PHP FastCGI Process Manager<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-gd<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications for using the gd graphics library<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-imap<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications that use IMAP<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-intl<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; Internationalization extension for PHP applications<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-ldap<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications that use LDAP<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-mbstring<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications which need multi-byte string handling<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-mcrypt<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; Standard PHP module provides mcrypt library support<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-mysql<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications that use MySQL databases<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-mysqlnd<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications that use MySQL databases<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-odbc<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications that use ODBC databases<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-pdo<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A database access abstraction module for PHP applications<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-pear.noarch<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; PHP Extension and Application Repository framework<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-pecl-memcache<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; Extension to work with the Memcached caching daemon<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-pgsql<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A PostgreSQL database module for PHP<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-process<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; Modules for PHP script using system process interfaces<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-pspell<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications for using pspell interfaces<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-recode<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications for using the recode library<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-snmp<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications that query SNMP-managed devices<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-soap<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications that use the SOAP protocol<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-xml<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications which use XML<\/li>\n<li><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">php-xmlrpc<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>&#8211; A module for PHP applications which use the XML-RPC protocol<\/li>\n<\/ul>\n<div id=\"php-etc-ini\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">SET-UP PHP CONFIGURATION FILE<\/h4>\n<p>next, set-up PHP&#8217;s main configuration file<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">\/etc\/php.ini<\/code><\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">vim \/etc\/php.ini\n\n:%s#;cgi.fix_pathinfo=1#cgi.fix_pathinfo=0#\n:%s#;date.timezone =#date.timezone = Europe\/Skopje#\n:%s#memory_limit = 128M#memory_limit = 64M#\n:%s#expose_php = On#expose_php = Off#\n<\/code><\/pre>\n<div id=\"php-etc-fpm\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">SET-UP PHP-FPM CONFIGURATION FILE<\/h4>\n<p>and edit PHP-FPM&#8217;s main configuration file<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">\/etc\/php-fpm.conf<\/code><\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">vim \/etc\/php-fpm.conf\n\n:%s#;emergency_restart_threshold = 0#emergency_restart_threshold = 10#\n:%s#;emergency_restart_interval = 0#emergency_restart_interval = 1m#\n:%s#;process_control_timeout = 0#process_control_timeout = 10#\n<\/code><\/pre>\n<div id=\"php-etc-fpm-pools\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">SET-UP PHP-FPM POOLS<\/h4>\n<p>OK, now I&#8217;m going to create PHP-FPM&#8217;s<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">pools<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>in<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">\/etc\/php-fpm.d\/<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>that I used in the server-blocks before. feel free to tune these to suit your needs.<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">cd \/etc\/php-fpm.d\/\ncp www.conf{,.orig}\n<\/code><\/pre>\n<p>FPM pool for<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">d.stavrovski.net<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>which serves a Laravel based web application:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">cat &gt; www.conf\n\n[LARAVEL]\n;listen = 127.0.0.1:9000\nlisten = \/var\/run\/d.stavrovski.net.socket\n;listen.mode = 0660\nuser = nginx\ngroup = nginx\nrequest_slowlog_timeout = 5s\nslowlog = \/var\/log\/php-fpm\/slowlog.log\nlisten.allowed_clients = 127.0.0.1\npm = dynamic\npm.max_children = 15\npm.start_servers = 7\npm.min_spare_servers = 7\npm.max_spare_servers = 15\npm.max_requests = 400\nlisten.backlog = -1\npm.status_path = \/status\nrequest_terminate_timeout = 120s\nrlimit_files = 131072\nrlimit_core = unlimited\ncatch_workers_output = yes\nphp_value[session.save_handler] = files\n;php_value[session.save_path] = \/var\/lib\/php\/session\nphp_admin_value[error_log] = \/var\/log\/php-fpm\/error.log\nphp_admin_flag[log_errors] = on\n<\/code><\/pre>\n<p>FPM pool for<span class=\"Apple-converted-space\">\u00a0<\/span><code style=\"padding: 0px 4px; border-radius: 2px; color: #eeeeee; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13.5px; box-sizing: border-box; background-color: #444444;\">wordpress.stavrovski.net<\/code><span class=\"Apple-converted-space\">\u00a0<\/span>which serves a WordPress based web application:<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">cat &gt; wordpress.conf\n\n[WORDPRESS]\n;listen = 127.0.0.1:9000\nlisten = \/var\/run\/wordpress.stavrovski.net.socket\n;listen.mode = 0660\nuser = nginx\ngroup = nginx\nrequest_slowlog_timeout = 5s\nslowlog = \/var\/log\/php-fpm\/slowlog.log\nlisten.allowed_clients = 127.0.0.1\npm = dynamic\npm.max_children = 8\npm.start_servers = 5\npm.min_spare_servers = 5\npm.max_spare_servers = 8\npm.max_requests = 400\nlisten.backlog = -1\npm.status_path = \/status\nrequest_terminate_timeout = 120s\nrlimit_files = 131072\nrlimit_core = unlimited\ncatch_workers_output = yes\nphp_value[session.save_handler] = files\n;php_value[session.save_path] = \/var\/lib\/php\/session\nphp_admin_value[error_log] = \/var\/log\/php-fpm\/error.log\nphp_admin_flag[log_errors] = on\n<\/code><\/pre>\n<div id=\"restart-services\">\n<\/div>\n<h4 style=\"font: 500 19px\/1.1 Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-top: 10.5px; margin-bottom: 10.5px; word-spacing: 0px; white-space: normal; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">ENABLE AND RESTART SERVICES<\/h4>\n<p>check Nginx&#8217;s configuration file and restart the server by running<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">nginx -t\nsystemctl restart nginx\nsystemctl status nginx\n<\/code><\/pre>\n<p>restart MariaDB (MySQL)<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">systemctl restart mariadb\nsystemctl status mariadb\n<\/code><\/pre>\n<p>restart PHP-FPM<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">systemctl restart php-fpm\nsystemctl status php-fpm\n<\/code><\/pre>\n<p>enable the services on system startup<\/p>\n<pre style=\"font: 14px\/1.4285 Monaco, Menlo, Consolas, 'Courier New', monospace; margin: 0px 0px 10.5px; padding: 10px; border-radius: 2px; border: 1px solid #cccccc; color: #333333; text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; word-spacing: 0px; display: block; -ms-word-break: break-all; -ms-word-wrap: break-word; box-sizing: border-box; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #f5f5f5; -webkit-text-stroke-width: 0px;\"><code style=\"padding: 0px; border-radius: 0px; color: inherit; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; box-sizing: border-box; background-color: transparent;\">systemctl enable nginx mariadb php-fpm\n<\/code><\/pre>\n<p>enjoy and take care<span class=\"Apple-converted-space\">\u00a0<\/span><i class=\"fa fa-smile-o\"><\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7 &nbsp; The following is a quick-N-dirty write-up on\u00a0how to install and configure the LEMP stack (Nginx, MariaDB and PHP-FPM) in\u00a0CentOS 7. I use this as a reference\/guide whenever I need to deploy the\u00a0LEMP stack\u00a0on RHEL based machines. TABLE OF CONTENTS Enable EPEL Repository Update CentOS 7 Install and configure MariaDB Install and configure Nginx Default VHOST Laravel VHOST WordPress VHOST Install and configure PHP-FPM Set-up \/etc\/php.ini Set-up \/etc\/php-fpm.conf Set-up FPM pools Enable and restart the services ENABLE EPEL REPOSITORY Install\u00a0wget\u00a0and\u00a0vim\u00a0using\u00a0yum\u00a0if they&#8217;re not present on the\u00a0CentOS 7\u00a0system: if ! type -path &#8220;wget&#8221; &gt; \/dev\/null 2&gt;&amp;1; then yum install wget -y; fi if ! type -path &#8220;vim&#8221; &gt; \/dev\/null 2&gt;&amp;1; then yum install vim -y; fi Next, download the\u00a0rpm\u00a0package and install it using\u00a0yum\u00a0as in: wget -P \/tmp http:\/\/dl.fedoraproject.org\/pub\/epel\/beta\/7\/x86_64\/epel-release-7-0.2.noarch.rpm yum install \/tmp\/epel-release-7-0.2.noarch.rpm rm -f \/tmp\/epel-release-7-0.2.noarch.rpm UPDATE THE SYSTEM Ok, first thing to do before\u00a0installing LEMP, is to make sure the\u00a0CentOS 7\u00a0system is fully up-to-date by running the following command in your terminal: yum update if there is a kernel update, make sure you&#8217;re booted into it before proceeding further. INSTALL AND CONFIGURE MARIADB DATABASE SERVER Default database server in CentOS 7 (RHEL 7) is\u00a0MariaDB\u00a0now. It is a drop in replacement for\u00a0MySQL\u00a0and can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[17,5,7],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5q9Zn-ci","jetpack-related-posts":[{"id":718,"url":"https:\/\/blog.box.kr\/?p=718","url_meta":{"origin":762,"position":0},"title":"How To Install Linux, Nginx, MySQL, PHP (LEMP) stack On CentOS 7","date":"2015-04-15","format":false,"excerpt":"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7 \u00a0 How To Install Linux, Nginx, MySQL, PHP (LEMP) stack On CentOS 7 Introduction A LEMP software 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 actually an acronym which represents\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":694,"url":"https:\/\/blog.box.kr\/?p=694","url_meta":{"origin":762,"position":1},"title":"* APM\uc124\uce58","date":"2015-04-15","format":false,"excerpt":"1. \uc124\uc815 \ubc29\ud654\ubcbd \ucf1c\uc838 80 \ud3ec\ud2b8, 3306 \ud3ec\ud2b8 vi \/etc\/sysconfig\/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT \/etc\/init.d\/iptables restart #\ub9c8\uc9c0\ub9c9\uc73c\ub85c \ub2e4\uc2dc \ubc29\ud654\ubcbd \ub54c\ubb38\uc5d0 \uc124\uc815\uc774 \uc801\uc6a9\ub429\ub2c8\ub2e4 2. \ub2eb\uae30SELINUX vi \/etc\/selinux\/config\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":673,"url":"https:\/\/blog.box.kr\/?p=673","url_meta":{"origin":762,"position":2},"title":"[Linux]Install MariaDB 10.0 on CentOS linux using YUM command","date":"2015-04-13","format":false,"excerpt":"Adding the MariaDB YUM Repository We highly recommended to use custom\u00a0MariaDB YUM\u00a0repository to install. Create a repo file under\/etc\/yum.repos.d\/MariaDB.repo, Copy and paste following line under MariaDB repository: Add repository on Centos 6.5 32-bit # vi \/etc\/yum.repos.d\/MariaDB.repo and paste following line: # MariaDB 10.0 CentOS repository list - created 2014-03-12 12:46\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"Connect to MariaDB 10.0","src":"https:\/\/i0.wp.com\/lintut.com\/wp-content\/uploads\/2014\/03\/639x352xScreenshot-from-2014-03-12-141810.png.pagespeed.ic.DHQ-h4Kmpx.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":766,"url":"https:\/\/blog.box.kr\/?p=766","url_meta":{"origin":762,"position":3},"title":"install bugzilla with nginx on centos7","date":"2015-05-11","format":false,"excerpt":"Set the Hostname Before you begin installing and configuring the components described in this guide, please make sure you\u2019ve followed our instructions for setting your hostname. Issue the following commands to make sure it is set properly: hostname hostname -f The first command should show your short hostname, and the\u2026","rel":"","context":"In &quot;Linux&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":750,"url":"https:\/\/blog.box.kr\/?p=750","url_meta":{"origin":762,"position":4},"title":"NGINX: SELinux Changes when Upgrading to RHEL 6.6 \/ CentOS 6.6","date":"2015-05-08","format":false,"excerpt":"If you upgrade a running system to Red Hat Enterprise Linux (RHEL) 6.6 or CentOS 6.6, the Security Enhanced Linux (SELinux) security permissions that apply to NGINX are\u00a0relabelled to a much stricter posture. Although the permissions are adequate for the default configuration of NGINX, configuration for additional features can be\u2026","rel":"","context":"In &quot;Linux&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":758,"url":"https:\/\/blog.box.kr\/?p=758","url_meta":{"origin":762,"position":5},"title":"NGINX : FcgiExample","date":"2015-05-08","format":false,"excerpt":"FastCGI Example First thing, I recommend keeping all your typical FCGI settings in a single file and importing them. For example you might have an \/etc\/nginx\/fastcgi.conf (or \/etc\/nginx\/fastcgi_params: installed by default on debian) file that looks like this: #fastcgi.conf fastcgi_param GATEWAY_INTERFACE CGI\/1.1; fastcgi_param SERVER_SOFTWARE nginx; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/762"}],"collection":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=762"}],"version-history":[{"count":0,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/762\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}