10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.

Slides:



Advertisements
Similar presentations
CGI & HTML forms CGI Common Gateway Interface  A web server is only a pipe between user-agents  and content – it does not generate content.
Advertisements

Java Script Session1 INTRODUCTION.
Adding Dynamic Content to your Web Site
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Servlets and a little bit of Web Services Russell Beale.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Active X Microsoft’s Answer to Dynamic Content Reference: Using Active X by Brian Farrar QUE
1 Software Testing and Quality Assurance Lecture 32 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Definitions, Definitions, Definitions Lead to Understanding.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Web Client/Server Communication A290/A590, Fall /09/2014.
Chapter 6: Hostile Code Guide to Computer Network Security.
ITM352 Javascript and Dynamic Web Pages: Client Side Processing.
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
CGI Programming Languages Web Based Software Development July 21, 2005 Song, JaeHa.
1 ‘Dynamic’ Web Pages So far, we have developed ‘static’ web-pages, e.g., cv.html, repair.html and order.html. There is often a requirement to produce.
INTRODUCTION TO WEB DATABASE PROGRAMMING
IT 210 The Internet & World Wide Web introduction.
Computer Concepts 2014 Chapter 7 The Web and .
Overview A plain HTML document is static A CGI program is executed in real-time, so that it can output dynamic information. CGI (Common Gateway Interface)
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
1 Web Server Concepts Dr. Awad Khalil Computer Science Department AUC.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
Chapter 6 The World Wide Web. Web Pages Each page is an interactive multimedia publication It can include: text, graphics, music and videos Pages are.
1 Chapter 2 & Chapter 4 §Browsers. 2 Terms §Software §Program §Application.
 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 Accelerated Web Development Course JavaScript and Client side programming Day 2 Rich Roth On The Net
10/6/2015 ©2007 Scott Miller, University of Victoria 1 2a) Systems Introduction to Systems Introduction to Software Systems Rev. 2.0.
20-753: Fundamentals of Web Programming 1 Lecture 1: Introduction Fundamentals of Web Programming Lecture 1: Introduction.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: HTTP and CGI Fundamentals of Web Programming.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Website Development with PHP and MySQL Saving Data.
CGI Programming. What is it? CGI –Common Gateway Interface Standard way to pass information back to the Web Server –GET Query String –POST Standard Input.
Chapter 6 Server-side Programming: Java Servlets
1 Welcome to CSC 301 Web Programming Charles Frank.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
INTRODUCTION TO WEB APPLICATION Chapter 1. In this chapter, you will learn about:  The evolution of the Internet  The beginning of the World Wide Web,
Form Data Encoding GET – URL encoded POST – URL encoded
Netprog 2002 CGI Programming1 CGI Programming CLIENT HTTP SERVER CGI Program http request http response setenv(), dup(), fork(), exec(),...
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
2007cs Servers on the Web. The World-Wide Web 2007 cs CSS JS HTML Server Browser JS CSS HTML Transfer of resources using HTTP.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
Jan 2001C.Watters1 World Wide Web and E-Commerce Client Side Processing.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Fall 2000C.Watters1 World Wide Web and E-Commerce Clients & Client Side Processing.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
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.
WEB SERVER SOFTWARE FEATURE SETS
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Lesson 11. CGI CGI is the interface between a Web page or browser and a Web server that is running a certain program/script. The CGI (Common Gateway Interface)
The Common Gateway Interface (CGI) Pat Morin COMP2405.
WWW and HTTP King Fahd University of Petroleum & Minerals
Introduction to CGI and ajax
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.
Introduction to CGI and ajax
Chapter 27 WWW and HTTP.
Architecture of the web
Presentation transcript:

10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0

10/13/2015 ©2006 Scott Miller, University of Victoria 2 Static vs. Dynamic Content Static Content: Content that only changes when the site administrator changes it –Web pages, CSS, frame based sites, etc. –Includes “Dynamic looking” sites that have JavaScript client-side handlers Dynamic Content: Customized content based on user input –May be input from older session (via cookies) –Query data, DB lookups, Preferences (portal), Secure logins for commerce, etc. –Generated via Web Application

10/13/2015 ©2006 Scott Miller, University of Victoria 3 Static vs. Dynamic Content Web Server: Program (daemon) that listens for HTTP requests (on port 80) –Serves static HTML documents File on a file system mapped to the server’s root –Calls Application Server as needed Application Server: –Program called upon by a Web Server –Dynamically generates predefined content as its output HTML, XHTML, ASCII, etc.

10/13/2015 ©2006 Scott Miller, University of Victoria 4 Web Server – Little Bit ‘o Practical Domains are simply directory structures “mapped” off the hard disk. / / web img note cgi-bin Hard drive * cgi-bin would not be found!

10/13/2015 ©2006 Scott Miller, University of Victoria 5 Web Server – Little Bit ‘o Practical Virtual Hosting – The Web Server is configured to read a different directory structure as a domain’s root. / / tim img note ryan Hard drive

10/13/2015 ©2006 Scott Miller, University of Victoria 6 Get to know your UNIX! *NIX permissions are an effective shield against content others shouldn’t have. –Resources posted, but not yet available to user Know your directory structure for web serving (know what structure you will use to host site(s) and where to locate it/them. Know how to edit remotely via command line – especially know basic vi.

10/13/2015 ©2006 Scott Miller, University of Victoria 7 Client-Server Web Server Interaction Web Server App Server HTTPCGI stdin HTTP Request CGI stdout Response HTML, text, Java, etc.

10/13/2015 ©2006 Scott Miller, University of Victoria 8 Web Server Content HTML, CSS, XHTML, etc. Binary files (any binaries to be downloaded) Java Applets JavaScript enabled content Media rendering directly from MIME Types

10/13/2015 ©2006 Scott Miller, University of Victoria 9 Bandwidth management Client side scripting: –ex. Text viewer (zoomed in) for visually impaired Let them scroll around and zoom on client side after getting document from server Caching: Only get a resource if it has changed Compression: Transmit less bits through compression

10/13/2015 ©2006 Scott Miller, University of Victoria 10 Dynamic Content Serving CGI Rev 2.0

10/13/2015 ©2006 Scott Miller, University of Victoria 11 Application Servers If a Web Server only hosts static content, how do we get dynamic content? –APPLICATION SERVER! Usually a plug-in to a web server; still a distinct program Communicates with web server to perform calculations or action and return result Can consist of any language

10/13/2015 ©2006 Scott Miller, University of Victoria 12 Server-Server communications Web Server App Server HTTPCGI stdin HTTP Request CGI stdout Response HTML, text, Java, etc.

10/13/2015 ©2006 Scott Miller, University of Victoria 13 CGI – Common Gateway Interface CGI is a protocol –Can be written in any language that can read from stdin, write to stdout and can read environment variables TRANSLATION: Pretty much any language you like Referenced in url –e.g. As a directory  /cgi-bin/ Launched from web server as a separate process to handle the request

10/13/2015 ©2006 Scott Miller, University of Victoria 14 CGI Protocol How does web server pass information to the application server? –Environment variables –stdin/stdout CGI is about sending back the “Request Context” to the application server –HTTP request –HTTP headers –parameters

10/13/2015 ©2006 Scott Miller, University of Victoria 15 CGI Protocol – HTTP Headers HTTP HeaderEnvironment Variable Content-LengthCONTENT_LENGTH Content-TypeCONTENT_TYPE User-AgentHTTP_USER_AGENT HostHTTP_HOST *HTTP_*

10/13/2015 ©2006 Scott Miller, University of Victoria 16 CGI Protocol- Example GET /cgi-bin/Login.pl?username=Scott&pwd=foo HTTP/1.1 Host: Cookie: loginAttempt=3 Cookie: config=1 Env. VariableValue HTTP_Hostwww.uvic.ca QUERY_STRINGusername=Scott&pwd=foo HTTP_COOKIEloginAttempt=3;config=1

10/13/2015 ©2006 Scott Miller, University of Victoria 17 CGI Protocol – Continued The body of a HTTP request is written to stdin of the CGI process –POST method: body contains the query parameters THEREFORE: CGI script must look query parameters in 2 places –If GET: QUERY_STRING –If POST: stdin will contain CONTENT_LENGTH bytes

10/13/2015 ©2006 Scott Miller, University of Victoria 18 CGI Protocol – Finishing Touches The CGI program writes the full HTTP response to stdout –Includes HTTP headers –In Other Words: Output of CGI program is a complete HTTP response

10/13/2015 ©2006 Scott Miller, University of Victoria 19 CGI Calling Each CGI process is created from scratch by the web server for each request –Environment variables are ONLY for one request –CGI process terminates once it is done writing output

10/13/2015 ©2006 Scott Miller, University of Victoria 20 CG-I-Don’t-Know-About-This… Having to output raw HTML in CGI programs is: 1.A maintenance nightmare!!! 2.No separation of content from presentation –1 & 2 distinguish this approach as terrible Software Engineering. Why? Doesn’t scale well –New process for EACH request

10/13/2015 ©2006 Scott Miller, University of Victoria 21 CGI Key Ideas Output of CGI is HTML to be displayed on the browser What HTML contains is determined when the program runs (DYNAMIC CONTENT) as a function of query parameters In practice: the strings of HTML your CGI program generates will contain variables populated by queries