Web Servers
Web Servers
Mr. RAM
WEB SERVERS:
A web server is a network service that serves content (web pages) to a
client over the web.
Web servers are also known as HTTP (Hypertext Transport Protocol)
servers.
The Popular web servers are: Apache HTTP and NGINX Server.
A dynamic web server consists of a static web server plus extra software,
most commonly an application server and a database.
We call it "dynamic" because the application server updates the hosted files
before sending content to your browser via the HTTP server.
Package : httpd
Document root location : /var/www/html
Configuration Files : /etc/httpd/conf/httpd.conf
/etc/httpd/conf.d/ssl.conf
Auxiliary Directory : /etc/httpd/conf.d/
Default web page : /etc/httpd/conf.d/welcome.conf
Modules Location : /usr/lib64/httpd/modules
Log Files Location : /var/log/httpd/
Log Files : access_log, error_log
Service / Daemon : httpd
Ports : http-80
https/ssl-443
NOTE:
If the /var/www/html/ directory is empty or does not contain an index.html
or index.htm file, Apache displays the Red Hat Enterprise Linux Test Page.
If /var/www/html/ contains HTML files with a different name, you can load
them by entering the URL to that file, such as
http://server_IP_/_host_name/example.html
NGINX SERVER:
NGINX is open-source software for web serving, reverse proxying,
caching, load balancing, media streaming, and more.
It is faster than Apache webserver!
NGINX is a high performance, high Concurrency and Low Resource Usage
NGINX is a high performance and modular server that you can use, as a:
Web server
Reverse proxy
Load balancer
NOTE: By default, NGINX act as a Web Server.
ROUND ROBIN:
Requests are distributed across the group of servers sequentially.
LEAST CONNECTIONS:
A new request is sent to the server with the fewest current connections to
clients. The relative computing capacity of each server is factored into
determining which one has the least connections.
LEAST TIME:
Sends requests to the server selected by a formula that combines the fastest
response time and fewest active connections. Exclusive to NGINX Plus.
HASH:
Distributes requests based on a key you define, such as the client IP address
or the request URL. NGINX Plus can optionally apply a consistent hash to
minimize redistribution of loads if the set of upstream servers’ changes.
IP HASH:
The IP address of the client is used to determine which server receives the
request.
RANDOM WITH TWO CHOICES:
Picks two servers at random and sends the request to the one that is selected
by then applying the Least Connections algorithm (or for NGINX Plus the
Least Time algorithm, if so configured).