{"id":2202,"date":"2015-10-28T10:47:41","date_gmt":"2015-10-28T10:47:41","guid":{"rendered":"https:\/\/unihost.com\/help\/?p=2202"},"modified":"2023-01-19T13:59:27","modified_gmt":"2023-01-19T10:59:27","slug":"how-to-install-lemp-stack-on-centos-7","status":"publish","type":"post","link":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/","title":{"rendered":"LEMP stack: installation and setup on CentOS 7"},"content":{"rendered":"<h3><span style=\"font-family: Ubuntu, sans-serif;\">Introduction<\/span><\/h3>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">LEMP software stack is a group of open source software, which is typically used to host dynamic websites and web applications. LEMP is an abbreviation of the names of installed software:<\/span><\/p>\n<pre><strong>L<\/strong> - Linux, <strong>E<\/strong> - ENginx, <strong>M<\/strong> - MySQL(MariaDB), <strong>P<\/strong> - PHP.<\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">How to install LEMP stack on VPS: step by step tutorial<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Pay attention! You should be running CentOS 7.<\/span><\/p>\n<h3><span style=\"font-family: Ubuntu, sans-serif;\">Step 1 &#8211; Istall Nginx.<\/span><\/h3>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Nginx is a web-server used to display pages of the website.<\/span><br \/>\n<span style=\"font-family: Ubuntu, sans-serif;\">First you need to add the repository:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">rpm -Uvh<\/span> <span style=\"font-family: 'Ubuntu Mono', monospace;\">http:\/\/nginx.org\/packages\/centos\/7\/noarch\/RPMS\/nginx-release-centos-7-0.el7.ngx.noarch.rpm<\/span><\/pre>\n<p class=\"code-pre \"><span style=\"font-family: Ubuntu, sans-serif;\">Install Nginx, using yum command:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">yum install nginx<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Web-server Nginx will be insalled on the VPS.<\/span><br \/>\n<span style=\"font-family: Ubuntu, sans-serif;\">When the installation is complete, run the command:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">systemctl start nginx.service<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">To test Nginx open IP of your VPS in a browser.<\/span><\/p>\n<pre><span style=\"font-family: 'Ubuntu Mono', monospace;\">http:\/\/server_domain_name_or_IP\/<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">You should see a default Nginx page. It looks something like this:<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/unihost.com\/help\/minio.php?2015\/08\/nginx_default.png\" alt=\"LEMP Stack installation\" title=\"LEMP stack: installation and setup on CentOS 7 - Image 1\"><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">If you see this page, then the web server is installed and configured correct.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Add Nginx to the autorun of the operating system. To do this, run the command:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">systemctl enable nginx.service<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-family: Ubuntu, sans-serif;\">Step 2 &#8211; MySQL(MariaDB) Installation.<\/span><\/h3>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Nginx web-server is installd on your VPS now. Install MariaDB as a replacement for standard MySQL.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">acts from Wikipedia:<\/span><\/p>\n<pre>MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. Being a fork of a leading open source software system, it is notable for being led by the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle.<\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Use yum command to install MariaDB (main and additional packages):<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">yum install mariadb-server mariadb<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">When installation is over run MariaDB:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">systemctl start mariadb<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">MariaDB is now installed and running on the VPS. Next, you need to run a script to change the settings. This script will change some security settings and close the remote access to the database. To run the script use the following command:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">mysql_secure_installation<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Enter the root password for MariaDB. Taking into account that all the services were just installed, you may not have this password, so you can leave this field blank by pressing Enter.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">Enter current password for root (enter for none):\nOK, successfully used password, moving on...\n\nSetting the root password ensures that nobody can log into the MariaDB\nroot user without the proper authorisation.\n\nNew password: password\nRe-enter new password: password\nPassword updated successfully!\nReloading privilege tables..\n ... Success!<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Note! For security reasons there is no feedback of passwords given in the terminal.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Now you need to answer a number of questions concerning security. In all cases, just press Enter and leave all by default. These changes will remove some users and database created by default and will disable root access to the DB.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Add MariaDB to autorun:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">systemctl enable mariadb.service<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">MariaDB is install and setup.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-family: Ubuntu, sans-serif;\">Step 3 &#8211; Install PHP.<\/span><\/h3>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">PHP is necessary to process the code and generate dynamic content.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">To install PHP use yum. Additionally install PHP-Mysql and PHP-FPM packages:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">yum install php php-mysql php-fpm<\/span><\/pre>\n<p><strong><span style=\"font-family: Ubuntu, sans-serif;\"> PHP configuration:<\/span><\/strong><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">PHP is installed, but we have to configure it for security reasons.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Open php-fpm configuration file:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">vi \/etc\/php.ini<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Find and uncomment the parameter: cgi.fix_pathinfo and change its value to 0. In order to uncomment the line, You need to delete a character: &#8220;;&#8221; before the line:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">cgi.fix_pathinfo=0<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Save and close this file.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Edit www.conf file:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">vi \/etc\/php-fpm.d\/www.conf<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Find <strong>listen<\/strong> line and set its value:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">listen = \/var\/run\/php-fpm\/php-fpm.sock<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Save and close this file.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Add PHP-FPM to autorun:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">systemctl enable php-fpm.service<\/span><\/pre>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-family: Ubuntu, sans-serif;\">Step 4 &#8211; Setup Nginx to work with PHP.<\/span><\/h3>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">We have installed all the necessary components recently. Finally you have to setup Nginx to work with php (using PHP-FPM while processing).<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">The setup of Nginx configurational file is done at the block level. The blocks have a lot in common with the description of the virtual hosts in Apache.<\/span><br \/>\n<span style=\"font-family: Ubuntu, sans-serif;\">Open default configurational file:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">vi \/etc\/nginx\/conf.d\/default.conf<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\"> Nginx default block:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">server {\n    listen       80;\n    server_name  localhost;\n\n    location \/ {\n        root   \/usr\/share\/nginx\/html;\n        index  index.html index.htm;\n    }\n    error_page   500 502 503 504  \/50x.html;\n    location = \/50x.html {\n        root   \/usr\/share\/nginx\/html;\n    }\n}\n<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">We have to correct this code.<\/span><\/p>\n<ul>\n<li><span style=\"font-family: Ubuntu, sans-serif;\">First, we need to add &#8220;index.php&#8221; text as a first value for the <strong>&#8220;index&#8221;<\/strong> Directive. This Directive specifies the order of the index files. It means that &#8220;index.php&#8221; file shold be opened for request &#8220;http:\/\/domain.com\/&#8221;. If the file index.php is not found, the server will try to open the next file in the list, and so on.<\/span><\/li>\n<li><span style=\"font-family: Ubuntu, sans-serif;\">We also need to change the <strong>&#8220;server_name&#8221;<\/strong> Directive, put the domain name of your site or the external IP VPS there.<\/span><\/li>\n<li><span style=\"font-family: Ubuntu, sans-serif;\">The configuration file includes some commented out lines that define the error handling procedure. We uncomment these lines to enable this functionality.<\/span><\/li>\n<li><span style=\"font-family: Ubuntu, sans-serif;\">For PHP process we will need to uncomment or add some lines in another section of the file. The <strong>&#8220;location&#8221;.<\/strong> You also have to add <strong>&#8220;try_files&#8221;<\/strong> Directive to make sure Nginx doesn&#8217;t pass bad requests to our PHP processor.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">After the changes the file should look like the following:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">server {\n    listen       80;\n    server_name  <span style=\"color: #ff0000;\">server_domain_name_or_IP;<\/span>\n\n    root   \/usr\/share\/nginx\/html;\n    index <span style=\"color: #ff0000;\">index.php<\/span> index.html index.htm;\n\n    location \/ {\n        try_files $uri $uri\/ =404;\n    }\n    <span style=\"color: #ff0000;\">error_page 404 \/404.html;\n    error_page 500 502 503 504 \/50x.html;\n    location = \/50x.html {\n        root \/usr\/share\/nginx\/html;\n    }\n\n    location ~ \\.php$ {\n        try_files $uri =404;\n        fastcgi_pass unix:\/var\/run\/php-fpm\/php-fpm.sock;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }<\/span>\n}<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Save the changes and close the file.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Reboot Nginx for changes to take effect:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">systemctl restart nginx<\/span><\/pre>\n<h3><span style=\"font-family: Ubuntu, sans-serif;\">Step 5 -Test PHP processing on your web server<\/span><\/h3>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">In order to verify that our system is configured properly to process PHP, we need to create a simple script.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Let`s call it info.php. To ensure that the web server can find the file and process it, it should be located in a specific directory, called &#8220;root&#8221;.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Root folder on CentOS 7 <span style=\"font-family: 'Ubuntu Mono', monospace;\">\/usr\/share\/nginx\/html<\/span>. We may create this file in this directory:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">vi \/usr\/share\/nginx\/html\/info.php<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">This command opens an empty file. Type there PHP code:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">&lt;?php phpinfo(); ?&gt;<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Save and close he file<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Now we can check whether the web server displays the content generated by the PHP script correctly. To do this we need to open the file that we previously created.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Open the following address in the browser:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">http:\/\/<span style=\"color: #ff0000;\">your_server_IP_address<\/span>\/info.php<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">If everyhting is clear you will see:<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/unihost.com\/help\/minio.php?2015\/08\/default_php_fpm.png\" alt=\"LEMP stack installation\" title=\"LEMP stack: installation and setup on CentOS 7 - Image 2\"><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">This page displays information about your server from the perspective of PHP. This is useful for debugging and to verify that settings are applied correctly.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">If you see this page, it indicates that the server is correctly configured and PHP-FPM is working correctly.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">After testing you can delete this file, because it can provide information about your server to unauthorized users. The removal can be done as follows:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif;\">rm \/usr\/share\/nginx\/html\/info.php<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">You can create this file any time you need it<\/span><\/p>\n<h3><span style=\"font-family: Ubuntu, sans-serif;\">Conclusion<\/span><\/h3>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">LEMP stack installation is completed, you have many options for how to use it in the future. This platform allows you to install most kinds of websites and web applications on the server.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction LEMP software stack is a group of open source software, which is typically used to host dynamic websites and web applications. LEMP is an abbreviation of the names of installed software: L &#8211; Linux, E &#8211; ENginx, M &#8211; MySQL(MariaDB), P &#8211; PHP. How to install LEMP stack on VPS: step by step tutorial [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[58,142,115],"class_list":["post-2202","post","type-post","status-publish","format-standard","hentry","category-vps","tag-centos","tag-lemp","tag-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>LEMP stack: installation and setup on CentOS 7 - Unihost.FAQ<\/title>\n<meta name=\"description\" content=\"Step by step tutorial how to install and setup LEMP stack. This software is used to host dynamic websites and web applications on VPS\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LEMP stack: installation and setup on CentOS 7 - Unihost.FAQ\" \/>\n<meta property=\"og:description\" content=\"Step by step tutorial how to install and setup LEMP stack. This software is used to host dynamic websites and web applications on VPS\" \/>\n<meta property=\"og:url\" content=\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"Unihost.FAQ\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/unihost\/\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-28T10:47:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-19T10:59:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/unihost.com\/help\/wp-content\/uploads\/2015\/08\/nginx_default.png\" \/>\n<meta name=\"author\" content=\"Unihost Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@unihost\" \/>\n<meta name=\"twitter:site\" content=\"@unihost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Unihost Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/\"},\"author\":{\"name\":\"Unihost Support\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\"},\"headline\":\"LEMP stack: installation and setup on CentOS 7\",\"datePublished\":\"2015-10-28T10:47:41+00:00\",\"dateModified\":\"2023-01-19T10:59:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/\"},\"wordCount\":917,\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/unihost.com\/help\/wp-content\/uploads\/2015\/08\/nginx_default.png\",\"keywords\":[\"CentOS\",\"LEMP\",\"VPS\"],\"articleSection\":[\"Virtual Private Server (VPS)\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/\",\"url\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/\",\"name\":\"LEMP stack: installation and setup on CentOS 7 - Unihost.FAQ\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/unihost.com\/help\/wp-content\/uploads\/2015\/08\/nginx_default.png\",\"datePublished\":\"2015-10-28T10:47:41+00:00\",\"dateModified\":\"2023-01-19T10:59:27+00:00\",\"description\":\"Step by step tutorial how to install and setup LEMP stack. This software is used to host dynamic websites and web applications on VPS\",\"breadcrumb\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#primaryimage\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?2015\/08\/nginx_default.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?2015\/08\/nginx_default.png\",\"width\":569,\"height\":212},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Unihost\",\"item\":\"https:\/\/unihost.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Help\",\"item\":\"https:\/\/unihost.com\/help\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"LEMP stack: installation and setup on CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/unihost.com\/help\/#website\",\"url\":\"https:\/\/unihost.com\/help\/\",\"name\":\"Unihost.FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/unihost.com\/help\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/unihost.com\/help\/#organization\",\"name\":\"Unihost\",\"alternateName\":\"Unihost\",\"url\":\"https:\/\/unihost.com\/help\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"width\":300,\"height\":300,\"caption\":\"Unihost\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/unihost\/\",\"https:\/\/x.com\/unihost\",\"https:\/\/www.instagram.com\/unihost\/?hl=en\",\"https:\/\/www.linkedin.com\/company\/unihost-com\",\"https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\",\"name\":\"Unihost Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"caption\":\"Unihost Support\"},\"sameAs\":[\"https:\/\/unihost.com\/\"],\"url\":\"https:\/\/unihost.com\/help\/author\/support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LEMP stack: installation and setup on CentOS 7 - Unihost.FAQ","description":"Step by step tutorial how to install and setup LEMP stack. This software is used to host dynamic websites and web applications on VPS","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"LEMP stack: installation and setup on CentOS 7 - Unihost.FAQ","og_description":"Step by step tutorial how to install and setup LEMP stack. This software is used to host dynamic websites and web applications on VPS","og_url":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/","og_site_name":"Unihost.FAQ","article_publisher":"https:\/\/www.facebook.com\/unihost\/","article_published_time":"2015-10-28T10:47:41+00:00","article_modified_time":"2023-01-19T10:59:27+00:00","og_image":[{"url":"https:\/\/unihost.com\/help\/wp-content\/uploads\/2015\/08\/nginx_default.png","type":"","width":"","height":""}],"author":"Unihost Support","twitter_card":"summary_large_image","twitter_creator":"@unihost","twitter_site":"@unihost","twitter_misc":{"Written by":"Unihost Support","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#article","isPartOf":{"@id":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/"},"author":{"name":"Unihost Support","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a"},"headline":"LEMP stack: installation and setup on CentOS 7","datePublished":"2015-10-28T10:47:41+00:00","dateModified":"2023-01-19T10:59:27+00:00","mainEntityOfPage":{"@id":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/"},"wordCount":917,"publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"image":{"@id":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/unihost.com\/help\/wp-content\/uploads\/2015\/08\/nginx_default.png","keywords":["CentOS","LEMP","VPS"],"articleSection":["Virtual Private Server (VPS)"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/","url":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/","name":"LEMP stack: installation and setup on CentOS 7 - Unihost.FAQ","isPartOf":{"@id":"https:\/\/unihost.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#primaryimage"},"image":{"@id":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/unihost.com\/help\/wp-content\/uploads\/2015\/08\/nginx_default.png","datePublished":"2015-10-28T10:47:41+00:00","dateModified":"2023-01-19T10:59:27+00:00","description":"Step by step tutorial how to install and setup LEMP stack. This software is used to host dynamic websites and web applications on VPS","breadcrumb":{"@id":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#primaryimage","url":"https:\/\/unihost.com\/help\/minio.php?2015\/08\/nginx_default.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?2015\/08\/nginx_default.png","width":569,"height":212},{"@type":"BreadcrumbList","@id":"https:\/\/unihost.com\/help\/how-to-install-lemp-stack-on-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Unihost","item":"https:\/\/unihost.com\/"},{"@type":"ListItem","position":2,"name":"Help","item":"https:\/\/unihost.com\/help\/"},{"@type":"ListItem","position":3,"name":"LEMP stack: installation and setup on CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/unihost.com\/help\/#website","url":"https:\/\/unihost.com\/help\/","name":"Unihost.FAQ","description":"","publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/unihost.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/unihost.com\/help\/#organization","name":"Unihost","alternateName":"Unihost","url":"https:\/\/unihost.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","width":300,"height":300,"caption":"Unihost"},"image":{"@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/unihost\/","https:\/\/x.com\/unihost","https:\/\/www.instagram.com\/unihost\/?hl=en","https:\/\/www.linkedin.com\/company\/unihost-com","https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw"]},{"@type":"Person","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a","name":"Unihost Support","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","caption":"Unihost Support"},"sameAs":["https:\/\/unihost.com\/"],"url":"https:\/\/unihost.com\/help\/author\/support\/"}]}},"_links":{"self":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/2202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/comments?post=2202"}],"version-history":[{"count":5,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/2202\/revisions"}],"predecessor-version":[{"id":6965,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/2202\/revisions\/6965"}],"wp:attachment":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/media?parent=2202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/categories?post=2202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/tags?post=2202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}