HOW TO INSTALL NGINX HTTP SERVER IN CENTOS/RHEL 8
HOW TO INSTALL AND CONFIGURE NGINX HTTP SERVER IN CENTOS/RHEL 8 WITH SCREENSHOT

HOW TO INSTALL NGINX HTTP SERVER IN CENTOS/RHEL 8

In this Tutorials We Learn About INSTALL AND CONFIGURE NGINX HTTP SERVER IN CENTOS 8 WITH SCREENSHOT.

Nginx is a fast and lightweight HTTP web server Nginx, pronounced “engine x” is a web server that’s gained incredible popularity among the most highly visited websites on the internet. It isn’t fair to think of Nginx as just a web server. It can do so much more— it can serve HTTP and HTTPS traffic, proxy to Rails, PHP or Node applications, run as a software load balancer, Http cache, off-load SSL or even act as an SMTP, POP3, and IMAP mail server

Install Nginx in CentOS 8 .
Install Nginx Package
CONFIGURATION OF NGINX .

open Nginx configuration with the help of any text editor and go to Near Line number 41 and put your host name.

[root@centos8 ~]# vim /etc/nginx/nginx.conf . . { go to Near Line Number 41} server_name www.simitech.in {Change Your Server Name }

Change your Server Name

Configure Of Nginx Server In Centos 8
Start And Check Nginx http Web Server Service Status .
Start, Enable And Check Service In Nginx Http Web Server
if firewall service is running , allow HTTP service.
firewall service is running , allow HTTP service

To check the Default page of Nginx http web server you can check it from Client Machine web Browser .

Default page of Nginx http web server
VIRTUAL HOSTING IN NGINX:

we Learn About Virtual Hosting in Nginx web server add addition hosting in same domain name

Configure Viretual Hosting :

first Create a file virtual.host.conf file under vim /etc/nginx/conf.d/ and write Bellow content .

 Create virtual.host.conf  file In Nginx  HTTP Web Server

Create Directory simitech.host under /usr/share/nginx/ and Restart Nginx Services

Create Test page index.html under /usr/share/nginx/simitech.host/ and check it from Client Web Browser.

Nginx Test Index Page

now nginx virtual host test page is working .

 nginx virtual host test page Output Through Browser
Configure Nginx to use php Scripts

first Install php 7.x for Nginx

[root@centos ~] # dnf module install php:7.2 -y

Install Php 7.2 In Inginx Http Web Server

To Check PHP Install Version:

check PHP Version

After Installing PHP, restart Nginx services and Create one PHPInfo file under /usr/share/nginx/html/info.php

[root@centos8 ~]# systemctl restart nginx root@centos8 ~] # echo ‘<?php phpinfo(); ?>’ > /usr/share/nginx/html/info.php

Restart nginx services and Access phpinfo.php page from client web Browser .

Check PHP Installed Modules

php configuration done ,now you can use php script

In this Tutorials We Lean About How To Install and Configure Nginx Http Web Server And Php7.2 in Centos 8