HTTP and Apache Roy T. Fielding eBuilt, Inc. The Apache Software Foundation

Slides:



Advertisements
Similar presentations
XPointer and HTTP Range A possible design for a scalable and extensible RDF Data Access protocol. Bryan Thompson Presented to the RDF Data Access.
Advertisements

XPointer and HTTP Range A possible design for a scalable and extensible RDF Data Access protocol. Bryan Thompson draft Presented to the RDF.
REST Vs. SOAP.
waka: A replacement for HTTP
Introduction to Web Services
REST (Representational State Transfer)
Building a Simple Web Proxy
Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
The OWASP Foundation Web Application Security Host Apps Firewall Host Apps Database Host Web serverApp serverDB server Securing the.
CS 22: Enhanced Web Site Design - Week 8Slide 1 of 15 Enhanced Web Site Design Stanford University Continuing Studies CS 22 Mark Branom
The Web Core Ideas and Technologies Resources and Objects (and Services tomorrow) HTTP MIME Types URIs ReST.
CGI & HTML forms CGI Common Gateway Interface  A web server is only a pipe between user-agents  and content – it does not generate content.
Presenter: James Huang Date: Sept. 29,  HTTP and WWW  Bottle Web Framework  Request Routing  Sending Static Files  Handling HTML  HTTP Errors.
The Architecture of the World Wide Web Min Song IS NJIT.
Introduction to Computing Using Python CSC Winter 2013 Week 8: WWW and Search  World Wide Web  Python Modules for WWW  Web Crawling  Thursday:
SOAP.
XML in the real world (2) SOAP. What is SOAP? ► SOAP stands for Simple Object Access Protocol ► SOAP is a communication protocol ► SOAP is for communication.
SOAP SOAP is a protocol for accessing a Web Service. SOAP stands for Simple Object Access Protocol * SOAP is a communication protocol * SOAP is for communication.
An Introduction to the Internet and the Web Frank McCown COMP 250 – Internet Development Harding University.
SE 370: Programming Web Services Week 4: SOAP & NetBeans Copyright © Steven W. Johnson February 1, 2013.
HTTP – HyperText Transfer Protocol
How the web works: HTTP and CGI explained
Cornell CS502 Web Basics and Protocols CS 502 – Carl Lagoze Acks to McCracken Syracuse Univ.
HTTP HyperText Transfer Protocol Part 3.
Hypertext Transport Protocol CS Dick Steflik.
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
HyperText Transfer Protocol HTTP v1.1 hussein suleman uct cs honours 2007.
FTP (File Transfer Protocol) & Telnet
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Application Layer 2 Figures from Kurose and Ross
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
Sistem Jaringan dan Komunikasi Data #9. DNS The Internet Directory Service  the Domain Name Service (DNS) provides mapping between host name & IP address.
Web HTTP Hypertext Transfer Protocol. Web Terminology ◘Message: The basic unit of HTTP communication, consisting of structured sequence of octets matching.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
RESTful Web Services What is RESTful?
Computer Networks with Internet Technology William Stallings Chapter 04 Modern Applications 4.1 Web Access - HTTP.
What’s Really Happening
National College of Science & Information Technology.
HyperText Transfer Protocol HTTP v1.1 hussein suleman uct cs honours 2009.
Hypertext Transfer Protocol (HTTP) COMP6218 Web Architecture Dr Nicholas Gibbins –
Hypertext Transfer Protocol
Hypertext Transfer Protocol
HTTP – An overview.
The Hypertext Transfer Protocol
COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.
Web Server Design Week 4 Old Dominion University
HTTP Protocol Specification
Hypertext Transfer Protocol
Hypertext Transport Protocol
Web Caching? Web Caching:.
Representational State Transfer
HTTP Protocol.
Application HTTP.
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
WEB API.
HTTP Request Method URL Protocol Version GET /index.html HTTP/1.1
Web Server Design Week 5 Old Dominion University
Hypertext Transfer Protocol
HyperText Transfer Protocol
EE 122: HyperText Transfer Protocol (HTTP)
Hypertext Transfer Protocol (HTTP)
William Stallings Data and Computer Communications
The HTTP Protocol COSC 2206 Internet Tools The HTTP Protocol
Web Server Design Week 5 Old Dominion University
HTTP Hypertext Transfer Protocol
CSCI-351 Data communication and Networks
Presentation transcript:

HTTP and Apache Roy T. Fielding eBuilt, Inc. The Apache Software Foundation

Overview HTTP Basics Apache httpd architecture Connection management (listening) Request Reading Finding a representation Conditional request evaluation Response Writing Connection management (closing) Future Improvements waka/2.0

Web architecture Layered-client-server Uniform resource interface –Simple, but powerful –Semantics are visible to intermediaries HTTP extends interface across network HTTP Basics

HTTP Message Syntax GET /Test/hello.html HTTP/1.1 \r\n Host: kiwi.ics.uci.edu:8080 \r\n User-Agent: GET/7 libwww-perl/5.40 \r\n \r\n HTTP/ OK \r\n Date: Thu, 09 Mar :40:09 GMT \r\n Server: Apache/ \r\n Content-Type: text/html \r\n Content-Language: en \r\n Transfer-Encoding: chunked \r\n Etag: a797cd-465af \r\n Cache-control: max-age=3600 \r\n Vary: Accept-Language \r\n \r\n 4090 \r\n …

Request Envelope GET /Test/hello.html HTTP/1.1 \r\n Host: kiwi.ics.uci.edu:8080 \r\n User-Agent: GET/7 libwww-perl/5.40 \r\n \r\n

Request Control Data GET /Test/hello.html HTTP/1.1 \r\n Host: kiwi.ics.uci.edu:8080 \r\n User-Agent: GET/7 libwww-perl/5.40 \r\n \r\n

Request Metadata GET /Test/hello.html HTTP/1.1 \r\n Host: kiwi.ics.uci.edu:8080 \r\n User-Agent: GET/7 libwww-perl/5.40 \r\n \r\n

Request Metadata POST /nasdaq/trade.php HTTP/1.1 \r\n Host: \r\n User-Agent: poseur/1.0 libwww/3.1 \r\n Content-type: www/x-urlencoded \r\n Content-length: 58 \r\n \r\n Ticker=LNUX&quantity=140&action=sell &type=limit&amt=298.00

Request Data POST /nasdaq/trade.php HTTP/1.1 \r\n Host: \r\n User-Agent: poseur/1.0 libwww/3.1 \r\n Content-type: www/x-urlencoded \r\n Content-length: 58 \r\n \r\n Ticker=LNUX&quantity=140&action=sell &type=limit&amt=298.00

Request Data GET /Test/hello.html HTTP/1.1 \r\n Host: kiwi.ics.uci.edu:8080 \r\n User-Agent: GET/7 libwww-perl/5.40 \r\n \r\n

Response Envelope GET /Test/hello.html HTTP/1.1 \r\n Host: kiwi.ics.uci.edu:8080 \r\n User-Agent: GET/7 libwww-perl/5.40 \r\n \r\n HTTP/ OK \r\n Date: Thu, 09 Mar :40:09 GMT \r\n Server: Apache/ \r\n Content-Type: text/html \r\n Content-Language: en \r\n Transfer-Encoding: chunked \r\n Etag: a797cd-465af \r\n Cache-control: max-age=3600 \r\n Vary: Accept-Language \r\n \r\n 4090 \r\n …

Response Control Data GET /Test/hello.html HTTP/1.1 \r\n Host: kiwi.ics.uci.edu:8080 \r\n User-Agent: GET/7 libwww-perl/5.40 \r\n \r\n HTTP/ OK \r\n Date: Thu, 09 Mar :40:09 GMT \r\n Server: Apache/ \r\n Content-Type: text/html \r\n Content-Language: en \r\n Transfer-Encoding: chunked \r\n Etag: a797cd-465af \r\n Cache-control: max-age=3600 \r\n Vary: Accept-Language \r\n \r\n 4090 \r\n …

Response Metadata GET /Test/hello.html HTTP/1.1 \r\n Host: kiwi.ics.uci.edu:8080 \r\n User-Agent: GET/7 libwww-perl/5.40 \r\n \r\n HTTP/ OK \r\n Date: Thu, 09 Mar :40:09 GMT \r\n Server: Apache/ \r\n Content-Type: text/html \r\n Content-Language: en \r\n Transfer-Encoding: chunked \r\n Etag: a797cd-465af \r\n Cache-control: max-age=3600 \r\n Vary: Accept-Language \r\n \r\n 4090 \r\n …

Response Data GET /Test/hello.html HTTP/1.1 \r\n Host: kiwi.ics.uci.edu:8080 \r\n User-Agent: GET/7 libwww-perl/5.40 \r\n \r\n HTTP/ OK \r\n Date: Thu, 09 Mar :40:09 GMT \r\n Server: Apache/ \r\n Content-Type: text/html \r\n Content-Language: en \r\n Transfer-Encoding: chunked \r\n Etag: a797cd-465af \r\n Cache-control: max-age=3600 \r\n Vary: Accept-Language \r\n \r\n 4090 \r\n …

Overview HTTP Basics Apache httpd architecture Connection management (listening) Request Reading Finding a representation Conditional request evaluation Response Writing Connection management (closing) Future Improvements waka/2.0

httpd Initialization httpd core apache-2.0/src/main/*.c Initiate program http_main.c Read configuration files http_config.c, http_core.c Start logging http_log.c Start server listeners (MPM) apache-2.0/src/modules/mpm/*

Connection management Listening and Accept mpm/prefork/prefork.c mpm/mpmt_pthread.c … Connection set-up src/main/http_connection.c Modular hooks for protocol independence ap_process_http_connection() –Calls ap_read_request() and we are finally at the level of HTTP

Request Reading src/main/http_protocol.c GET /Test/hello.html HTTP/1.1 \r\n Host: kiwi.ics.uci.edu:8080 \r\n User-Agent: GET/7 libwww-perl/5.40 \r\n \r\n Request Line read_request_line(r) Header fields get_mime_headers(r) Host determination http_vhost.c

Request Processing src/main/http_request.c Access control Directory walk Location walk File walk Handler selection Field pre-processing Content Handler

Request Body src/main/http_protocol.c Declaration ap_setup_client_block(r, policy) Test ap_should_client_block(r) Read until done ap_get_client_block(r, …) Shortcut ap_discard_request_body(r)

Finding a representation Each content handler is responsible for associating the URI with a resource and applying the method, returning a representation as the response Redirection Negotiation Subrequests Errors

Conditional request evaluation Conditional requests modify method processing depending on the current state of the resource representation Last-Modified Etag Cache validation If-Modified-Since If-Nonematch Prerequisites If-Match If-Unmodified-Since Range-If If

Response Writing HTTP/ OK \r\n Date: Thu, 09 Mar :40:09 GMT \r\n Server: Apache/ \r\n Content-Type: text/html \r\n Content-Language: en \r\n Transfer-Encoding: chunked \r\n Etag: a797cd-465af \r\n Cache-control: max-age=3600 \r\n Vary: Accept-Language \r\n \r\n 4090 \r\n … Status code and reason phrase Header fields Body

Response Writing Status code and reason phrase r->status r->status_line || status_lines[idx] Header fields r->headers_out r->err_headers_out Headers set by modules mod_expires.c mod_headers.c –Header set Author John Q. Public

Send Body Body File Buffer IO-layer Transfer-encoding Length delimited Chunked Connection terminated

Connection management Persistent connections The big hairy if ap_set_keepalive(r) Connection tear-down Lingering close

Overview HTTP Basics Apache httpd architecture Connection management (listening) Request Reading Finding a representation Conditional request evaluation Response Writing Connection management (closing) Future Improvements waka/2.0

Future Improvements Configurable protocol elements Methods, status codes, field names Tokenized field manipulation Field name -> token Field value -> linked list Streaming IO Layers Stacked protocol manipulation Separate streams for data and metadata –Token streams Bucket brigades –Strings, Files, Cache handles

waka/2.0 A replacement for HTTP/1.x Emphasizes the REST architectural style Ideas from Speros HTTP-ng and W3C HTTP-NG Packet streams Control, meta-metadata, metadata, data Prioritized bandwidth usage Self-descriptive All syntax an extensible standard All cache rules in response Simple quality of service indicators Transport independent Tokenized Optimized for memory transfer

Questions? Where to go for more information Places to see: Front Doorwww.apache.org Developer Notesdev.apache.org PR Databasebugs.apache.org Apache Weekwww.apacheweek.com OReilly Netwww.oreilly.net/apache/