LIS650 lecture 6 http and apache Thomas Krichel 2004-03-12.

Slides:



Advertisements
Similar presentations
HTTP and Apache Roy T. Fielding eBuilt, Inc. The Apache Software Foundation
Advertisements

LIS901N lecture 5: http URI and apache Thomas Krichel
LIS650 lecture 5 javascript, http and apache Thomas Krichel
LIS508 lecture 9: important network applications Thomas Krichel
LIS650 lecture 6 javascript, http and apache Thomas Krichel
LIS650 lecture 5 information architecture javascript, http and apache Thomas Krichel
Building a Simple Web Proxy
Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
CGI & HTML forms CGI Common Gateway Interface  A web server is only a pipe between user-agents  and content – it does not generate content.
Presenter: James Huang Date: Sept. 29,  HTTP and WWW  Bottle Web Framework  Request Routing  Sending Static Files  Handling HTML  HTTP Errors.
What all is there Inside the Apache web server. These slides are part of study material of LAMP course. Course conducted by Prof Rocky Jagtiani – Technical.
PHP syntax basics. Personal Home Page This is a Hypertext processor It works on the server side It demands a Web-server to be installed.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
HTTP – HyperText Transfer Protocol
Hypertext Transfer Protocol Kyle Roth Mark Hoover.
Layer 7- Application Layer
HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
Cornell CS502 Web Basics and Protocols CS 502 – Carl Lagoze Acks to McCracken Syracuse Univ.
World Wide Web1 Applications World Wide Web. 2 Introduction What is hypertext model? Use of hypertext in World Wide Web (WWW) – HTML. WWW client-server.
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.
Hypertext Transport Protocol CS Dick Steflik.
 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.
An introduction to Apache. Different Types of Web Servers Apache is the default web server for may Unix servers. IIS is Microsoft’s default web server.
FTP (File Transfer Protocol) & Telnet
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
Web application architecture
Copyright (c) 2010, Dr. Kuanchin Chen1 The Client-Server Architecture of the WWW Dr. Kuanchin Chen.
Sistem Jaringan dan Komunikasi Data #9. DNS The Internet Directory Service  the Domain Name Service (DNS) provides mapping between host name & IP address.
Web Client-Server Server Client Hypertext link TCP port 80.
Application Layer Khondaker Abdullah-Al-Mamun Lecturer, CSE Instructor, CNAP AUST.
World Wide Web “WWW”, "Web" or "W3". World Wide Web “WWW”, "Web" or "W3"
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Fundamentals.
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.
CS 6401 The World Wide Web Outline Background Structure Protocols.
Web Server Administration Chapter 6 Configuring a Web Server.
Computer Networks with Internet Technology William Stallings Chapter 04 Modern Applications 4.1 Web Access - HTTP.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Web Server Administration Chapter 6 Configuring a Web Server.
HTTP Protocol Amanda Burrows. HTTP Protocol The HTTP protocol is used to send HTML documents through the Internet. The HTTP protocol sends the HTML documents.
Web Server Design Week 3 Old Dominion University Department of Computer Science CS 495/595 Spring 2006 Michael L. Nelson 1/23/06.
What’s Really Happening
Hypertext Transfer Protocol
Hypertext Transfer Protocol
HTTP – An overview.
Hypertext Transfer Protocol
Networking CS 3470, Section 1 Sarah Diesburg
Web Development Web Servers.
Hypertext Transfer Protocol
Hypertext Transport Protocol
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
WEB API.
Application layer Lecture 7.
HTTP Hypertext Transfer Protocol
Networking CS 3470, Section 1 Sarah Diesburg
Hypertext Transfer Protocol
HyperText Transfer Protocol
EE 122: HyperText Transfer Protocol (HTTP)
Hypertext Transfer Protocol (HTTP)
William Stallings Data and Computer Communications
The HTTP Protocol COSC 2206 Internet Tools The HTTP Protocol
APACHE WEB SERVER.
HTTP Hypertext Transfer Protocol
Presentation transcript:

LIS650 lecture 6 http and apache Thomas Krichel

today http semantic web apache introduction

http Stands for the hypertext transfer protocol. This is the most important application layer protocol on the Internet today, because it provides the foundation for the world wide web. defined in Fielding, Roy T., James Gettys, Jeffrey C. Mogul, Paul J. Leach, Tim Berners- Lee ``Hypertext Transfer Protocol -- HTTP/1.1'' (1999), RFC 2616

history 1990: version 0.9 allows for transfer of raw data. 1996: rfc1945 defines version 1.0. by adding attribute:value headers. 1999: rfc 2616 –adds support for hierarchical proxies caching, virtual hosts and some Support for persistent connections –is more stringent.

http resource identification identification of resources is assumed through Uniform Resource Identifiers (URI). As far as http is concerned, URIs are string. http can use ``absolute'' and ``relative'' URIs. A URL is a special case of a URI.

rfc about http An application-level protocol for distributed, collaborative, hypermedia information systems. … HTTP is also used as a generic protocol for communication between user agents and proxies/gateways to other Internet systems, including those supported by the SMTP, NNTP, FTP, Gopher, and WAIS protocols. In this way, HTTP allows basic hypermedia access to resources available from diverse applications.

overall operation: client side Client sends request, required items are –method –request URI –protocol version optional items are –request modifiers –client information

overall operation server side Server sends response, required items are –status line –protocol version –success or error code optional items are –server information –body

http assumes transport http assumes that there is a reliable way to transport data from one host on the Internet to another one. All http requests and responses are separate TCP connections. The default is TCP port 80, but other ports can be used.

Absolute http URL the absolute http URL is If abs_path is empty, it is /. The scheme name "http" and the host name are case- insensitive. Characters other than those in the ``reserved'' and ``unsafe'' sets of RFC 2396 are equivalent to their ``%HEX HEX'' encoding. optional components are in [ ]

character sets A character set is a method used with one of more tables to convert a sequence of binary digits into a sequence of characters. http shares the same registry as the MIME multimedia extensions. It is based at the IANA, at assignments/media-types/media-types The default character set is ISO

http messages There are two types of messages. –Requests are sent form the client to the server. –Responses are sent from the server to the client. The generic format is the same as for messages: –start line –message headers –empty line –body Empty lines before the start line are ignored. The request's start line is called the request-line. The response start line is called the status-line.

The request headers Accept:Accept-Charset: Accept-Encoding:Accept-Language: Authorization:Expect: From:Host: If-Match:If-Modified-Since: If-None-Match:If-Range: If-Unmodified-Since:Max-Forwards: Proxy-Authorization: Range: Referer:TE: User-Agent:

The status line The status line is a set of lines that are of the form HTTP-Version Status-Code Reason-Phrase The status code is a 3-digit number used by the computer. The reason line is a friendly note for a human to read.

Status code classes 1 Informational: Request received, continuing process 2 Success: The action was successfully received, understood, and accepted 3Redirection: Further action must be taken in order to complete the request 4 Client Error: The request contains bad syntax or cannot be understood 5Server error: The request is valid but can not be executed by the server

Error codes 100Continue 101Switching Protocols 200OK 201Created 202Accepted 203Non-Authoritative Information 204No Content 205Reset Content 206Partial Content

Error codes II 300Multiple Choices 301Moved Permanently 302Found 303See Other 304Not Modified 305Use Proxy 307Temporary Redirect

Error codes III 400Bad Request 401Unauthorized 402Payment Required 403Forbidden 404Not Found 405Method Not Allowed 406Not Acceptable 407Proxy Authentication Required 408Request Time-out

Error codes IV 409Conflict 410Gone 411Length Required 412Precondition Failed 413Request Entity Too Large 414Request-URI Too Large 415Unsupported Media Type 416Requested range not satisfiable 417Expectation failed

Error codes V 500Internal Server Error 501Not Implemented 502Bad Gateway 503Service Unavailable 504Gateway Time-out 505HTTP Version not supported

Response headers Accept-Ranges: Age: Etag: Location: Proxy-Authenticate: Retry-After: Server: Vary: WWW-Authenticate:

Entity headers, common to response and request Allow: Content-Encoding: Content-Language: Content-Length: Content-Location: Content-MD5: Content-Range: Content-Type: Expires: Last-Modified

The body The entity-body (if any) sent with an HTTP request or response is in a format and encoding defined by the entity-header fields. When an entity-body is included with a message, the data type of that body is determined via the header fields Content-Type and Content- Encoding

GET and HEAD method The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process. The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response.

Conditional & partial GET The semantics of the GET method change to a ``conditional GET'' if the request message includes an –If-Modified-Since –If-Unmodified-Since –If-Match –If-None-Match –If-Range header The semantics of the GET method change to a ``partial GET'' if the request message includes a Range header field. A partial GET requests that only part of the entity be transferred

The POST method The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request- Line. POST is designed to allow a uniform method to cover the following functions: –Annotation of existing resources; –Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; –Providing a block of data, such as the result of submitting a form, to a data-handling process; – Extending a database through an append operation.

PUT and DELETE methods The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity should be considered as a modified version of the one residing on the origin server. The DELETE method requests that the origin server delete the resource identified by the Request-URI.

example status: redirect If you use Apache, you can create a file.htaccess (note the dot!) with a line redirect 301 old_url new_url old_url must be a relative path from the top of your site new_url can be any URL, even outside your site This works on wotan by virtue of configuration set for apache for your home directory. Examples –redirect 301 /~krichel –redirect 301 Cantcook.jpg

The Semantic Web The W3C has been developing a new architecture that applies knowledge representation technology to the WWW. Using the Resource Description Framework (RDF), Statements are made using a Subject, Predicate and Object (very similar to Lisp and other predicate based languages). Each Subject, Predicate or Object are Resources in the URI sense and are identified by URIs within an RDF Statement using XML Namespaces.

The Semantic Web The combination of Web Services and the Semantic Web should give the Web the ability to turn any existing Web Resource into a full node in a purposefully built knowledge representation system with a functional component that allows that knowledge to be acted on. And both are based on the simple Uniform Resource Identifier.

example This statement says that the Resource identified by the URI was created by the person Thomas Krichel: Thomas Krichel

Apache Is a free, open-source web server that is produced by the Apache Software Foundation, see It has over 50% of the market share. It runs best on UN*X systems but can run an a Mickeysoft OS as well. I will cover it here because it is freely available. I am covering version 1.3

Apache in debian /etc/apache/httpd.conf in set main configuration file. /etc/init.d/apache action, where action is one of –start –stop –restart is used to fire the daemon up or down. The daemon runs user www-data

Virtual host On a single installation of apache serveral web servers can be supported. That means the server can behave in a different way according to how it is being addressed. The easiest way to implement addressing a server in different was is through DNS host names.

Directives in httpd.conf The configuration directives are grouped into three basic sections: –Directives that control the operation of the Apache server process as a whole (the 'global environment'). –Directives that define the parameters of the 'main' or 'default' server, which responds to requests that aren't handled by a virtual host. These directives also provide default values for the settings of all virtual hosts. –Settings for virtual hosts, which allow Web requests to be sent to different IP addresses or hostnames and have them handled by the same Apac he server process.

Server type On a UN*X machine, the server can either be fired up on its own, or it can be run as part of the overall Internet daemon inetd. Usually standalone is used.

Server root Sets the directory where apache finds its own configuration files. If log files names are not given as absolute paths, they will be placen in the server root directory.

Timeout This set s the number of seconds that the server waits for the result of a request to be computed before sending a timeout. On wotan this is set to 300 seconds, this is rather a long time, the user will have gone for coffee by then.

Listen Tells the server which port and ip address to listen to. This can be used to have the server only to respond to requests to a certain IP address or to listen to a non-standard port, i.e. Not port 80

Loadmodule To extend apache, modules have written. They have to be loaded explicitly: LoadModule module file Where module is the name of the module and file is the name of the file that contains the module Looking at this gives you vital information about what the server can do.

Server directives User –Gives the user name apache runs under Group –Gives the group name the server runs under ServerAdmin – of a human who runs the default server ServerName –The name of the default server DocumentRoot –The top level directory of the default server

Directory options Many options for a directory can be set with instructions Name is the name of a directory. Instructions can be a whole lot of stuff

Directory instructions Options sets global options for the directory, it can be –None –All –Or any of Indexes (form directory indexes?) Includes (all server side includes?) FollowSymlinks (allow to follow server-side includes) ExecCGI (allow cgi-scripts?) MultiViews

Access control Can be part of to set directory level access control Example –Allow from friendly.com –Deny from evil.com Sometimes you have to set the order, example –Order allow, deny

Authentication This is used to enable password access. In that case the authentication is handled by a file.htaccess in the directory. The AllowOverride instruction is used to state what the user can do within the.htaccess file. Depending on its values, you can password protect a web site. We will not discuss this further here.

Userdir This sets the directory that is created by the user in her home directory to be accessed by requests to ~user. On wotan, we have UserDir public_html That is the default, actually.

Set up permission for user home directories AllowOverride FileInfo AuthConfig Limit Options +Includes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Order allow,deny Allow from all Order deny,allow Deny from all

Logs The web server logs every transaction. The are severeal types of logs that used to be kept separately, in early days [26/Jan/2003:09:19: ] "GET /~ramon/videos/ntsc175.html HTTP/1.1" Additional information may be kept in the referer and user agent log. The referer log may have some interesting information on who links to your pages.

Virtual hosts Most apache directive can be wrapped in a grouping. This implies that the only hold for the virtual host. Example, from wotan ServerAdmin DocumentRoot /home/connect/public_html ServerName connections2003.liu.edu ErrorLog /var/log/apache/connections2003-error.log CustomLog /var/log/apache/connectios2003-access.log common

Thank you for your attention!