What is Nginx Web Server? Installation of Nginx webserver on Redhat and Amazon Linux2.

  Nginx Webserver:                                   Nginx was I nitially released on 4 October 2004 by Igor Sysoev, Mainly it is open-sou...

 Nginx Webserver:
                            Nginx was Initially released on 4 October 2004 by Igor Sysoev, Mainly it is open-source software, a high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.
    Nginx webservers HTTP running on port 80 and HTTPS secure protocols running on the 443 port both are default ports.

Nginx has two types:
    1. Open-source Nginx
    2. Nginx Plus
Nginx Plus has more features than open-source Nginx.

Nginx-Plus Features:
    1. 
Load Balancer 
    2. Content Cache 
                 It Manages the cache easily with the cache‑purging API.
    3. Web Server
    4. Security Controls.
                It has JWT authentication for APIs and OpenID Connect single sign‑on (SSO).
    5. Dynamic Modules
    6. Monitoring 
                It extends the status with more than 90 unique metrics,
                Built‑in, real‑time graphical dashboard.
                JSON and HTML output for integration with custom monitoring tools.
    7. High Availability (FULL)
    8. Kubernetes Ingress Controller
    9. Programmability
                API for managing upstream servers, key‑value stores, and real‑time metrics.
                Dynamic reconfiguration without process reloads.
    10. Streaming Media

How to install the Nginx webserver?
                   We are going to install Nginx in Redhat, and Centos servers, To Install Nginx, we need to follow the below steps.
    1. We need to create the repo file as nginx.repo in the path /etc/yum.repos.d/nginx.repo
    2. If you are using centos7 we need to append the below repo content in the nginx.repo.

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=0
enabled=1

    If you are using Redhat8, we need to append the below content in the repo file.
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/rhel/8/$basearch/
gpgcheck=0
enabled=1
    3. To Install Nginx's latest version use the below command
    Command: yum install nginx
    4. Once the Nginx is Installed we need to start the Nginx service using below either one command.
    Command: service nginx start or systemctl start nginx
    5. You can check whether Nginx is up and running using either one command
    Command:  service nginx status or systemctl status nginx

Once Installation is completed, we can able to load the default Nginx web content using a web server. 

From the browser search the http://localhost or http://serverip address 

Example: For the RedHat server



The default web content will load in the browser. the content may be changed according to the OS.

For Amazon linux2 default yum install nginx will not work, we need to run the below command for the Installation.
Command: sudo amazon-linux-extras install nginx1

Nginx default page for Amazon-linux2


Note: If you are using AWS you will need to add the 80(HTTP) port in the Security group Inbound rules then only you can able to see the content in the browser.

Now all can able to see the default content loading in the browser, you can ask the simple question Is that Possible to load our own content instead of the default? Yes, it is possible. for that, we need to check the configuration file, Document root. to check the configuration we need to move on to the /etc Path.

The Nginx Default Configuration Directory is /etc/nginx.
The configuration file name is nginx.conf
Inside the Configuration file, you can able to find the Document Root as mentioned as root.
The Document Root path /usr/share/nginx/html

Now I am going to change the default HTML file to my custom content. for that go to the document root path, rename the index.html file and add the custom content to the index.html file.



My content look like below

<html>
<head>
<body>
<h1>Techiev Linux</h1>
<p>My Nginx content.</p>
</body>
</head>
</html>

Save and close the file, Now load the public IP of the ec2-instance, it will load our custom content.


Now we have successfully loaded the custom content. We can able host real-time hostnames instead of Ip addresses, but we need to use Virtualhost for that. In the Next Blog, we will see what is Virtual hosting Types of virtual hosting and How to create the Virtualhosting file in both Apache and Nginx.

-----------------------------------------!!!Happy Learning With Techiev!!!! ---------------------------------------


COMMENTS

Name

AWS,9,Devops,18,linux,10,
ltr
item
Techie View: What is Nginx Web Server? Installation of Nginx webserver on Redhat and Amazon Linux2.
What is Nginx Web Server? Installation of Nginx webserver on Redhat and Amazon Linux2.
https://blogger.googleusercontent.com/img/a/AVvXsEgkTwyz6VhwYcPXneEBfyxCBPmfO--SQhp9kYnrQ8CWJJE9QJqhSTyiNv9aWmBh7BmbDwpFO-gWrafIw1lugW3yVMEHX1Qeq2HKrzKn8mhEdM4hqeU3TCZoknSu6rJfbaqxIrKON2WpfT3XPWIfIUROOM6GHlNiXVF9Ibf3gNZ1olWWwWnOyml5PMBvXw=w400-h103
https://blogger.googleusercontent.com/img/a/AVvXsEgkTwyz6VhwYcPXneEBfyxCBPmfO--SQhp9kYnrQ8CWJJE9QJqhSTyiNv9aWmBh7BmbDwpFO-gWrafIw1lugW3yVMEHX1Qeq2HKrzKn8mhEdM4hqeU3TCZoknSu6rJfbaqxIrKON2WpfT3XPWIfIUROOM6GHlNiXVF9Ibf3gNZ1olWWwWnOyml5PMBvXw=s72-w400-c-h103
Techie View
https://www.techiev.com/2021/12/what-is-nginx-web-server-installation.html
https://www.techiev.com/
https://www.techiev.com/
https://www.techiev.com/2021/12/what-is-nginx-web-server-installation.html
true
7013663511659419322
UTF-8
Loaded All Posts Not found any posts VIEW ALL View Full Article Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy