Web Client/Server Communication A290/A590, Fall 2014 09/09/2014.

Slides:



Advertisements
Similar presentations
Internet Applications INTERNET APPLICATIONS. Internet Applications Domain Name Service Proxy Service Mail Service Web Service.
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
4.01 How Web Pages Work.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
COEN 445 Communication Networks and Protocols Lab 4
1 Internet Umm Alqura University السنة التحضيرية مهارات الحاسب الالي (1)
Common Gateway Interface (CGI). CGI is a protocol: CGI is not a programming language CGI is a protocol for the exchange of information between between.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 21 – Web Servers (IIS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System.
The Internet Useful Definitions and Concepts About the Internet.
How the web works: HTTP and CGI explained
Introduction to Web Interface Technology (CSE2030)
Definitions, Definitions, Definitions Lead to Understanding.
CP476 Internet Computing Browser and Web Server 1 Web Browsers A client software program that allows you to access and view Web pages on the Internet –Examples.
Topics in this presentation: The Web and how it works Difference between Web pages and web sites Web browsers and Web servers HTML purpose and structure.
Web Servers and URLs And Domain Names. WWW vs. Internet World Wide Web An application layer built using the Internet Refers mostly to protocols and content.
 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.
Application Layer. Domain Name System Domain Name System (DNS) Problem – Want to go to but don’t know the IP addresswww.google.com Solution.
Networks Chapter 3. 2 What Is The Internet? It's not a big truck. It's a series of tubes. Ted Stevens, former Alaskan Senator, 6/28/2006 Internet: global.
Linux Operations and Administration
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
INTRODUCTION TO WEB DATABASE PROGRAMMING
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
1 Web Server Concepts Dr. Awad Khalil Computer Science Department AUC.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 7 The Application Layer.
Chapter 1: Introduction to Web
Server-side Scripting Powering the webs favourite services.
Chapter 10 Intro to Routing & Switching.  Upon completion of this chapter, you should be able to:  Explain how the functions of the application layer,
2013Dr. Ali Rodan 1 Handout 1 Fundamentals of the Internet.
ES Module 5 Uniform Resource Locators, Hypertext Transfer Protocol, & Common Gateway Interface.
Web application architecture
How Web Servers and the Internet Work by by: Marshall Brainby: Marshall Brain
Chapter 2 Browsing the Web. Web Sites  What is a Home Page?  What is a Web Portal? (portal) Example: Yahoo! Lycos and MSN Typically offer? ________________________________________.
Chapter 1: Introduction to Web Applications. This chapter gives an overview of the Internet, and where the World Wide Web fits in. It then outlines the.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: HTTP and CGI Fundamentals of Web Programming.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
The Inter-network is a big network of networks.. The five-layer networking model for the internet.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
1 Welcome to CSC 301 Web Programming Charles Frank.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
Appendix E: Overview of HTTP ©SoftMoore ConsultingSlide 1.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
CSI 3125, Preliminaries, page 1 Networking. CSI 3125, Preliminaries, page 2 Networking A network represents interconnection of computers that is capable.
The Internet, Fourth Edition-- Illustrated 1 The Internet – Illustrated Introductory, Fourth Edition Unit B Understanding Browser Basics.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
4.01 How Web Pages Work.
4.01 How Web Pages Work.
4.01 How Web Pages Work.
WWW and HTTP King Fahd University of Petroleum & Minerals
HTTP – An overview.
CISC103 Web Development Basics: Web site:
E-commerce | WWW World Wide Web - Concepts
E-commerce | WWW World Wide Web - Concepts
MapServer In its most basic form, MapServer is a CGI program that sits inactive on your Web server. When a request is sent to MapServer, it uses.
CISC103 Web Development Basics: Web site:
Chapter 27 WWW and HTTP.
Application layer Lecture 7.
4.01 How Web Pages Work.
4.01 How Web Pages Work.
Presentation transcript:

Web Client/Server Communication A290/A590, Fall /09/2014

Fixing permissions Execute these commands on Silo: $ acl_open –r ~/a290 dnikolov $ acl_open –r ~/a290 vsupe $ acl_open –r ~/a290 tdshah This will only give me and the Ais access to your a290 folders

Structure of a URL URL = Uniform Resource Locator General form: protocol://domain:port/path/to/file – How? The Application layer protocol. For example, browsers usually use HTTP. – Where on the Internet? The named address of the server is translated to an IP address for Internet travel. – Where on the server? The port number is used to find the Web server on the target machine, and then locate the virtual space (folder) on the Web server – What? Path to a specific file in the virtual space For example: web-dnikolov/index.html – port is 80 by default and is usually omitted

HTTP Transactions – The Big Picture HTTP = HyperText Transfer Protocol – The rules clients and servers on the Web follow to communicate with each other What does a simple HTTP transaction involve? 1.Let's say we are loading the Web page for Lab 1 2.The browser resolves the host name homes.soic.indiana.edu to an IP address 3.An HTTP request is sent to the IP address corresponding to homes.soic.indiana for the file /fall2014/csci/a290-web-dnikolov/lab1.html 4.A copy of the HTML document is sent back in the HTTP response and stored on the client 5.The HTML file is parsed and further requests are sent to the server to retrieve images, CSS, JavaScript, etc. 6.The additional files retrieved are also stored on the client. We can observe an HTTP transaction using the browser's Web Developer tool

Domain Name Service (DNS) DNS = Domain Name Service – Provides a mapping between host names and IP addresses Let's take a step back… How do web sites come in existence? – A web site needs hosting – a machine with a static IP Address on which to install the web server, Python, etc. – A web site also needs a domain – a unique name to be mapped to its IP address, e.g. indiana.edu – The hosting provider and domain provider need not be the same IP Addresses and domains – ICANN (Internet Corporation for Assigned Names and Numbers) assigns a range of IP addresses to RIRs (Regional Internet Registries), which assign IP addresses to ISPs (Internet Service Providers), e.g. IU, GoDaddy, etc. – ICANN also manages top-level domains such as.com,.net, etc. and provides a service ensuring domain name uniqueness A registrar (usually an ISP) can assign domain names under specific top-level domains to its customers, but has to register them with ICANN first

Domain Name Service (DNS) Registering a domain name – The ISP manages its own DNS server(s), which are updated once you register a host name – DNS is a hierarchy – the ISP's DNS server propagates mapping to DNS servers upwards in the hierarchy Usually takes a few hours after you register a domain for it to be available – An example of a DNS SOA (Start of Authority) record that may get propagated

SOA Record example ; $Id: knownspace,v /01/05 18:25:20 root Exp $ ; $TTL dimitarnikolov.org.INSOAmoose.cs.indiana.edu. rawlins.cs.indiana.edu. ( ; serial ; refresh (3 hours) 3600 ; retry (1 hour) ; expire (7 days) ) ; minimum (1 day) IN NSdns1 IN NSdns2 IN TXT"Dimitar Nikolov" IN TXT"Indiana University" IN MX 0mail.cs.indiana.edu. dns1INA dns2INA wwwIN CNAMEwww.cs.indiana.edu. developerINCNAMEwww.cs.indiana.edu.

The Structure of the Internet

HTTP Transactions – The Big Picture HTTP = HyperText Transfer Protocol – The rules clients and servers on the Web follow to communicate with each other What does a simple HTTP transaction involve? 1.Let's say we are loading the Web page for Lab 1 2.The browser resolves the host name homes.soic.indiana.edu to an IP address 3.An HTTP request is sent to the IP address corresponding to homes.soic.indiana for the file /fall2014/csci/a290-web-dnikolov/lab1.html 4.A copy of the HTML document is sent back in the HTTP response and stored on the client 5.The HTML file is parsed and further requests are sent to the server to retrieve images, CSS, JavaScript, etc. 6.The additional files retrieved are also stored on the client. We can observe an HTTP transaction using the browser's Web Developer tool

HTTP Requests & Responses The request consists of a header and a body (separated by a new line) The response consists of a start line, header and a body Let's look at this with telnet…

HTTP Requests Remember the first line of the HTTP header: GET /test/hi-there.txt Possible HTTP methods – GET: Send resource from the server to the client – POST: Send client data to a (CGI) application on the server – HEAD: Send just the HTTP headers from the response for a given resource – DELETE: Delete the resource from the server

File paths on the server The request for a directory loads a default file, e.g. index.html. If there isn't one, the directory contents may be listed. – Usually a security hazard The request for a file (usually) sends the file back to the client Web Server (e.g. Apache) i/a290-web-nikolov 1. i/a290-web-nikolov/lab2.html ├ ── index.html ├ ── … ├ ── classes │ ├ ── fall2014 │ │ ├ ──... │ │ ├ ── csci │ │ │ ├ ──... │ │ │ ├ ── a290-web-dnikolov │ │ │ │ ├ ── homepageinfo.html │ │ │ │ ├ ── index.html │ │ │ │ ├ ── index.html~ │ │ │ │ ├ ── lab1.html │ │ │ │ ├ ── lab1.html~ │ │ │ │ ├ ── lab2.html │ │ │ │ ├ ── lab2.html~ │ │ │ │ ├ ── lab2.temp.html~ │ │ │ │ ├ ── style.css │ │ │ │ ├ ── style.css~ │ │ │ │ └── syllabus.pdf ├ ── … 1 2 3

Notes About Apache ~/local/conf/httpd.conf is where you can specify a lot of relevant options, such as – where the Apache virtual space is AKA htdocs AKA wwwroot – what port number to listen for requests on – default HTML file to serve if a directory is requests, e.g. index.html – default pages to serve when an error occurs, e.g. 404 – File Not Found, 500 – Internal Server Error, etc. Important: Every time you change httpd.conf, you need to restart Apache for the changes to take effect!

CGI CGI = Common Gateway Interface – A way for the server to execute a binary script instead of simply delivering a static HTML file. Binaries files are placed in a special directory in the Web server's virtual space, usually cgi-bin When the server receives a request for the file in the CGI directory, instead of delivering the file to the client, it executes it and delivers the output – Before the script is executed, the web server puts any input data for the script received from the client in environmental variables – The HTTP action for executing a CGI script can be either GET or POST

What a CGI Program Looks Like import cgi html = """Content-Type: text/html\n A First CGI Program Hello, %(name)s! """ form = cgi.FieldStorage() name = form['name'].value print(html % name)

Next Time Processing HTML forms with Python and CGI