CT320: Network and System Administration

Fall 2019

WWW

Show Lecture.WWW as a slide show.

CT320 WWW

First web server, CERN

URL

Web Browsing

How a Web Server Works

Fetching a web page

Let’s fetch this web page:

Warning: Use of undefined constant HTTP_HOST - assumed 'HTTP_HOST' (this will throw an Error in a future version of PHP) in /s/bach/a/class/cs000/public_html/pmwiki/cookbook/php.php(17) : eval()'d code on line 1
cs.colostate.edu to (:ip
Warning: Use of undefined constant HTTP_HOST - assumed 'HTTP_HOST' (this will throw an Error in a future version of PHP) in /s/bach/a/class/cs000/public_html/pmwiki/cookbook/php.php(17) : eval()'d code on line 1
cs.colostate.edu:) via DNS.

Warning: Use of undefined constant HTTP_HOST - assumed 'HTTP_HOST' (this will throw an Error in a future version of PHP) in /s/bach/a/class/cs000/public_html/pmwiki/cookbook/php.php(17) : eval()'d code on line 1
cs.colostate.edu:) at port 443 (HTTPS).

Fetching a web page

Send an HTTP request:

GET /~ct320/Fall19/Lecture/WWW HTTP/1.1
Accept: */*
Accept-Encoding: gzip, br, zstd, deflate
Host: cs.colostate.edu
User-Agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)

Browsing Response

The response from the web server looks like this:

HTTP/1.1 200 OK Date: Sat, 23 Nov 2024 11:55:59 GMT Server: Apache/2.4.6 (Red Hat Enterprise Linux) X-Powered-By: PHP/5.4.16 Vary: Accept-Encoding Set-Cookie: ☠☠☠ Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8
<!doctype html> <meta charset='utf-8'> <title>CT320 | Lecture / WWW</title> …

HTTP Response Codes

An HTTP response looks like this: HTTP/1.1 200 OK
or, in general: HTTP/version numeric-code human-readable-code

The numeric codes are for programs, the words are for people.

Some popular HTTP response codes:

HTML

Browsing Security Considerations

Warning: Use of undefined constant HTTP_HOST - assumed 'HTTP_HOST' (this will throw an Error in a future version of PHP) in /s/bach/a/class/cs000/public_html/pmwiki/cookbook/php.php(17) : eval()'d code on line 1
cs.colostate.edu.

Private Browsing

made at imgflip.com

Private Browsing

made at imgflip.com

www.

www. examples

example.net and www.example.net simply have separate DNS entries that resolve to the same IP address:

% host example.net
example.net has address 93.184.215.14
example.net has IPv6 address 2606:2800:21f:cb07:6820:80da:af6b:8b2c
example.net mail is handled by 0 .

% host www.example.net
www.example.net has address 93.184.215.14
www.example.net has IPv6 address 2606:2800:21f:cb07:6820:80da:af6b:8b2c

www. examples

The CS Department web server, www.cs.colostate.edu, is a DNS CNAME alias for another host:

% host www.cs.colostate.edu
www.cs.colostate.edu is an alias for beethoven.cs.colostate.edu.
beethoven.cs.colostate.edu has address 129.82.45.48

This way, our internal naming convention isn’t visible to the world.

www. examples

Fetching https://cs.colostate.edu/~ct320 with wget shows a lot of web server forwarding:

$ wget -S https://cs.colostate.edu/~ct320 |& egrep '^[-CR]|^  (Location|HTTP)'
--2024-11-23 04:55:59--  https://cs.colostate.edu/~ct320
Resolving cs.colostate.edu (cs.colostate.edu)... 129.82.45.48
Connecting to cs.colostate.edu (cs.colostate.edu)|129.82.45.48|:443... connected.
  HTTP/1.1 301 Moved Permanently
  Location: https://www.cs.colostate.edu/~ct320/
--2024-11-23 04:55:59--  https://www.cs.colostate.edu/~ct320/
Resolving www.cs.colostate.edu (www.cs.colostate.edu)... 129.82.45.48
Connecting to www.cs.colostate.edu (www.cs.colostate.edu)|129.82.45.48|:443... connected.
  HTTP/1.1 302 Found
  Location: Fall19/
--2024-11-23 04:55:59--  https://www.cs.colostate.edu/~ct320/Fall19/
Reusing existing connection to www.cs.colostate.edu:443.
  HTTP/1.1 200 OK

What’s the story with 301 vs. 302?