1 / 17

World Wide Web

World Wide Web. WeeSan Lee <weesan@cs.ucr.edu> http://www.cs.ucr.edu/~weesan/cs183/. Roadmap. Introduction HTTP URL HTML CGI Apache Server Installation Squid Cache Server Q&A. Introduction. Invented by Tim Berners-Lee in 1989/1990 Client-server architecture Servers

yakov
Télécharger la présentation

World Wide Web

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. World Wide Web WeeSan Lee <weesan@cs.ucr.edu> http://www.cs.ucr.edu/~weesan/cs183/

  2. Roadmap • Introduction • HTTP • URL • HTML • CGI • Apache Server Installation • Squid Cache Server • Q&A

  3. Introduction • Invented by Tim Berners-Lee in 1989/1990 • Client-server architecture • Servers • Apache, Netscape Enterprise Server, MS IIS, etc • Clients • GUI • Mosaic, Netscape, Mozilla, Firefox, Opera, Konqueror, Epiphany, IE, Safari, etc • Text • Link, wget, emacs, telnet, etc

  4. HTTP • Hypertext Transfer Protocol • Listen on port 80 or http (/etc/services) • $ grep " 80/tcp" /etc/services • http 80/tcp www • RFC2068 defines HTTP/1.0 • RFC2616 defines HTTP/1.1 • Built on top of TCP

  5. HTTP (cont) • $ telnet www.cs.ucr.edu 80 • Trying 138.23.169.15... • Connected to www.cs.ucr.edu. • Escape character is '^]'. • GET / HTTP/1.0 • HTTP/1.1 200 OK • Date: Mon, 16 Jul 2007 20:47:38 GMT • Server: Apache/2.2.3 (CentOS) • Last-Modified: Mon, 16 Jul 2007 20:08:44 GMT • ETag: "889f0f-d5-71bab00" • Accept-Ranges: bytes • Content-Length: 213 • Connection: close • Content-Type: text/html; charset=UTF-8 • …

  6. URL • Uniform Resource Locator • Eg. • http://www.cs.ucr.edu:80/~weesan/index.html • http – protocol/application • www.cs.ucr.edu – hostname • 80 – port • ~weesan/ - directory • Index.html - filename

  7. URL (cont) • Other protocols • file • file://etc/passwd • ftp • ftp://ftp.slackware.com/pub/slackware/slackware-12.0/ • https • https://www.cs.ucr.edu/ • mailto • mailto:weesan@cs.ucr.edu

  8. HTML • Hypertext Markup Language • Eg. • <head> • <title>A sample HTML</title> • </head> • <body> • <a href=“mailto:weesan@cs.ucr.edu”>Me</a> • </body>

  9. CGI • Common Gateway Interface • A way to communicate with external programs and generate pages dynamically • Example of external scripts/programs: • Perl, PHP, Python, Ruby, Bash, C/C++, Cobol, etc • Servers support plugins for performance, eg. • libphp4.so • libphp5.so • libperl.so

  10. Apache Server Installation • http://www.apache.org/ • $ yum install httpd • Files are distributed all over the places • /etc/httpd/conf/httpd.conf • /usr/sbin/httpd • /usr/sbin/apachectl • /var/www/html/ • /var/www/cgi-bin/ • /var/log/httpd/access_log • /var/log/httpd/error_log

  11. Apache Server Installation (cont) • To start the httpd server • $ /etc/init.d/httpd start • To restart the httpd server • $ /etc/init.d/httpd restart • To stop the httpd server • $ /etc/init.d/httpd stop • To start the httpd server on reboot • $ chkconfig --level 2345 httpd on

  12. Squid Cache Server • http://www.squid-cache.org/ • A free version spawned from Harvest Cache Project from USC, which became NetCache, and 8 months later, it was acquired by NetApp • Caches objects locally • Saves bandwidth • Reduces latency • Fast, not process forking for new connections • Supports Hierarchy Caching • Listen on port 3128

  13. Squid Cache Server (cont) • $ telnet cache.cs.ucr.edu 3128 • Trying cache.cs.ucr.edu... • Connected to cache.cs.ucr.edu. • Escape character is '^]'. • GET http://www.cs.ucr.edu/~weesan/cs183/login.php HTTP/1.0 • Host: www.cs.ucr.edu • HTTP/1.0 200 OK • Date: Thu, 08 May 2008 07:11:19 GMT • Server: Apache/2.2.3 (CentOS) • X-Powered-By: PHP/5.1.6 • Content-Type: text/html; charset=UTF-8 • X-Cache: MISS from cache.cs.ucr.edu • Via: 1.0 cache.cs.ucr.edu:3128 (squid/2.6.STABLE14) • Proxy-Connection: close • …

  14. Squid Cache Server (cont) .edu .net .com GET http://www.cs.ucr.edu HTTP/1.0

  15. Squid Cache Server (cont) • Accelerator Mode • Reverse Proxy • To make web server faster for static pages • Transparent Caching • Uses iptables • Configuration-free from clients

  16. Squid Cache Server (cont) • To create swap directories • $ squid –z • Run only once!!! • To run Squid Cache Server • $ RunCache • To reload the configuration • $ squid -k reconfiguration • To rotate the log files • $ squid -k rotate

  17. Reference • LAH • Ch 21: Web Hosting and Internet Servers • Apache Web Server • http://www.apache.org/ • Squid Cache Server • http://www.squid-cache.org/

More Related