Practical Linux Infrastructure by Syed Ali

Practical Linux Infrastructure by Syed Ali

Author:Syed Ali
Language: eng
Format: epub, pdf
Publisher: Apress, Berkeley, CA


Apache HTTP Server supports all three methods. Keep-alive is enabled by default, and if a browser uses pipelining, then Apache supports it. Figure 6-1 shows the difference between request and response with and without pipelining ( https://en.wikipedia.org/wiki/HTTP_pipelining#mediaviewer/File:HTTP_pipelining2.svg ).

Figure 6-1.HTTP with and without pipelining

HTTP Headers

HTTP headers are part of request and response in an HTTP conversation. Listing 6-1 shows some common headers. Headers are in both a request and a response. Lines that you see beginning with > are part of the request header; lines that begin with < are part of the response header. Many of the headers are self-explanatory. For instance, the User-Agent header is part of the request, and it specifies the software that is connecting to the web server. In this case, because the Linux curl command is being used, the User-Agent is curl/7.37.1.

Similarly, the response header contains items that are mostly obvious to understand. For example, Date lists the date. Another example is the HTTP version, which is 1.1, followed by the response code, 200. There is also a cookie that Google is returning with Set-Cookie:. You can read more about HTTP headers at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html .

Listing 6-1. HTTP Headers

$ curl -s -I -v www.google.com | egrep '^>|^<'

* Rebuilt URL to: www.google.com/

* Hostname was NOT found in DNS cache

* Trying 74.125.239.147...

* Connected to www.google.com (74.125.239.147) port 80 (#0)

> HEAD / HTTP/1.1

> User-Agent: curl/7.37.1

> Host: www.google.com

> Accept: */*

>

< HTTP/1.1 200 OK

< Date: Mon, 17 Nov 2014 05:25:20 GMT

< Expires: -1

< Cache-Control: private, max-age=0

< Content-Type: text/html; charset=ISO-8859-1

< Set-Cookie: PREF=ID=0bc84cc1a616136e:FF=0:TM=1416201920:LM=1416201920:S=ayPF-9wOyv5Qgxx4; expires=Wed, 16-Nov-2016 05:25:20 GMT; path=/; domain=.google.com

< Set-Cookie: NID=67=ezWHuu1mNYXg2I_JleI3Mwuirzt8ETbv8RZiyfqMp3sMkBNFJMdbgSFPmCk36QUmFvYwC46b0LEyCbJuzvpjBsQwuASOw4JHxkA3y-f35D3uGTW83S4hI1AcbiHARi1-; expires=Tue, 19-May-2015 05:25:20 GMT; path=/; domain=.google.com ; HttpOnly

< P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."

* Server gws is not blacklisted

< Server: gws

< X-XSS-Protection: 1; mode=block

< X-Frame-Options: SAMEORIGIN

< Alternate-Protocol: 80:quic,p=0.01

< Transfer-Encoding: chunked

<

* Connection #0 to host www.google.com left intact



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.