{"id":7825,"date":"2019-01-11T18:09:14","date_gmt":"2019-01-11T18:09:14","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=7825"},"modified":"2019-01-12T08:50:15","modified_gmt":"2019-01-12T08:50:15","slug":"install-nginx-on-centos-linux-hint","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/11\/install-nginx-on-centos-linux-hint\/","title":{"rendered":"Install NGINX on CentOS \u2013 Linux Hint"},"content":{"rendered":"<p>In the case of any web server, the performance is something that you need to keep in mind. In fact, performance is the main factor that decides the success of running a server. The faster the server, the better performance you get out of your current hardware config.<\/p>\n<p>There are a number of available server apps out there. The most popular ones include Apache and NGINX. Both of them are free and open-source. Of course, in terms of popularity, Apache is a quite popular choice even in the world. In fact, more than 65% of all the servers in the current cyber world is powered by Apache!<\/p>\n<p>However, that doesn\u2019t diminish the benefits of NGINX (engine-ex \u2013 that\u2019s how it\u2019s pronounced). There are tons of additional benefits that NGINX provide that Apache fails to serve.<\/p>\n<p>The first and foremost reason is the performance. NGINX, being a lightweight alternative to Apache, offers better overall performance than Apache. NGINX is also well-suited with the Linux and other UNIX-like environment. However, NGINX falls short in terms of flexibility. You need to compile additional modules into the NGINX binary in most cases as not all the modules of NGINX support dynamic module loading.<\/p>\n<p>As both of them are free, you can easily start your own server right now! In today\u2019s tutorial, we\u2019ll be checking out NGINX running on my test CentOS system.<\/p>\n<p>NGINX is available on the EPEL repository. Let\u2019s start the installation!<\/p>\n<p>At first, make sure that your system has EPEL repository enabled \u2013<\/p>\n<p>sudo yum install epel-release<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/1-22.png\" alt=\"\" width=\"875\" height=\"622\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/2-21.png\" alt=\"\" width=\"877\" height=\"622\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/3-21.png\" alt=\"\" width=\"893\" height=\"259\" \/><\/p>\n<p>Now, time to perform the installation!!!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/4-22.png\" alt=\"\" width=\"877\" height=\"623\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/5-22.png\" alt=\"\" width=\"889\" height=\"628\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/6-20.png\" alt=\"\" width=\"870\" height=\"617\" \/><\/p>\n<h2>Starting NGINX<\/h2>\n<p>The installation is complete, time to fire it up! It\u2019s not going to start itself all by itself!<\/p>\n<p>sudo systemctl start nginx<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/7-21.png\" alt=\"\" width=\"879\" height=\"116\" \/><\/p>\n<p>If your system is configured to use a firewall, enable HTTP and HTTPS traffic from\/to the server \u2013<\/p>\n<p>sudo firewall-cmd &#8211;permanent &#8211;zone=public &#8211;add-service=http<br \/>\nsudo firewall-cmd &#8211;permanent &#8211;zone=public &#8211;add-service=https<br \/>\nsudo firewall-cmd &#8211;reload<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/8-18.png\" alt=\"\" width=\"867\" height=\"173\" \/><\/p>\n<p>Time to test the server working \u2013<\/p>\n<p>http:\/\/&lt;server_domain_IP&gt;<\/p>\n<p>Don\u2019t have the IP address of the server? Then you can find out by running the following command \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/9-16.png\" alt=\"\" width=\"878\" height=\"312\" \/><\/p>\n<p>In my case, I need the \u201cenp0s3\u201d connection. Now, find out the IP address by running the following command \u2013<\/p>\n<p>ip addr show enp0s3 | grep inet | awk &#8216;{ print $2; }&#8217; | sed &#8216;s\/\/.*$\/\/&#8217;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/10-13.png\" alt=\"\" width=\"887\" height=\"149\" \/><\/p>\n<p>You may also want to enable NGINX every time your system boots up \u2013<\/p>\n<p>sudo systemctl enable nginx<\/p>\n<h3>Additional configurations<\/h3>\n<p>The default configuration isn\u2019t always the best one as it depends on the particular usage case. Fortunately, NGINX comes up with a handy set of configuration files.<\/p>\n<ul>\n<li>NGINX global configuration file<\/li>\n<\/ul>\n<ul>\n<li>Default server root<\/li>\n<\/ul>\n<ul>\n<li>Server block configuration<\/li>\n<\/ul>\n<p>Enjoy!<\/p>\n<p><a href=\"https:\/\/linuxhint.com\/install_nginx_centos\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the case of any web server, the performance is something that you need to keep in mind. In fact, performance is the main factor that decides the success of running a server. The faster the server, the better performance you get out of your current hardware config. There are a number of available server &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/11\/install-nginx-on-centos-linux-hint\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install NGINX on CentOS \u2013 Linux Hint&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7825","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=7825"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7825\/revisions"}],"predecessor-version":[{"id":7938,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7825\/revisions\/7938"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=7825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=7825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=7825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}