際際滷

際際滷Share a Scribd company logo
WEB SERVERS
A web server is specialised software that
responds to client (I.e. web browser) requests
Every web site requires a web server to process
client requests and serve up the pages
Web servers used to service Internet, intranets
and extranets
A web server is part of a multi-tier application (also called
n-tier application Functionality is divided into separate
tiers or groupings
Tiers can be on same computer or on separate computers
Web applications are often three tiered:
 Information tier (also called data tier)
 Middle tier
 Client tier (user interface tier)
Hyper Text Transfer Protocol
Web servers communicate with clients using a Response-Request protocol: HTTP
 A request is generated by a client (by browser
software)
- Most common requests are Get and Post
 Request reaches the appropriate web-server
 Request is processed by the web-server
 A response is formulated by the web server
and sent back to the client (e.g. web page
contents)
Client-Server model and HTTP
 HTTP is the de facto standard for transferring
World Wide Web documents
 Usually to port 80
 HTTP messages (requests and responses)
between client and server are human
readable
Http: Requests from client
 Request
 Get resource
 Type of browser
 Name of host
 etc
 First line is request-line. Contains the nature of the
Request e.g.
 GET: Get a file from the server
 POST: Post data to the server
 PUT: Store some resource
HTTP Response Status Codes
 1XX: Provide information to the client
 2XX: Correct response has occurred.
 3XX: Browser must carry out some further action in order for the
request to be successful. For example, the code 301 indicates that
the resource that was requested has been permanently moved to
another location.
 4XX: Something has gone wrong; for example, the most frequent
status code that is returned is 404 which indicates that the
resource that has been requested cannot be found.
 5XX: Server has experienced a problem. For example, the status
code 503 indicates that the service requested has not been able to
be carried out.
Accessing web servers
web server functionality
But usually includes many other functions such as:
 File Transfer Protocol (FTP) server
 Simple Mail Transfer Protocol (SMTP) server (for
Email)
 Web development and publishing functionality
 Support for specific server side technologies
e.g. JSP, SSIs
 Security features
 And more
Selecting a web server
Performance
e.g. how many client requests per second can
be processed? Load balancing?
Reliability
How robust is the web server?
How liable to crash? How easily recovered?
Ease of Use
How easy to set up, administer, learn?
Support
What support is provided by the vendor?
Price
How must does it cost to buy and maintain?
Security
What security functionality is offered? e.g. SSL?
Functionality
 server side techologies supported? (as add-ons?  e.g. TomCat for Apache) e.g.
ASP? JSP? CGI? etc
 Logging
 Proxy server
Operating system
What operating system(s) does the web server support?
丐亳仗 HTTP 亠于亠仂于
 弌舒亳亠从亳亶 于亠弍-亠于亠, 亳仍亳 亠从, 仗仂仍舒亠
舒亰仄亠亠仆仆亠 仆舒 仆亠仄 舒亶仍 于 弍舒亰亠 从舒从
亠. (nginx, Apache)
 亳仆舒仄亳亠从亳 于亠弍-亠于亠 仂仂亳 亳亰
舒亳亠从仂亞仂 于亠弍-亠于亠舒 仗仍ム
亟仂仗仂仍仆亳亠仍仆仂亞仂 仗仂亞舒仄仄仆仂亞仂 仂弍亠仗亠亠仆亳,
仆舒亳弍仂仍亠亠 舒仂 亠于亠仂仄 仗亳仍仂亢亠仆亳亶
亳 弍舒亰 亟舒仆仆. (Gunicorn, Waitress, Tornado)
 弌舒亳亠从亳亠 亠弍-舒亶 仗仂亠 于亠亞仂
舒仆仂于亳.  仆亳仄 仂仆仂 HTML 舒仆亳,
从舒亳仆从亳, 亳, CSS 亳仍亳 亳 仗仂亠亠
 亳仆舒仄亳亠从亳亶 亠弍-舒亶 仂亰仆舒舒亠, 仂 亠于亠
仂弍舒弍舒于舒亠 亟舒仆仆亠 亳仍亳 亟舒亢亠 亞亠仆亠亳亠 亳
仆舒 仍亠 亳亰 弍舒亰 亟舒仆仆. 亅仂 仂弍亠仗亠亳于舒亠
弍仂仍亠 亞亳弍从仂亳, 仆仂 亠仆亳亠从亳 仍仂亢仆亠亠 于
仂弍仍亢亳于舒仆亳亳, 仂 亟亠仍舒亠 亠亞仂 弍仂仍亠亠 仍仂亢仆仄
于 舒亰舒弍仂从亠.
弌于磶 亠弍-仗亳仍仂亢亠仆亳  HTTP-
亠于亠仂仄
 CGI
 FastCGI
 仂亠仆仆亶 亠于亠
 WSGI
CGI
CGI  仂 仆亠 磶从 仗仂亞舒仄仄亳仂于舒仆亳!
亅仂 仗仂仂亶 仗仂仂从仂仍, 仗仂亰于仂仍ム亳亶 亠弍-
亠于亠 仗亠亠亟舒于舒 亟舒仆仆亠 亠亠亰 stdin 亳
亳舒 亳 亳亰 stdout.
仂仂仄, 于 从舒亠于亠 CGI-仂弍舒弍仂亳从舒 仄仂亢亠
亳仗仂仍亰仂于舒 仗仂亞舒仄仄舒 仆舒 仍ミ頴笑 磶从亠,
仗仂仂弍仆仂仄 舒弍仂舒 仂 舒仆亟舒仆仄亳
仗仂仂从舒仄亳 于于仂亟舒-于于仂亟舒.
CGI. 亠亠仄亠仆仆亠 仂从亢亠仆亳
CGI. 亠亳仄亠于舒
 仂亠 CGI 从亳仗舒 仆亠 亰舒于亳亳 仂 亠弍-
亠于亠舒 亳 于 仍舒亠 仗舒亟亠仆亳 仆亳 从舒从 仆亠
仂舒亰亳 仆舒 舒弍仂亠 仗仂仍亠亟仆亠亞仂.
 仂亢亠 弍 仆舒仗亳舒仆 仆舒 仍ミ頴笑 磶从亠
仗仂亞舒仄仄亳仂于舒仆亳.
 仂亟亟亠亢亳于舒亠 弍仂仍亳仆于仂仄 亠弍-
亠于亠仂于.
CGI. 亠亟仂舒从亳
 仂亠弍仍亠仆亳亠 亠仂于
亠仍仂 于 仂仄, 仂 从舒亢亟仂亠 仂弍舒亠仆亳亠 从 CGI-
仗亳仍仂亢亠仆亳 于亰于舒亠 仗仂仂亢亟亠仆亳亠 仆仂于仂亞仂
仗仂亠舒, 仂 于亠仄亳 于亠从舒ム亳仄亳 仂ミ莞
仆舒从仍舒亟仆仄亳 舒仂亟舒仄亳.
FastCGI
FastCGI
  仂仍亳亳亠 仂 CGI, FastCGI 亳仗仂仍亰亠
仗仂仂礌仆仂 亰舒仗亠仆仆亠 仗仂亠 亟仍
仂弍舒弍仂从亳 仄仆仂亢亠于舒 亰舒仗仂仂于.
 FastCGI-仗仂亠 亳仗仂仍亰ム 亟仍 于磶亳 
亠于亠仂仄 Unix Domain Sockets 亳仍亳 TCP/IP.
仂亠仆仆亶 亠于亠
 仆亠从仂仂 磶从舒, 仆舒仗亳仄亠 Go, 亢亠
亠于亠 于仂亠仆仆亶 亠弍-亠于亠.
WEB SERVERS(IIS, APACHE,
NGINX)
 1) Client sends request to server.
 2) Server accepts the request and then
process it.
 3) Server sends back the request to client.
HISTORY
 1989
 CERN httpd
 Sir Tim Berners-Lee
TYPES OF WEB SERVERS
 Dedicated Server:
- physical server
- purchased or rented for your own business
needs
- For large businesses
- high levels of data security
- running 24*7*365
 Cloud Server:
- virtual server
- less costs
- for small and mid-sized businesses
HANDLE REQUESTS
1. append the given path to the path of root directory
 Root directory in configs
 Https://arastu.ir/a/b/c.pdf
/home/arastu/www/arastu.ir/a/b/c.pdf
2. Create Response
 Based on configs
 Create response dynamically with server side
programming languages
 Return static file
 Error
WEB SERVERS
 IIS
 Apache
 Nginx
IIS
Components:
 HTTP .sys
 Worker processes (w3wp.exe)
 ISAPI
 InetInfo.exe
 Application pools
 IIS ( Internet Information Services, 亟仂 于亠亳亳 5.1 
Internet Information Server )  仗仂仗亳亠舒仆亶
仆舒弍仂 亠于亠仂于 亟仍 仆亠从仂仍从亳 仍亢弍 仆亠仆亠舒 仂
从仂仄仗舒仆亳亳 舒亶从仂仂.
 IIS 舒仗仂舒仆磳  仂仗亠舒亳仂仆仆仄亳 亳亠仄舒仄亳
亠仄亠亶于舒 Windows NT. 仆仂于仆仄 从仂仄仗仂仆亠仆仂仄 IIS
磦仍磳 于亠弍-亠于亠, 从仂仂亶 仗仂亰于仂仍磳 舒亰仄亠舒
于 仆亠仆亠亠 舒亶. IIS 仗仂亟亟亠亢亳于舒亠 仗仂仂从仂仍
HTTP, HTTPS, FTP, POP3, SMTP, NNTP.
弌仍亢弍舒 WWW 于 仂舒于亠 IIS
 仆仂于仆仄 从仂仄仗仂仆亠仆仂仄 IIS 磦仍磳 于亠弍-亠于亠 
仍亢弍舒 WWW (仆舒亰于舒亠仄舒 舒从亢亠 W3SVC), 从仂仂舒
仗亠亟仂舒于仍磳 从仍亳亠仆舒仄 亟仂仗 从 舒亶舒仄 仗仂 仗仂仂从仂仍舒仄
HTTP 亳, 亠仍亳 仗仂亳亰于亠亟亠仆舒 仆舒仂亶从舒, HTTPS.
 亟亳仆 亠于亠 IIS 仄仂亢亠 仂弍仍亢亳于舒 仆亠从仂仍从仂 舒亶仂于
(IIS 6.0 亳 于亠). 舒亢亟亶 舒亶 亳仄亠亠 仍亠亟ム亳亠
舒亳弍:
 IP-舒亟亠 舒亶舒;
 TCP-仗仂, 仆舒 从仂仂仂仄 仍亢弍舒 WWW 仂亢亳亟舒亠
仗仂亟从仍ム亠仆亳亶 从 亟舒仆仆仂仄 舒亶;
 舒亞仂仍仂于仂从 亰仍舒 (Host header name)  亰仆舒亠仆亳亠
亰舒亞仂仍仂于从舒 Host 亰舒仗仂舒 HTTP, 从舒亰于舒ム亠亠 仂弍仆仂 DNS-
亳仄 舒亶舒.
亳亠从舒 仍亢弍 WWW
  IIS 6.0, 亟仂仗仆仂仄 于 仂舒于亠 亳亠仄
Windows Server 2003, 仍亢弍舒 WWW
仗亠亠仗亠仍舒 亠亰仆亠 亳亰仄亠仆亠仆亳. 仍
亟仂弍舒于仍亠仆 仆仂于亶 亠亢亳仄 仂弍舒弍仂从亳
亰舒仗仂仂于, 仆舒亰于舒亠仄亶 亠亢亳仄仂仄 亳亰仂仍亳亳
舒弍仂亳 仗仂亠仂于 (舒仆亞仍. worker process
isolation mode).
亠亰仂仗舒仆仂 于 仍亢弍亠 WWW
 亠弍-亠于亠 IIS 仗亠亟仂舒于仍磳 仆亠从仂仍从仂
仗仂仂弍仂于 舒亰亞舒仆亳亠仆亳 亟仂仗舒 从 舒亶舒仄 亳
于亠弍-仗亳仍仂亢亠仆亳礆. 弌仍亢弍舒 WWW 于 仂舒于亠
IIS 仂仍亳舒亠 仂 亟亞亳 于亠弍-亠于亠仂于 亠仄,
仂 仆从亳亳 仂弍亠仗亠亠仆亳 弍亠亰仂仗舒仆仂亳 于
仆亠亶 亠仆仂 亳仆亠亞亳仂于舒仆  亳亠仄仂亶
Windows NT, 仆舒 仂仆仂于亠 从仂仂仂亶 仂仆舒
舒弍仂舒亠.
弌仍亢弍舒 WWW 仗仂亟亟亠亢亳于舒亠 亳
仂仆仂于仆 仄亠仂亟舒 舒亠仆亳亳从舒亳亳
 舒亰仂于舒 舒亠仆亳亳从舒亳 (basic authentication) 
亳仄 亳 仗舒仂仍 仗亠亠亟舒ム 仗仂 亠亳 仂从仄
亠从仂仄.
 弌亢舒舒 舒亠仆亳亳从舒亳 (digest authentication) 
仗舒仂仍 仂弍舒弍舒于舒亠 亠-仆从亳亠亶 仗亠亠亟
仂仗舒于从仂亶 仗仂 亠亳, 仂 亟亠仍舒亠 仆亠于仂亰仄仂亢仆仄 亠亞仂
仗仂亠仆亳亠 于 仍舒亠 仗亠亠于舒舒 亰仍仂仄仍亠仆仆亳从仂仄.
 仂亠仆仆舒 舒亠仆亳亳从舒亳 Windows (integrated
Windows authentication)  于仗仂仍仆磳 仗仂仗从舒
于仂亟舒 仆舒 亠于亠  亠仄亳 亢亠 仆仄亳 亟舒仆仆仄亳, 仗仂亟
从仂仂仄亳 舒弍仂舒亠 弍舒亰亠 仗仂仍亰仂于舒亠仍.
亠舒仍亳亰舒亳 于亠弍-仗亳仍仂亢亠仆亳亶 亟仍 IIS
 亠弍-亠于亠 IIS 仗仂亟亟亠亢亳于舒亠 仆亠从仂仍从仂 舒亰仍亳仆 亠仆仂仍仂亞亳亶
仂亰亟舒仆亳 于亠弍-仗亳仍仂亢亠仆亳亶:
 ASP.NET  舒亰舒弍仂舒仆仆舒 Microsoft 亠仆仂仍仂亞亳;
 ASP  仗亠亟亠于仂于舒于舒 ASP.NET 亠仆仂仍仂亞亳 仂亰亟舒仆亳
亟亳仆舒仄亳亠从亳 于亠弍-舒仆亳 仆舒 仂仆仂于亠 亠仆舒亳亠于. 仂亟亳 于
仗仂舒于从 IIS 仆舒亳仆舒  于亠亳亳 3.0.
 CGI  舒仆亟舒仆舒 仄亠亢仗仍舒仂仄亠仆仆舒 仆亳亰从仂仂于仆亠于舒
亠仆仂仍仂亞亳 仂亰亟舒仆亳 亟亳仆舒仄亳亠从亳 于亠弍-舒仆亳.
 FastCGI  从仍亳亠仆-亠于亠仆亶 仗仂仂从仂仍 于亰舒亳仄仂亟亠亶于亳 于亠弍-
亠于亠舒 亳 仗亳仍仂亢亠仆亳.
 ISAPI  仆亳亰从仂仂于仆亠于舒 亠仆仂仍仂亞亳, 舒仆舒仍仂亞亳仆舒 亳仆亠亠亶
仄仂亟仍亠亶 Apache, 仗亠亟仂舒于仍ム舒 仗仂仍仆亶 亟仂仗 从仂 于亠仄
于仂亰仄仂亢仆仂礆 IIS,
 SSI  于从仍ム亠仆亳亠 于 仂亟仆亳 舒仆亳 亠从舒 亳亰 亟亞亳 舒仆亳.
apache
 Apache HTTP-亠于亠 ( 仂从舒亠仆亳亠 仂 舒仆亞仍. a
patchy server )  于仂弍仂亟仆亶 于亠弍-亠于亠.
 Apache 磦仍磳 从仂仗仍舒仂仄亠仆仆仄 ,
仗仂亟亟亠亢亳于舒亠 仂仗亠舒亳仂仆仆亠 亳亠仄 Linux, BSD,
Mac OS, Microsoft Windows, Novell NetWare, BeOS.
 仆仂于仆仄亳 亟仂仂亳仆于舒仄亳 Apache 亳舒ム
仆舒亟亢仆仂 亳 亞亳弍从仂 从仂仆亳亞舒亳亳. 仆 仗仂亰于仂仍磳
仗仂亟从仍ム舒 于仆亠仆亳亠 仄仂亟仍亳 亟仍 仗亠亟仂舒于仍亠仆亳
亟舒仆仆, 亳仗仂仍亰仂于舒 弌丕 亟仍 舒亠仆亳亳从舒亳亳
仗仂仍亰仂于舒亠仍亠亶, 仄仂亟亳亳亳仂于舒 仂仂弍亠仆亳 仂弍
仂亳弍从舒 亳 . 亟. 仂亟亟亠亢亳于舒亠 IPv6.
亳亠从舒 Apache
 亊亟仂 Apache 于从仍ム舒亠 于 亠弍 仂仆仂于仆亠 仆从亳仂仆舒仍仆亠
于仂亰仄仂亢仆仂亳, 舒从亳亠 从舒从 仂弍舒弍仂从舒 从仂仆亳亞舒亳仂仆仆
舒亶仍仂于, 仗仂仂从仂仍 HTTP 亳 亳亠仄舒 亰舒亞亰从亳 仄仂亟仍亠亶.
亊亟仂 (于 仂仍亳亳亠 仂 仄仂亟仍亠亶) 仗仂仍仆仂
舒亰舒弍舒于舒亠 Apache Software Foundation, 弍亠亰
舒亳 仂仂仆仆亳 仗仂亞舒仄仄亳仂于.
 丐亠仂亠亳亠从亳, 磲仂 apache 仄仂亢亠 仆从亳仂仆亳仂于舒 于
亳仂仄 于亳亟亠, 弍亠亰 亳仗仂仍亰仂于舒仆亳 仄仂亟仍亠亶. 亟仆舒从仂,
仆从亳仂仆舒仍仆仂 舒从仂亞仂 亠亠仆亳 从舒亶仆亠 仂亞舒仆亳亠仆舒.
 亊亟仂 Apache 仗仂仍仆仂 仆舒仗亳舒仆仂 仆舒 磶从亠
仗仂亞舒仄仄亳仂于舒仆亳 C.
 亠舒仆亳亰仄 于亳舒仍仆 仂仂于. Apache 亳仄亠亠
于仂亠仆仆亶 仄亠舒仆亳亰仄 于亳舒仍仆 仂仂于. 仆
仗仂亰于仂仍磳 仗仂仍仆仂亠仆仆仂 仂弍仍亢亳于舒 仆舒 仂亟仆仂仄 IP-
舒亟亠亠 仄仆仂亢亠于仂 舒亶仂于 (亟仂仄亠仆仆 亳仄仆),
仂仂弍舒亢舒 亟仍 从舒亢亟仂亞仂 亳亰 仆亳 仂弍于亠仆仆仂亠
仂亟亠亢亳仄仂亠.
 仍 从舒亢亟仂亞仂 于亳舒仍仆仂亞仂 仂舒 仄仂亢仆仂 从舒亰舒
仂弍于亠仆仆亠 仆舒仂亶从亳 磲舒 亳 仄仂亟仍亠亶, 仂亞舒仆亳亳
亟仂仗 从仂 于亠仄 舒亶 亳仍亳 仂亟亠仍仆仄 舒亶仍舒仄.
亠从仂仂亠 MPM, 仆舒仗亳仄亠 Apache-ITK 仗仂亰于仂仍ム
亰舒仗从舒 仗仂亠 httpd 亟仍 从舒亢亟仂亞仂 于亳舒仍仆仂亞仂
仂舒  仂亟亠仍仆仄亳 亳亟亠仆亳亳从舒仂舒仄亳 uid 亳 guid.
仆亠亞舒亳  亟亞亳仄  亳 磶从舒仄亳
仗仂亞舒仄仄亳仂于舒仆亳
 弌亠于亠 仄仆仂亢亠于仂 仄仂亟仍亠亶, 亟仂弍舒于仍ム亳
从 Apache 仗仂亟亟亠亢从 舒亰仍亳仆 磶从仂于
仗仂亞舒仄仄亳仂于舒仆亳 亳 亳亠仄 舒亰舒弍仂从亳.
 PHP (mod_php).
 Python (mod python, mod wsgi).
 Ruby (apache-ruby).
 Perl (mod perl).
 ASP (apache-asp).
 Tcl (rivet)
亠亰仂仗舒仆仂
 亞舒仆亳亠仆亳亠 亟仂仗舒 从 仂仗亠亟亠仍仆仆仄 亟亳亠从仂亳礆 亳仍亳
舒亶仍舒仄.
 亠舒仆亳亰仄 舒于仂亳亰舒亳亳 仗仂仍亰仂于舒亠仍亠亶 亟仍 亟仂仗舒 从
亟亳亠从仂亳亳 仗仂 仄亠仂亟 HTTP-于仂亳亰舒亳亳 (mod_auth_basic) 亳
digest-舒于仂亳亰舒亳亳 (mod_auth_digest).
 亞舒仆亳亠仆亳亠 亟仂仗舒 从 仂仗亠亟亠仍仆仆仄 亟亳亠从仂亳礆 亳仍亳 于亠仄
亠于亠, 仂仆仂于舒仆仆仂亠 仆舒 IP-舒亟亠舒 仗仂仍亰仂于舒亠仍亠亶.
 舒仗亠 亟仂仗舒 从 仂仗亠亟亠仍仆仆仄 亳仗舒仄 舒亶仍仂于 亟仍 于亠 亳仍亳
舒亳 仗仂仍亰仂于舒亠仍亠亶, 仆舒仗亳仄亠 亰舒仗亠 亟仂仗舒 从
从仂仆亳亞舒亳仂仆仆仄 舒亶仍舒仄 亳 舒亶仍舒仄 弍舒亰 亟舒仆仆.
 弌亠于ム 仄仂亟仍亳, 亠舒仍亳亰ム亳亠 舒于仂亳亰舒亳 亠亠亰 弌丕
亳仍亳 PAM.
NGINX
 nginx ( 舒仆亞仍. engine x ) ( 仗仂-从亳
仗仂亳亰仆仂亳 从舒从 仆亟亢亳仆-从 )  于亠弍-
亠于亠 亳 仗仂仂于亶 仗仂从亳-亠于亠,
舒弍仂舒ム亳亶 仆舒 Unix-仗仂亟仂弍仆
仂仗亠舒亳仂仆仆 亳亠仄舒 (亠亳仂于舒仍舒
弍仂从舒 亳 舒弍仂舒 仆舒 FreeBSD, OpenBSD, Linux,
Solaris, Mac OS X, AIX). 舒亳仆舒  于亠亳亳
0.7.52 仗仂磦亳仍舒 弍亳仆舒仆舒 弍仂从舒 仗仂亟
Microsoft Windows.
仆仂于仆亠 仆从亳亳 HTTP-亠于亠
NGINX
 仂弍仍亢亳于舒仆亳亠 舒亳亠从亳 亰舒仗仂仂于, 亳仆亟亠从仆 舒亶仍仂于,
舒于仂仄舒亳亠从仂亠 仂亰亟舒仆亳亠 仗亳从舒 舒亶仍仂于, 从亠 亟亠从亳仗仂仂于 仂从
舒亶仍仂于
 舒从亠仍亠亳仂于舒仆仆仂亠 仗仂从亳仂于舒仆亳亠 弍亠亰 从亳仂于舒仆亳, 仗仂仂亠
舒仗亠亟亠仍亠仆亳亠 仆舒亞亰从亳 亳 仂从舒亰仂仂亶亳于仂
 仗仂亟亟亠亢从舒 从亠亳仂于舒仆亳 仗亳 舒从亠仍亠亳仂于舒仆仆仂仄 仗仂从亳仂于舒仆亳亳 亳
FastCGI
 舒从亠仍亠亳仂于舒仆仆舒 仗仂亟亟亠亢从舒 FastCGI 亳 memcached 亠于亠仂于, 仗仂仂亠
舒仗亠亟亠仍亠仆亳亠 仆舒亞亰从亳 亳 仂从舒亰仂仂亶亳于仂
 仄仂亟仍仆仂, 亳仍, 于 仂仄 亳仍亠 亢舒亳亠 (gzip), byte-ranges
(亟仂从舒从舒), chunked 仂于亠, HTTP-舒亠仆亳亳从舒亳, SSI-亳仍
 仆亠从仂仍从仂 仗仂亟亰舒仗仂仂于 仆舒 仂亟仆仂亶 舒仆亳亠, 仂弍舒弍舒于舒亠仄亠 于 SSI-
亳仍亠 亠亠亰 仗仂从亳 亳仍亳 FastCGI, 于仗仂仍仆ム 仗舒舒仍仍亠仍仆仂
 仗仂亟亟亠亢从舒 SSL
 从仗亠亳仄亠仆舒仍仆舒 仗仂亟亟亠亢从舒 于仂亠仆仆仂亞仂 Perl
亳亠从舒
  nginx 舒弍仂亳亠 仗仂亠 仂弍仍亢亳于舒ム 仂亟仆仂于亠仄亠仆仆仂
仄仆仂亢亠于仂 仂亠亟亳仆亠仆亳亶, 仄仍亳仗仍亠从亳 亳 于亰仂于舒仄亳
仂仗亠舒亳仂仆仆仂亶 亳亠仄 select, epoll (Linux) 亳 kqueue (FreeBSD).
舒弍仂亳亠 仗仂亠 于仗仂仍仆ム 亳从仍 仂弍舒弍仂从亳 仂弍亳亶 仂
亟亠从亳仗仂仂于 (仄. 弌仂弍亳亶仆仂 - 仂亳亠仆亳仂于舒仆仆仂亠
仗仂亞舒仄仄亳仂于舒仆亳亠).
 C仂亟亠亢亳 仄仂亟仍 亞亠仂亞舒亳亠从仂亶 从仍舒亳亳从舒亳亳 从仍亳亠仆仂于 仗仂
IP-舒亟亠.  亠亞仂 仂仆仂于 于仂亟亳 弍舒亰舒 亟舒仆仆 仂仂于亠于亳 IP-
舒亟亠仂于 亞亠仂亞舒亳亠从仂仄 亠亞亳仂仆, 仗亠亟舒于仍亠仆仆舒 于 于亳亟亠 Radix
tree (亢舒仂亠 仗亠亳从仆仂亠 亟亠亠于仂 亳仍亳 亢舒亶 弍仂) 于
仂仗亠舒亳于仆仂亶 仗舒仄亳. nginx 仗亠亟于舒亳亠仍仆仂 舒仗亠亟亠仍磳
仗亠于亠 仆亠从仂仍从仂 仂于仆亠亶 亟亠亠于舒, 舒从亳仄 仂弍舒亰仂仄, 仂弍 仂仆亳
亰舒仆亳仄舒仍亳 仂于仆仂 1 舒仆亳 仗舒仄亳. 亅仂 亞舒舒仆亳亠, 仂 仗亳
仗仂亳从亠 IP-舒亟亠舒 亟仍 仗亠于 仆亠从仂仍从亳 亰仍仂于 仗亳 舒仆仍亳亳
舒亟亠舒 于亠亞亟舒 仆舒亶亟 亰舒仗亳 于 TLB.
Web servers
Web servers
COMBINATION OF APACHE AND NGINX
 https://www.getpostman.com/downloads/
 https://jsonplaceholder.typicode.com/
 https://github.com/typicode/json-server

More Related Content

Web servers

  • 2. A web server is specialised software that responds to client (I.e. web browser) requests Every web site requires a web server to process client requests and serve up the pages Web servers used to service Internet, intranets and extranets
  • 3. A web server is part of a multi-tier application (also called n-tier application Functionality is divided into separate tiers or groupings Tiers can be on same computer or on separate computers Web applications are often three tiered: Information tier (also called data tier) Middle tier Client tier (user interface tier)
  • 4. Hyper Text Transfer Protocol Web servers communicate with clients using a Response-Request protocol: HTTP
  • 5. A request is generated by a client (by browser software) - Most common requests are Get and Post Request reaches the appropriate web-server Request is processed by the web-server A response is formulated by the web server and sent back to the client (e.g. web page contents)
  • 6. Client-Server model and HTTP HTTP is the de facto standard for transferring World Wide Web documents Usually to port 80 HTTP messages (requests and responses) between client and server are human readable
  • 7. Http: Requests from client Request Get resource Type of browser Name of host etc First line is request-line. Contains the nature of the Request e.g. GET: Get a file from the server POST: Post data to the server PUT: Store some resource
  • 8. HTTP Response Status Codes 1XX: Provide information to the client 2XX: Correct response has occurred. 3XX: Browser must carry out some further action in order for the request to be successful. For example, the code 301 indicates that the resource that was requested has been permanently moved to another location. 4XX: Something has gone wrong; for example, the most frequent status code that is returned is 404 which indicates that the resource that has been requested cannot be found. 5XX: Server has experienced a problem. For example, the status code 503 indicates that the service requested has not been able to be carried out.
  • 10. web server functionality But usually includes many other functions such as: File Transfer Protocol (FTP) server Simple Mail Transfer Protocol (SMTP) server (for Email) Web development and publishing functionality Support for specific server side technologies e.g. JSP, SSIs Security features And more
  • 11. Selecting a web server Performance e.g. how many client requests per second can be processed? Load balancing? Reliability How robust is the web server? How liable to crash? How easily recovered?
  • 12. Ease of Use How easy to set up, administer, learn? Support What support is provided by the vendor? Price How must does it cost to buy and maintain? Security What security functionality is offered? e.g. SSL? Functionality server side techologies supported? (as add-ons? e.g. TomCat for Apache) e.g. ASP? JSP? CGI? etc Logging Proxy server Operating system What operating system(s) does the web server support?
  • 13. 丐亳仗 HTTP 亠于亠仂于 弌舒亳亠从亳亶 于亠弍-亠于亠, 亳仍亳 亠从, 仗仂仍舒亠 舒亰仄亠亠仆仆亠 仆舒 仆亠仄 舒亶仍 于 弍舒亰亠 从舒从 亠. (nginx, Apache) 亳仆舒仄亳亠从亳 于亠弍-亠于亠 仂仂亳 亳亰 舒亳亠从仂亞仂 于亠弍-亠于亠舒 仗仍ム 亟仂仗仂仍仆亳亠仍仆仂亞仂 仗仂亞舒仄仄仆仂亞仂 仂弍亠仗亠亠仆亳, 仆舒亳弍仂仍亠亠 舒仂 亠于亠仂仄 仗亳仍仂亢亠仆亳亶 亳 弍舒亰 亟舒仆仆. (Gunicorn, Waitress, Tornado)
  • 14. 弌舒亳亠从亳亠 亠弍-舒亶 仗仂亠 于亠亞仂 舒仆仂于亳. 仆亳仄 仂仆仂 HTML 舒仆亳, 从舒亳仆从亳, 亳, CSS 亳仍亳 亳 仗仂亠亠 亳仆舒仄亳亠从亳亶 亠弍-舒亶 仂亰仆舒舒亠, 仂 亠于亠 仂弍舒弍舒于舒亠 亟舒仆仆亠 亳仍亳 亟舒亢亠 亞亠仆亠亳亠 亳 仆舒 仍亠 亳亰 弍舒亰 亟舒仆仆. 亅仂 仂弍亠仗亠亳于舒亠 弍仂仍亠 亞亳弍从仂亳, 仆仂 亠仆亳亠从亳 仍仂亢仆亠亠 于 仂弍仍亢亳于舒仆亳亳, 仂 亟亠仍舒亠 亠亞仂 弍仂仍亠亠 仍仂亢仆仄 于 舒亰舒弍仂从亠.
  • 15. 弌于磶 亠弍-仗亳仍仂亢亠仆亳 HTTP- 亠于亠仂仄 CGI FastCGI 仂亠仆仆亶 亠于亠 WSGI
  • 16. CGI
  • 17. CGI 仂 仆亠 磶从 仗仂亞舒仄仄亳仂于舒仆亳! 亅仂 仗仂仂亶 仗仂仂从仂仍, 仗仂亰于仂仍ム亳亶 亠弍- 亠于亠 仗亠亠亟舒于舒 亟舒仆仆亠 亠亠亰 stdin 亳 亳舒 亳 亳亰 stdout. 仂仂仄, 于 从舒亠于亠 CGI-仂弍舒弍仂亳从舒 仄仂亢亠 亳仗仂仍亰仂于舒 仗仂亞舒仄仄舒 仆舒 仍ミ頴笑 磶从亠, 仗仂仂弍仆仂仄 舒弍仂舒 仂 舒仆亟舒仆仄亳 仗仂仂从舒仄亳 于于仂亟舒-于于仂亟舒.
  • 19. CGI. 亠亳仄亠于舒 仂亠 CGI 从亳仗舒 仆亠 亰舒于亳亳 仂 亠弍- 亠于亠舒 亳 于 仍舒亠 仗舒亟亠仆亳 仆亳 从舒从 仆亠 仂舒亰亳 仆舒 舒弍仂亠 仗仂仍亠亟仆亠亞仂. 仂亢亠 弍 仆舒仗亳舒仆 仆舒 仍ミ頴笑 磶从亠 仗仂亞舒仄仄亳仂于舒仆亳. 仂亟亟亠亢亳于舒亠 弍仂仍亳仆于仂仄 亠弍- 亠于亠仂于.
  • 20. CGI. 亠亟仂舒从亳 仂亠弍仍亠仆亳亠 亠仂于 亠仍仂 于 仂仄, 仂 从舒亢亟仂亠 仂弍舒亠仆亳亠 从 CGI- 仗亳仍仂亢亠仆亳 于亰于舒亠 仗仂仂亢亟亠仆亳亠 仆仂于仂亞仂 仗仂亠舒, 仂 于亠仄亳 于亠从舒ム亳仄亳 仂ミ莞 仆舒从仍舒亟仆仄亳 舒仂亟舒仄亳.
  • 22. FastCGI 仂仍亳亳亠 仂 CGI, FastCGI 亳仗仂仍亰亠 仗仂仂礌仆仂 亰舒仗亠仆仆亠 仗仂亠 亟仍 仂弍舒弍仂从亳 仄仆仂亢亠于舒 亰舒仗仂仂于. FastCGI-仗仂亠 亳仗仂仍亰ム 亟仍 于磶亳 亠于亠仂仄 Unix Domain Sockets 亳仍亳 TCP/IP.
  • 23. 仂亠仆仆亶 亠于亠 仆亠从仂仂 磶从舒, 仆舒仗亳仄亠 Go, 亢亠 亠于亠 于仂亠仆仆亶 亠弍-亠于亠.
  • 24. WEB SERVERS(IIS, APACHE, NGINX) 1) Client sends request to server. 2) Server accepts the request and then process it. 3) Server sends back the request to client.
  • 25. HISTORY 1989 CERN httpd Sir Tim Berners-Lee
  • 26. TYPES OF WEB SERVERS Dedicated Server: - physical server - purchased or rented for your own business needs - For large businesses - high levels of data security - running 24*7*365
  • 27. Cloud Server: - virtual server - less costs - for small and mid-sized businesses
  • 28. HANDLE REQUESTS 1. append the given path to the path of root directory Root directory in configs Https://arastu.ir/a/b/c.pdf /home/arastu/www/arastu.ir/a/b/c.pdf 2. Create Response Based on configs Create response dynamically with server side programming languages Return static file Error
  • 29. WEB SERVERS IIS Apache Nginx
  • 30. IIS
  • 31. Components: HTTP .sys Worker processes (w3wp.exe) ISAPI InetInfo.exe Application pools
  • 32. IIS ( Internet Information Services, 亟仂 于亠亳亳 5.1 Internet Information Server ) 仗仂仗亳亠舒仆亶 仆舒弍仂 亠于亠仂于 亟仍 仆亠从仂仍从亳 仍亢弍 仆亠仆亠舒 仂 从仂仄仗舒仆亳亳 舒亶从仂仂. IIS 舒仗仂舒仆磳 仂仗亠舒亳仂仆仆仄亳 亳亠仄舒仄亳 亠仄亠亶于舒 Windows NT. 仆仂于仆仄 从仂仄仗仂仆亠仆仂仄 IIS 磦仍磳 于亠弍-亠于亠, 从仂仂亶 仗仂亰于仂仍磳 舒亰仄亠舒 于 仆亠仆亠亠 舒亶. IIS 仗仂亟亟亠亢亳于舒亠 仗仂仂从仂仍 HTTP, HTTPS, FTP, POP3, SMTP, NNTP.
  • 33. 弌仍亢弍舒 WWW 于 仂舒于亠 IIS 仆仂于仆仄 从仂仄仗仂仆亠仆仂仄 IIS 磦仍磳 于亠弍-亠于亠 仍亢弍舒 WWW (仆舒亰于舒亠仄舒 舒从亢亠 W3SVC), 从仂仂舒 仗亠亟仂舒于仍磳 从仍亳亠仆舒仄 亟仂仗 从 舒亶舒仄 仗仂 仗仂仂从仂仍舒仄 HTTP 亳, 亠仍亳 仗仂亳亰于亠亟亠仆舒 仆舒仂亶从舒, HTTPS. 亟亳仆 亠于亠 IIS 仄仂亢亠 仂弍仍亢亳于舒 仆亠从仂仍从仂 舒亶仂于 (IIS 6.0 亳 于亠). 舒亢亟亶 舒亶 亳仄亠亠 仍亠亟ム亳亠 舒亳弍: IP-舒亟亠 舒亶舒; TCP-仗仂, 仆舒 从仂仂仂仄 仍亢弍舒 WWW 仂亢亳亟舒亠 仗仂亟从仍ム亠仆亳亶 从 亟舒仆仆仂仄 舒亶; 舒亞仂仍仂于仂从 亰仍舒 (Host header name) 亰仆舒亠仆亳亠 亰舒亞仂仍仂于从舒 Host 亰舒仗仂舒 HTTP, 从舒亰于舒ム亠亠 仂弍仆仂 DNS- 亳仄 舒亶舒.
  • 34. 亳亠从舒 仍亢弍 WWW IIS 6.0, 亟仂仗仆仂仄 于 仂舒于亠 亳亠仄 Windows Server 2003, 仍亢弍舒 WWW 仗亠亠仗亠仍舒 亠亰仆亠 亳亰仄亠仆亠仆亳. 仍 亟仂弍舒于仍亠仆 仆仂于亶 亠亢亳仄 仂弍舒弍仂从亳 亰舒仗仂仂于, 仆舒亰于舒亠仄亶 亠亢亳仄仂仄 亳亰仂仍亳亳 舒弍仂亳 仗仂亠仂于 (舒仆亞仍. worker process isolation mode).
  • 35. 亠亰仂仗舒仆仂 于 仍亢弍亠 WWW 亠弍-亠于亠 IIS 仗亠亟仂舒于仍磳 仆亠从仂仍从仂 仗仂仂弍仂于 舒亰亞舒仆亳亠仆亳 亟仂仗舒 从 舒亶舒仄 亳 于亠弍-仗亳仍仂亢亠仆亳礆. 弌仍亢弍舒 WWW 于 仂舒于亠 IIS 仂仍亳舒亠 仂 亟亞亳 于亠弍-亠于亠仂于 亠仄, 仂 仆从亳亳 仂弍亠仗亠亠仆亳 弍亠亰仂仗舒仆仂亳 于 仆亠亶 亠仆仂 亳仆亠亞亳仂于舒仆 亳亠仄仂亶 Windows NT, 仆舒 仂仆仂于亠 从仂仂仂亶 仂仆舒 舒弍仂舒亠.
  • 36. 弌仍亢弍舒 WWW 仗仂亟亟亠亢亳于舒亠 亳 仂仆仂于仆 仄亠仂亟舒 舒亠仆亳亳从舒亳亳 舒亰仂于舒 舒亠仆亳亳从舒亳 (basic authentication) 亳仄 亳 仗舒仂仍 仗亠亠亟舒ム 仗仂 亠亳 仂从仄 亠从仂仄. 弌亢舒舒 舒亠仆亳亳从舒亳 (digest authentication) 仗舒仂仍 仂弍舒弍舒于舒亠 亠-仆从亳亠亶 仗亠亠亟 仂仗舒于从仂亶 仗仂 亠亳, 仂 亟亠仍舒亠 仆亠于仂亰仄仂亢仆仄 亠亞仂 仗仂亠仆亳亠 于 仍舒亠 仗亠亠于舒舒 亰仍仂仄仍亠仆仆亳从仂仄. 仂亠仆仆舒 舒亠仆亳亳从舒亳 Windows (integrated Windows authentication) 于仗仂仍仆磳 仗仂仗从舒 于仂亟舒 仆舒 亠于亠 亠仄亳 亢亠 仆仄亳 亟舒仆仆仄亳, 仗仂亟 从仂仂仄亳 舒弍仂舒亠 弍舒亰亠 仗仂仍亰仂于舒亠仍.
  • 37. 亠舒仍亳亰舒亳 于亠弍-仗亳仍仂亢亠仆亳亶 亟仍 IIS 亠弍-亠于亠 IIS 仗仂亟亟亠亢亳于舒亠 仆亠从仂仍从仂 舒亰仍亳仆 亠仆仂仍仂亞亳亶 仂亰亟舒仆亳 于亠弍-仗亳仍仂亢亠仆亳亶: ASP.NET 舒亰舒弍仂舒仆仆舒 Microsoft 亠仆仂仍仂亞亳; ASP 仗亠亟亠于仂于舒于舒 ASP.NET 亠仆仂仍仂亞亳 仂亰亟舒仆亳 亟亳仆舒仄亳亠从亳 于亠弍-舒仆亳 仆舒 仂仆仂于亠 亠仆舒亳亠于. 仂亟亳 于 仗仂舒于从 IIS 仆舒亳仆舒 于亠亳亳 3.0. CGI 舒仆亟舒仆舒 仄亠亢仗仍舒仂仄亠仆仆舒 仆亳亰从仂仂于仆亠于舒 亠仆仂仍仂亞亳 仂亰亟舒仆亳 亟亳仆舒仄亳亠从亳 于亠弍-舒仆亳. FastCGI 从仍亳亠仆-亠于亠仆亶 仗仂仂从仂仍 于亰舒亳仄仂亟亠亶于亳 于亠弍- 亠于亠舒 亳 仗亳仍仂亢亠仆亳. ISAPI 仆亳亰从仂仂于仆亠于舒 亠仆仂仍仂亞亳, 舒仆舒仍仂亞亳仆舒 亳仆亠亠亶 仄仂亟仍亠亶 Apache, 仗亠亟仂舒于仍ム舒 仗仂仍仆亶 亟仂仗 从仂 于亠仄 于仂亰仄仂亢仆仂礆 IIS, SSI 于从仍ム亠仆亳亠 于 仂亟仆亳 舒仆亳 亠从舒 亳亰 亟亞亳 舒仆亳.
  • 39. Apache HTTP-亠于亠 ( 仂从舒亠仆亳亠 仂 舒仆亞仍. a patchy server ) 于仂弍仂亟仆亶 于亠弍-亠于亠. Apache 磦仍磳 从仂仗仍舒仂仄亠仆仆仄 , 仗仂亟亟亠亢亳于舒亠 仂仗亠舒亳仂仆仆亠 亳亠仄 Linux, BSD, Mac OS, Microsoft Windows, Novell NetWare, BeOS. 仆仂于仆仄亳 亟仂仂亳仆于舒仄亳 Apache 亳舒ム 仆舒亟亢仆仂 亳 亞亳弍从仂 从仂仆亳亞舒亳亳. 仆 仗仂亰于仂仍磳 仗仂亟从仍ム舒 于仆亠仆亳亠 仄仂亟仍亳 亟仍 仗亠亟仂舒于仍亠仆亳 亟舒仆仆, 亳仗仂仍亰仂于舒 弌丕 亟仍 舒亠仆亳亳从舒亳亳 仗仂仍亰仂于舒亠仍亠亶, 仄仂亟亳亳亳仂于舒 仂仂弍亠仆亳 仂弍 仂亳弍从舒 亳 . 亟. 仂亟亟亠亢亳于舒亠 IPv6.
  • 40. 亳亠从舒 Apache 亊亟仂 Apache 于从仍ム舒亠 于 亠弍 仂仆仂于仆亠 仆从亳仂仆舒仍仆亠 于仂亰仄仂亢仆仂亳, 舒从亳亠 从舒从 仂弍舒弍仂从舒 从仂仆亳亞舒亳仂仆仆 舒亶仍仂于, 仗仂仂从仂仍 HTTP 亳 亳亠仄舒 亰舒亞亰从亳 仄仂亟仍亠亶. 亊亟仂 (于 仂仍亳亳亠 仂 仄仂亟仍亠亶) 仗仂仍仆仂 舒亰舒弍舒于舒亠 Apache Software Foundation, 弍亠亰 舒亳 仂仂仆仆亳 仗仂亞舒仄仄亳仂于. 丐亠仂亠亳亠从亳, 磲仂 apache 仄仂亢亠 仆从亳仂仆亳仂于舒 于 亳仂仄 于亳亟亠, 弍亠亰 亳仗仂仍亰仂于舒仆亳 仄仂亟仍亠亶. 亟仆舒从仂, 仆从亳仂仆舒仍仆仂 舒从仂亞仂 亠亠仆亳 从舒亶仆亠 仂亞舒仆亳亠仆舒. 亊亟仂 Apache 仗仂仍仆仂 仆舒仗亳舒仆仂 仆舒 磶从亠 仗仂亞舒仄仄亳仂于舒仆亳 C.
  • 41. 亠舒仆亳亰仄 于亳舒仍仆 仂仂于. Apache 亳仄亠亠 于仂亠仆仆亶 仄亠舒仆亳亰仄 于亳舒仍仆 仂仂于. 仆 仗仂亰于仂仍磳 仗仂仍仆仂亠仆仆仂 仂弍仍亢亳于舒 仆舒 仂亟仆仂仄 IP- 舒亟亠亠 仄仆仂亢亠于仂 舒亶仂于 (亟仂仄亠仆仆 亳仄仆), 仂仂弍舒亢舒 亟仍 从舒亢亟仂亞仂 亳亰 仆亳 仂弍于亠仆仆仂亠 仂亟亠亢亳仄仂亠. 仍 从舒亢亟仂亞仂 于亳舒仍仆仂亞仂 仂舒 仄仂亢仆仂 从舒亰舒 仂弍于亠仆仆亠 仆舒仂亶从亳 磲舒 亳 仄仂亟仍亠亶, 仂亞舒仆亳亳 亟仂仗 从仂 于亠仄 舒亶 亳仍亳 仂亟亠仍仆仄 舒亶仍舒仄. 亠从仂仂亠 MPM, 仆舒仗亳仄亠 Apache-ITK 仗仂亰于仂仍ム 亰舒仗从舒 仗仂亠 httpd 亟仍 从舒亢亟仂亞仂 于亳舒仍仆仂亞仂 仂舒 仂亟亠仍仆仄亳 亳亟亠仆亳亳从舒仂舒仄亳 uid 亳 guid.
  • 42. 仆亠亞舒亳 亟亞亳仄 亳 磶从舒仄亳 仗仂亞舒仄仄亳仂于舒仆亳 弌亠于亠 仄仆仂亢亠于仂 仄仂亟仍亠亶, 亟仂弍舒于仍ム亳 从 Apache 仗仂亟亟亠亢从 舒亰仍亳仆 磶从仂于 仗仂亞舒仄仄亳仂于舒仆亳 亳 亳亠仄 舒亰舒弍仂从亳. PHP (mod_php). Python (mod python, mod wsgi). Ruby (apache-ruby). Perl (mod perl). ASP (apache-asp). Tcl (rivet)
  • 43. 亠亰仂仗舒仆仂 亞舒仆亳亠仆亳亠 亟仂仗舒 从 仂仗亠亟亠仍仆仆仄 亟亳亠从仂亳礆 亳仍亳 舒亶仍舒仄. 亠舒仆亳亰仄 舒于仂亳亰舒亳亳 仗仂仍亰仂于舒亠仍亠亶 亟仍 亟仂仗舒 从 亟亳亠从仂亳亳 仗仂 仄亠仂亟 HTTP-于仂亳亰舒亳亳 (mod_auth_basic) 亳 digest-舒于仂亳亰舒亳亳 (mod_auth_digest). 亞舒仆亳亠仆亳亠 亟仂仗舒 从 仂仗亠亟亠仍仆仆仄 亟亳亠从仂亳礆 亳仍亳 于亠仄 亠于亠, 仂仆仂于舒仆仆仂亠 仆舒 IP-舒亟亠舒 仗仂仍亰仂于舒亠仍亠亶. 舒仗亠 亟仂仗舒 从 仂仗亠亟亠仍仆仆仄 亳仗舒仄 舒亶仍仂于 亟仍 于亠 亳仍亳 舒亳 仗仂仍亰仂于舒亠仍亠亶, 仆舒仗亳仄亠 亰舒仗亠 亟仂仗舒 从 从仂仆亳亞舒亳仂仆仆仄 舒亶仍舒仄 亳 舒亶仍舒仄 弍舒亰 亟舒仆仆. 弌亠于ム 仄仂亟仍亳, 亠舒仍亳亰ム亳亠 舒于仂亳亰舒亳 亠亠亰 弌丕 亳仍亳 PAM.
  • 44. NGINX
  • 45. nginx ( 舒仆亞仍. engine x ) ( 仗仂-从亳 仗仂亳亰仆仂亳 从舒从 仆亟亢亳仆-从 ) 于亠弍- 亠于亠 亳 仗仂仂于亶 仗仂从亳-亠于亠, 舒弍仂舒ム亳亶 仆舒 Unix-仗仂亟仂弍仆 仂仗亠舒亳仂仆仆 亳亠仄舒 (亠亳仂于舒仍舒 弍仂从舒 亳 舒弍仂舒 仆舒 FreeBSD, OpenBSD, Linux, Solaris, Mac OS X, AIX). 舒亳仆舒 于亠亳亳 0.7.52 仗仂磦亳仍舒 弍亳仆舒仆舒 弍仂从舒 仗仂亟 Microsoft Windows.
  • 46. 仆仂于仆亠 仆从亳亳 HTTP-亠于亠 NGINX 仂弍仍亢亳于舒仆亳亠 舒亳亠从亳 亰舒仗仂仂于, 亳仆亟亠从仆 舒亶仍仂于, 舒于仂仄舒亳亠从仂亠 仂亰亟舒仆亳亠 仗亳从舒 舒亶仍仂于, 从亠 亟亠从亳仗仂仂于 仂从 舒亶仍仂于 舒从亠仍亠亳仂于舒仆仆仂亠 仗仂从亳仂于舒仆亳亠 弍亠亰 从亳仂于舒仆亳, 仗仂仂亠 舒仗亠亟亠仍亠仆亳亠 仆舒亞亰从亳 亳 仂从舒亰仂仂亶亳于仂 仗仂亟亟亠亢从舒 从亠亳仂于舒仆亳 仗亳 舒从亠仍亠亳仂于舒仆仆仂仄 仗仂从亳仂于舒仆亳亳 亳 FastCGI 舒从亠仍亠亳仂于舒仆仆舒 仗仂亟亟亠亢从舒 FastCGI 亳 memcached 亠于亠仂于, 仗仂仂亠 舒仗亠亟亠仍亠仆亳亠 仆舒亞亰从亳 亳 仂从舒亰仂仂亶亳于仂 仄仂亟仍仆仂, 亳仍, 于 仂仄 亳仍亠 亢舒亳亠 (gzip), byte-ranges (亟仂从舒从舒), chunked 仂于亠, HTTP-舒亠仆亳亳从舒亳, SSI-亳仍 仆亠从仂仍从仂 仗仂亟亰舒仗仂仂于 仆舒 仂亟仆仂亶 舒仆亳亠, 仂弍舒弍舒于舒亠仄亠 于 SSI- 亳仍亠 亠亠亰 仗仂从亳 亳仍亳 FastCGI, 于仗仂仍仆ム 仗舒舒仍仍亠仍仆仂 仗仂亟亟亠亢从舒 SSL 从仗亠亳仄亠仆舒仍仆舒 仗仂亟亟亠亢从舒 于仂亠仆仆仂亞仂 Perl
  • 47. 亳亠从舒 nginx 舒弍仂亳亠 仗仂亠 仂弍仍亢亳于舒ム 仂亟仆仂于亠仄亠仆仆仂 仄仆仂亢亠于仂 仂亠亟亳仆亠仆亳亶, 仄仍亳仗仍亠从亳 亳 于亰仂于舒仄亳 仂仗亠舒亳仂仆仆仂亶 亳亠仄 select, epoll (Linux) 亳 kqueue (FreeBSD). 舒弍仂亳亠 仗仂亠 于仗仂仍仆ム 亳从仍 仂弍舒弍仂从亳 仂弍亳亶 仂 亟亠从亳仗仂仂于 (仄. 弌仂弍亳亶仆仂 - 仂亳亠仆亳仂于舒仆仆仂亠 仗仂亞舒仄仄亳仂于舒仆亳亠). C仂亟亠亢亳 仄仂亟仍 亞亠仂亞舒亳亠从仂亶 从仍舒亳亳从舒亳亳 从仍亳亠仆仂于 仗仂 IP-舒亟亠. 亠亞仂 仂仆仂于 于仂亟亳 弍舒亰舒 亟舒仆仆 仂仂于亠于亳 IP- 舒亟亠仂于 亞亠仂亞舒亳亠从仂仄 亠亞亳仂仆, 仗亠亟舒于仍亠仆仆舒 于 于亳亟亠 Radix tree (亢舒仂亠 仗亠亳从仆仂亠 亟亠亠于仂 亳仍亳 亢舒亶 弍仂) 于 仂仗亠舒亳于仆仂亶 仗舒仄亳. nginx 仗亠亟于舒亳亠仍仆仂 舒仗亠亟亠仍磳 仗亠于亠 仆亠从仂仍从仂 仂于仆亠亶 亟亠亠于舒, 舒从亳仄 仂弍舒亰仂仄, 仂弍 仂仆亳 亰舒仆亳仄舒仍亳 仂于仆仂 1 舒仆亳 仗舒仄亳. 亅仂 亞舒舒仆亳亠, 仂 仗亳 仗仂亳从亠 IP-舒亟亠舒 亟仍 仗亠于 仆亠从仂仍从亳 亰仍仂于 仗亳 舒仆仍亳亳 舒亟亠舒 于亠亞亟舒 仆舒亶亟 亰舒仗亳 于 TLB.