Programming project #4 1 CS502 Spring 2006 Programming Project #4 Web Server CS-502 Operating Systems Spring 2006.

Slides:



Advertisements
Similar presentations
Programming project #2 1 CS502 Spring 2006 Programming Project #2 CS-502 Operating Systems Spring 2006.
Advertisements

1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Sockets For Servers Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
COEN 445 Communication Networks and Protocols Lab 4
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
1 Java Networking – Part I CS , Spring 2008/9.
Programming Assignment #6 CS-2301 D-term Programming Assignment #6 Binary Trees CS-2301 System Programming D-term 2009 (Slides include materials.
CSCI 4550/8556 Computer Networks Comer, Chapter 3: Network Programming and Applications.
CS-502 Fall 2006Project 1, Fork1 Programming Project 1 – Fork.
Programming project #2 1 CS502 Spring 2006 Programming Project #3 Page Replacement Algorithms CS-502 Operating Systems Spring 2006.
Project 1CS-3013 A-term Programming Project #1 Forking Processes Due Tuesday, September 8, 11:59 PM.
CS 311 – Lecture 18 Outline IPC via Sockets – Server side socket() bind() accept() listen() – Client side connect() Lecture 181CS Operating Systems.
Programming Project #3CS-4513, D-Term Programming Project #3 Simple Web Server CS-4513 D-Term 2007 (Slides include materials from Operating System.
RPC Project Using either sockets or TLI, implement Remote Procedure Calls between two distinct machines that are communicating over an Ethernet network.
CSE451 Section 6: Spring 2006 Web server & preemption.
Definitions, Definitions, Definitions Lead to Understanding.
CS-3013 & CS-502, Summer 2006 Network Input & Output1 CS-3013 & CS-502, Summer 2006.
Guide to Linux Installation and Administration, 2e1 Chapter 12 Printing in Linux.
CS-3103 & CS-502, Summer 2006 Programming Project #31 Programming Project #3 Web Server CS-3103 & CS-502 Operating Systems.
Programming project #1 1 CS502 Spring 2006 Programming Project #1 CS-502 Operating Systems Spring 2006.
Networking with Java. Basic Concepts A Network exists when two or more computers are connected such that they can communicate data back and forth. There.
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
TCP Sockets Reliable Communication. TCP As mentioned before, TCP sits on top of other layers (IP, hardware) and implements Reliability In-order delivery.
19-Aug-15 About the Chat program. 2 Constraints You can't have two programs (or two copies of the same program) listen to the same port on the same machine.
Server Design Discuss Design issues for Servers Review Server Creation in Linux.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
Agenda  Terminal Handling in Unix File Descriptors Opening/Assigning & Closing Sockets Types of Sockets – Internal(Local) vs. Network(Internet) Programming.
Project 2 Data Communication Spring 2010, ICE Stephen Kim, Ph.D.
Distributed Computing Systems Project 2 – Distributed Shell Due: Friday, April 4 th.
FTP (File Transfer Protocol) & Telnet
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
ASHIMA KALRA IMPORTANT TERMS.  WWW WWW  URL URL  HTTP PROTOCOL HTTP PROTOCOL  PROXIES PROXIES.
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.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
HOW WEB SERVER WORKS? By- PUSHPENDU MONDAL RAJAT CHAUHAN RAHUL YADAV RANJIT MEENA RAHUL TYAGI.
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
SUSE Linux Enterprise Desktop Administration Chapter 12 Administer Printing.
Server Sockets: A server socket listens on a given port Many different clients may be connecting to that port Ideally, you would like a separate file descriptor.
Web Server Administration Web Services XML SOAP. Overview What are web services and what do they do? What is XML? What is SOAP? How are they all connected?
Operating Systems Recitation 9, May 19-20, Iterative server Handle one connection request at a time. Connection requests stored in queue associated.
REVIEW On Friday we explored Client-Server Applications with Sockets. Servers must create a ServerSocket object on a specific Port #. They then can wait.
Inetd...Server of Servers Looks at a number of ports Determines when a service is needed on any of those ports Calls the appropriate server Restarts new.

CS 241 Section (04/19/12). MP8  Web Server  Due: Tuesday, May 1 st, 11:59pm  What will you be doing?  Creating a web-server in C that serves HTML.
Sockets Sockets A socket is an object that encapsulates a TCP/IP connection There is a socket on both ends of a connection, the client side and the server.
ECEN “Internet Protocols and Modeling”, Spring 2012 Course Materials: Papers, Reference Texts: Bertsekas/Gallager, Stuber, Stallings, etc Class.
Intro to Socket Programming CS 360. Page 2 CS 360, WSU Vancouver Two views: Server vs. Client Servers LISTEN for a connection and respond when one is.
Class03 Introduction to Web Development (Hierarchy and the IDE) MIS 3501, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University.
Mandatory Assignment INF3190. Part 1: Client-server communication via TCP Develop a client-server application in C which allows a client to send UNIX.
COMP2322 Lab 4 Socket Programming Toby Lam March 2, 2016.
CLIENT (Browser) socket accept C1 C2 recv C2 recv send C2 send end_thread recv C3 send bind connect Web Server Proxy recv close C3 close C2 end_thread.
Network Programming. These days almost all devices.
A Web Based Job Submission System for a Physics Computing Cluster David Jones IOP Particle Physics 2004 Birmingham 1.
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.
COMP2322 Lab 4 Socket Programming
Data Virtualization Tutorial… SSL with CIS Web Data Sources
Tiny http client and server
Sockets and Beginning Network Programming
Computing with C# and the .NET Framework
CH5 TCP Client - Server Example:
CS-3013 & CS-502 Operating Systems Summer 2006
Recitation 12: ProxyLab Part 1
Simple Socket Client Project 1.
Configuring Internet-related services
Programming Project #1 Command Shell
Programming Project #1 Fork and Command Shell
Server-side Programming CSE 333 Summer 2018
Project 1 Professor Breecher
Presentation transcript:

Programming project #4 1 CS502 Spring 2006 Programming Project #4 Web Server CS-502 Operating Systems Spring 2006

Programming project #4 2 CS502 Spring 2006 Programming Assignment 1.Build a simple but real web server using sockets; also build a simple web client for testing your server 2.Make your server fork a process for each new request 3.Make your server spawn a new thread for each request

Programming project #4 3 CS502 Spring 2006 Purpose To gain some insight into sockets and communication over networks.

Programming project #4 4 CS502 Spring 2006 Part 1 – Web Server Create a socket() and bind() it to a port. listen() on that port for requests Wait for requests; upon receipt of a request –accept() the request –Interpret the HTTP request –Find and deliver the page; or return an error –Close the accepted request –Loop back and wait for another request Figure out a way of exiting from the server cleanly.

Programming project #4 5 CS502 Spring 2006 Part 1 – Web Server (continued) Command line:- % server [optional port #] Directory is prefixed to every request. –WPI directory for web pages is /www/docs Port is port number for your server –You may specify a default port in your code, but don’t choose one to conflict with another student! –Warning: Unix does not let you reuse ports until after a reasonable waiting period (30 seconds?) A request to your server of means return the file at /www/docs/admissions.html on port #4242

Programming project #4 6 CS502 Spring 2006 Class discussion next week Review experience with using sockets to actually do something. Discuss how to exit server program cleanly.

Programming project #4 7 CS502 Spring 2006 Part 1 – Web Client Simple test program that requests web pages and prints out their contents. Use to see what your server is doing. Use to see what another server is actually serving when you request the same pages.

Programming project #4 8 CS502 Spring 2006 HTTP commands Your server must interpret HTTP GET command See written project description for examples All command lines must end with CR/LF –i.e., in Unix \r\n Series of HTTP commands ends with blank line –i.e., a stand alone \r\n

Programming project #4 9 CS502 Spring 2006 HTTP Response Once you accept a command and have found the page, respond with HTTP success response 200 –See written project description –Be sure to follow with a blank line If you cannot find or read the page, respond with HTTP error response 404 You only need to serve real file pages. –Ignore scripts, etc. WPI’s home page is a script. –Remember: some pages are not all text!

Programming project #4 10 CS502 Spring 2006 Sample code See Includes sockserver.c sockclient.c sockreadline.c

Programming project #4 11 CS502 Spring 2006 Part 2 – Multi-process Web Server Modify your web server to fork() a process each time it receives a request. This allows it to serve multiple requests in parallel. Test with multiple web clients or browsers in parallel. Be sure to clean up “zombie” processes on the fly –Use wait3() Be sure that your server leaves time for each process to finish before exiting cleanly.

Programming project #4 12 CS502 Spring 2006 Part 3 – Threaded Web Server Modify your web server to spawn a thread each time it receives a request. This also allows it to serve multiple requests in parallel. Test with multiple web clients or browsers in parallel. Be sure to threads exit cleanly after finishing with each connection. Be sure that your server leaves time for each thread to finish before exiting cleanly.

Programming project #4 13 CS502 Spring 2006 Project Submission Project due at start of class on April 17 (i.e., one week before the last class of the term) Submit via turnin command = ‘ /cs/bin/turnin ’ on CCC machines classname = ‘ cs502 ’ assignment = ‘ project4 ’ Include Code, makefiles, test files or input, test output