Download presentation
Presentation is loading. Please wait.
Published byAlisha Campbell Modified over 9 years ago
1
WEB SERVER Mark Kimmet Shana Blair
2
The Project Web Server Application Receives request for web pages or images from a client browser via the internet Generates and sends a response to the client IP address Retains information on the transaction in a log file Process-Driven Server Architecture Each request creates its own process The process performs all necessary actions Allows for multiple simultaneous requests to be processed
3
The Solution 1. Read and parse the HTTP request message 2. Translate the URL to a file name 3. Generate and transmit the response 4. Insert request information into log file
4
1. Read and Parse Request Receive request header from internet client GET/index.htmlHTTP/1.1 Host: www.nd.edu Date: 22 Jan 2002 05:04:03 GMT User-Agent: Mozilla/4.7 Accept: text/html Accept: image/gif /*blank line*/www.nd.edu Parse request header into attributes of a header class
5
2. Translate URL to a file name Takes the URL and converts it into the local path name on the server URL requested: /mydir/index.html Translated to: C:\wwwroot\mydir\index.html
6
3. Generate and Transmit Response Validate that the requested path is located in the shared directory Determine whether file exists Build response header HTTP/1.1200OK Date: Mon 21 Jan 2002 6:55:46 GMT Server: NCSA/1.3 Location: http://www.nd.edu/index.html Content-type: text/html Content-length: 67 /* blank line */http://www.nd.edu/index.html Send response and file to client IP address
7
Response Codes 200 – Request succeeded 400 – Bad request 401 – Unauthorized request 404 – File not found 500 – Internal server error Content Types text/html – html file text/plain – plain text file image/gif – gif image file image/jpeg – jpg image file
8
4. Log File Insert the following information into a comma- delimited file for later access and analysis: Date/Time Client IP address File name requested Response code Example: 12/10/2002 10:53:02, 129.74.25.45, /index.html, 200 12/10/2002 12:20:05, 129.74.25.45, /logo.jpg, 200 12/11/2002 15:20:05, 129.74.66.77, /admin/badfile.txt, 404
9
Results A web server that receives requests and sends out web pages and images to the client browser over the internet Extras to be implemented: Allow user to set port number to listen on Allow user to set root directory from which to serve web pages Validation of acceptable file request
10
Team Member Input Shana Creation and parsing of request header Mark Retrieving file and generating response header Together Structure of web server Integration of individual contributions to complete each web request process
11
Future Work Allow form inputs and processing Virtual directories Allow more content types Video Waves Security Password-protected directories Limiting access based on user rights
12
References Books Java Network Programming by Merlin Hughes TCP/IP Illustrated, Volume 3 by W. Richard Stevens Web Protocols and Practice by Jennifer Rexford Web W3C’s HTTP Definition http://www.w3.org/Protocols/HTTP/HTTP2.html Microsoft’s HTTP Revealed (a HTTP Primer) http://www.microsoft.com/mind/0796/protocol/protocol.asp Existing Code Practical Sockets by Baylor University CSE Dept http://cs.ecs.baylor.edu/~donahoo/practical/CSockets/practical/
13
Demo time!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.