Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Pertemuan 4 HTTP Protocol Matakuliah: T0053/Web Programming Tahun: 2006 Versi: 2.

Similar presentations


Presentation on theme: "1 Pertemuan 4 HTTP Protocol Matakuliah: T0053/Web Programming Tahun: 2006 Versi: 2."— Presentation transcript:

1 1 Pertemuan 4 HTTP Protocol Matakuliah: T0053/Web Programming Tahun: 2006 Versi: 2

2 2 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : Menjelaskan konsep Web Protocol Menggunakan web server standar

3 3 Outline Materi Web Fundamentals Web protocol Web server

4 4 Web Fundamental Web browsers and servers –Internet is “just” a set of loosely interconnected networks –A set of local area networks connected via wide area networks –No centralized control or management –Network segments interconnect via routers –Routers are dedicated computers that manage packets of data –TCP/IP is the universal data protocol on the network –Actual format, content is left to higher-level protocols, like the Web (HTTP)

5 5 Web Server What is a web server? –Program that responds to requests for documents "http daemon" –Uses the Hypertext Transfer Protocol (HTTP) to communicate –Physical machine which runs the program

6 6 Definition Daemon – UNIX speak –A program that is not invoked explicitly, but lies dormant waiting for some condition(s) to occur –The “httpd daemon” is an http server process

7 7 Web Server Basic Duties –Listen to a port –When a client is connected, read the HTTP request –Perform some lookup function –Send HTTP response and the requested data

8 8 Serving a Page User of client machine types in a URL

9 9 Serving a Page Server name is translated to an IP address via DNS http://www.smallco.com/index.html 192.22.107.5 (Netscape) server (Apache) client

10 10 Serving a Page Client connects to server using IP address and port number

11 11 Serving a Page Client determines path and file to request

12 12 Serving a Page Client sends HTTP request to server

13 13 Serving a Page Server determines which file to send

14 14 Serving a Page Server sends response code and the document

15 15 Serving a Page Connection is broken

16 16 HTTP Protocol Definitions HTTP is… –Designed for document transfer –Generic not tied to web browsers exclusively can serve any data type –Stateless no persistant client/server connection

17 17 IP Address import java.net.*; class CobaInetAddress { public static void main (String args[]) { try { InetAddress a= InetAddress.getLocalHost(); System.out.println ("Nama Komputer dan IP ialah :" + a); System.out.println ("Alamat host ialah " + a.getHostAddress()); System.out.println ("Nama host ialah " + a.getHostName()); } catch (UnknownHostException u) { System.out.println ("Error " + u); }}}

18 18 Display NIC import java.io.*; import java.net.*; import java.util.*; public class DisplayNIC { public static void main (String argv[]) throws Exception { //Menggunakan method getNetworkInterface() Enumeration e= NetworkInterface.getNetworkInterfaces(); //Perulangan untuk mengambil info NIC while (e.hasMoreElements()) { NetworkInterface n = (NetworkInterface) e.nextElement(); System.out.println ("NIC :" + n.getName()); //Ambil semua info NIC Enumeration e1= n.getInetAddresses(); while (e1.hasMoreElements ()) { InetAddress i =(InetAddress) e1.nextElement(); System.out.println ("Alamat IP :" + i.toString()); }}}} NIC : lan0 Alamat IP : /192.168.0.55 NIC : lo0 Alamat IP :/127.0.0.1

19 19 References Internet & WWW How to Program, Deitel & Deitel “Fundamental Web Design Principles”, http://ausweb.scu.edu.au/aw99/papers/turner/paper.html http://ausweb.scu.edu.au/aw99/papers/turner/paper.html Widodo Budiharto, “Panduan Lengkap Pemrograman J2EE”, Andi Offset Yogyakarta 2006 “Introduction to Web Programming 4 days”: http://www.wdvl.com/Authoring/Scripting/Tutorial http://www.wdvl.com/Authoring/Scripting/Tutorial Introduction to Web Design 3 days: http://www.wdvl.com/Authoring/HTML/Tutorial/index.html http://www.wdvl.com/Authoring/HTML/Tutorial/index.html www.widodo.com http://www.w3schools.com


Download ppt "1 Pertemuan 4 HTTP Protocol Matakuliah: T0053/Web Programming Tahun: 2006 Versi: 2."

Similar presentations


Ads by Google