Chapter 24 Web Servers PWS IIS Apache Jigsaw
Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24. 1 Introduction 24. 2 Microsoft Personal Web Server Overview 24. 3 Microsoft Personal Web Server Setup 24. 4 Getting Started with Microsoft Personal Web Server 24. 5 Microsoft Internet Information Server (IIS) 24. 6 Apache Web Server 24. 7 W 3 C Jigsaw Web Server 24. 8 Web Server Error Codes 2000 Deitel & Associates, Inc. All rights reserved.
24. 1 Introduction • Network – Allows two or more computers to communicate and share resources – Any network requires servers • Manage access to files, folders, hardware and software • Web server – Network server that manages access to files, folders and other resources over Internet or local Intranet via HTTP • HTTP: Hyper. Text Transfer Protocol – Client-server protocol (like FTP) – – Handle permissions Execute programs Keep track of directories and files Communicate with client computers 2000 Deitel & Associates, Inc. All rights reserved.
A Web server communicating with several HTTP clients 2000 Deitel & Associates, Inc. All rights reserved.
Web servers discussed in this chapter 2000 Deitel & Associates, Inc. All rights reserved.
24. 2 Microsoft Personal Web Server Overview Microsoft Personal Web Server (PWS) • – – Use Internet Database Connector (IDBC), CGI and ASP Capabilities: 1. 2. 3. 4. Webs published as whole with single command Publish Web sites from local computer to remote computer, from remote computer to local computer, or between remote Web sites CGI, IDC, ASP and Microsoft Internet Server Application Programming Interface (ISAPI) programs and Front. Page Web. Bots “smart” web management – 5. 6. 7. Publish “changed pages only” option Sets permissions and properties of webs and folders Sets up virtual directories on server Browse webs from another computer when you are logged on 2000 Deitel & Associates, Inc. All rights reserved.
24. 3 Microsoft Personal Web Server Setup 1. 2. Verify presence of Microsoft TCP/IP Protocol Install PWS Software 2000 Deitel & Associates, Inc. All rights reserved.
24. 4 Getting Started with Microsoft Personal Web Server 1. Start Personal Web Server 2. Test for Successful Installation of PWS • Loopback address • • Virtual address allows testing of computer’s TCP/IP stack from same computer http: //127. 0. 0. 1 Default Web site page for PWS 2000 Deitel & Associates, Inc. All rights reserved.
24. 4 Getting Started with Microsoft Personal Web Server (II) 3. Create a Web Site on Your Own Computer – Create root web • Root web: web that is top-level content directory of Web server • By default, home directory is C: WebshareWwwroot 4. Access PWS from Other Computers – Address is http: // followed by IP address of server 5. Publish Information and Applications – Server can contain anything from static pages to interactive applications – Interact with databases 6. Prepare Information for Publishing – HTML 2000 Deitel & Associates, Inc. All rights reserved.
24. 4 Getting Started with Microsoft Personal Web Server (III) 7. Publish Dynamic Applications – Run applications or scripts • • Remote users start by clicking HTML links or forms Perl, C CGI (Common Gateway Interface) ISAPI – Dynamic Link Libraries (DLLs) – Require less overhead than CGI scripts – Microsoft-specific technology – Place scripts in /Scripts directory – Adjust permissions 2000 Deitel & Associates, Inc. All rights reserved.
24. 4 Getting Started with Microsoft Personal Web Server (IV) • PWS extension interpreters (Windows 95/98) • Personal Web Manager dialog 2000 Deitel & Associates, Inc. All rights reserved.
24. 4 Getting Started with Microsoft Personal Web Server (V) 8. Publish information and use a database – Open Data Base Connectivity (ODBC) drivers • Allow inserts, updates and deletes of info in database – Structured Query Language (SQL) commands – Internet Database Connector (IDC) component of PWS, Httpodbc. dll • Internet Database Connector (. idc) files • HTML extension (. htx) files – Template for actual HTML document returned to browser after database info merged by Httpodbc. dll 2000 Deitel & Associates, Inc. All rights reserved.
24. 4 Getting Started with Microsoft Personal Web Server (V) 8. Publish information and use a database – Create system DSN (Data Source Name) – http: //127. 0. 0. 1/customers. idc? • Question mark tells server request can take parameters 2000 Deitel & Associates, Inc. All rights reserved.
1 Datasource: NWIND 2 Template: Customers. htx 3 SQLStatement: SELECT * FROM [Customers] 4 Password: 5 Username: 2000 Deitel & Associates, Inc. All rights reserved. Outline customers. idc file
1<!DOCTYPE html PUBLIC "-//W 3 C//DTD HTML 4. 0 Transitional//EN" > 2<HTML> 3<HEAD> 4<META HTTP-EQUIV = "Content-Type" 5 CONTENT = "text/html; charset = windows-1252" > 6<TITLE>Customers</TITLE> 7</HEAD> 8<BODY> 9<TABLE BORDER = 1 BGCOLOR = #ffffff CELLSPACING = 0 RULES = none> 10<FONT FACE = "MS Sans Serif" COLOR = #000000><CAPTION> 11<B>Customers</B></CAPTION> 12 13<THEAD> 14<TR> 15<TH BGCOLOR = #c 0 c 0 c 0 BORDERCOLOR = #000000><FONT SIZE = 2 16 FACE = "MS Sans Serif" COLOR = #000000>Customer. ID</FONT></TH> 17<TH BGCOLOR = #c 0 c 0 c 0 BORDERCOLOR = #000000><FONT SIZE = 2 18 FACE = "MS Sans Serif" COLOR = #000000>Company. Name</FONT></TH> 19<TH BGCOLOR = #c 0 c 0 c 0 BORDERCOLOR = #000000><FONT SIZE = 2 20 FACE = "MS Sans Serif" COLOR = #000000>Contact. Name</FONT></TH> 21<TH BGCOLOR = #c 0 c 0 c 0 BORDERCOLOR = #000000><FONT SIZE = 2 22 FACE = "MS Sans Serif" COLOR = #000000>Contact. Title</FONT></TH> 23<TH BGCOLOR = #c 0 c 0 c 0 BORDERCOLOR = #000000><FONT SIZE = 2 24 FACE = "MS Sans Serif" COLOR = #000000>Address</FONT></TH> 25<TH BGCOLOR = #c 0 c 0 c 0 BORDERCOLOR = #000000><FONT SIZE = 2 26 FACE = "MS Sans Serif" COLOR = #000000>City</FONT></TH> 27<TH BGCOLOR = #c 0 c 0 c 0 BORDERCOLOR = #000000><FONT SIZE = 2 28 FACE = "MS Sans Serif" COLOR = #000000>Region</FONT></TH> 29<TH BGCOLOR = #c 0 c 0 c 0 BORDERCOLOR = #000000><FONT SIZE = 2 30 FACE = "MS Sans Serif" COLOR = #000000>Postal. Code</FONT></TH> 2000 BGCOLOR Deitel & Associates, Inc. All rights reserved. = #000000><FONT SIZE = 2 31<TH = #c 0 c 0 c 0 BORDERCOLOR Outline 1. Create HTML template for actual document that will be returned to browser
32 FACE = "MS Sans Serif" COLOR = #000000>Country</FONT></TH> 33<TH BGCOLOR = #c 0 c 0 c 0 BORDERCOLOR = #000000><FONT SIZE = 2 34 FACE = "MS Sans Serif" COLOR = #000000>Phone</FONT></TH> 35<TH BGCOLOR = #c 0 c 0 c 0 BORDERCOLOR = #000000><FONT SIZE = 2 36 FACE = "MS Sans Serif" COLOR = #000000>Fax</FONT></TH> 37 38</TR> 39</THEAD> 40<TBODY> 41<%Begin. Detail%> 42<TR VALIGN = TOP> 43<TD BORDERCOLOR = #808080><FONT SIZE = 1 FACE = "MS Sans Serif" 44 COLOR = #800000><%Customer. ID%><BR></FONT></TD> 45<TD BORDERCOLOR = #808080><FONT SIZE = 1 46 FACE = "MS Sans Serif" COLOR = #800000><%Company. Name%><BR> 47</FONT></TD> 48<TD BORDERCOLOR = #808080><FONT SIZE = 1 49 FACE = "MS Sans Serif" COLOR = #800000><%Contact. Name%><BR> 50</FONT></TD> 51<TD BORDERCOLOR = #808080><FONT SIZE = 1 52 FACE = "MS Sans Serif" 53 COLOR = #800000><%Contact. Title%><BR></FONT></TD> 54<TD BORDERCOLOR = #808080><FONT SIZE = 1 55 FACE = "MS Sans Serif" COLOR = #800000><%Address%><BR> 56</FONT></TD> 57<TD BORDERCOLOR = #808080><FONT SIZE = 1 58 FACE = "MS Sans Serif" COLOR = #800000><%City%><BR> 59</FONT></TD> 60<TD BORDERCOLOR = #808080><FONT SIZE = 1 61 FACE = "MS Sans Serif" COLOR = #800000><%Region%><BR> 2000 Deitel & Associates, Inc. All rights reserved. 62</FONT></TD> Outline Notice placeholders for database fields
63<TD BORDERCOLOR = #808080><FONT SIZE = 1 64 FACE = "MS Sans Serif" COLOR = #800000><%Postal. Code%><BR> 65</FONT></TD> 66<TD BORDERCOLOR = #808080><FONT SIZE = 1 67 FACE = "MS Sans Serif" COLOR = #800000><%Country%><BR> 68</FONT></TD> 69<TD BORDERCOLOR = #808080><FONT SIZE = 1 70 FACE = "MS Sans Serif" COLOR = #800000><%Phone%><BR> 71</FONT></TD> 72<TD BORDERCOLOR = #808080><FONT SIZE = 1 73 FACE = "MS Sans Serif" COLOR = #800000><%Fax%><BR> 74</FONT></TD> 75 76</TR> 77<%End. Detail%> 78</TBODY> 79<TFOOT></TFOOT> 80</TABLE> 81</BODY> 82</HTML> 2000 Deitel & Associates, Inc. All rights reserved. Outline
customers. idc as requested and displayed in a Web browser 2000 Deitel & Associates, Inc. All rights reserved.
24. 5 Microsoft Internet Information Server (IIS) • Internet Information Server (IIS) – – – Extends Windows NT server to Intranets and Internet Provides full Intranet and Internet Web capabilities Publish information Access to data stored in various client/server databases Supports CGI • CGI creates separate process for every request • Microsoft alternative: ISAPI – Back-end database access and programming • IDC connects to back-end ODBC databases – Insert, update, delete, etc. • Internet Service Manager – GUI manager 2000 Deitel & Associates, Inc. All rights reserved.
24. 6 Apache Web Server • Apache – Leading UNIX Web server – High-performance httpd (HTTP daemon) server • Daemon: UNIX background process that implements server side of a protocol – Server-side programming tools and languages: • Perl • PHP 3 – Scripting language that allows embedding scripting code into HTML pages • Tcl • Python – Access to Java Servlet API – JSP (Java. Server Pages) • Embed java code within HTML templates dynamic pages processed entirely by server 2000 Deitel & Associates, Inc. All rights reserved.
24. 6 Apache Web Server (II) – Modules provide additional functionality • http: //modules. apache. org/ • mod_SSL – Strong cryptography for Apache 1. 3 Web server via Secure Sockets Layer • mod_perl – Modules can be written entirely in Perl • Jserv – Module that implements Sun’s Java Servlet API – On Windows NT • Apache Web server run as console application or service – Console application: stopping and starting server is manual – Service: Apache starts whenever operating system starts 2000 Deitel & Associates, Inc. All rights reserved.
24. 6 Apache Web Server (III) • Starting the Apache Web Server as a console application • Default Web site for Apache Web Server 2000 Deitel & Associates, Inc. All rights reserved.
24. 7 W 3 C Jigsaw Web Server • W 3 C Jigsaw – Free Web server written entirely in Java – Runs on most machines that support Java • Microsoft Windows 95/98/NT • Sun Microsystems’ Solaris • Linux – Object-oriented Web server – Major components: • Daemon module – – – Deals with HTTP Handles incoming connections Creates new client objects Decodes requests Sends replies • Resource module – Manages information space of server 2000 Deitel & Associates, Inc. All rights reserved.
Jigsaw batch installation process 2000 Deitel & Associates, Inc. All rights reserved.
Default Web site page for the Jigsaw Web server 2000 Deitel & Associates, Inc. All rights reserved.
Jig. Admin authorization dialog and general properties page 2000 Deitel & Associates, Inc. All rights reserved.
Jig. Admin Web configuration page 2000 Deitel & Associates, Inc. All rights reserved.
24. 8 Web Server Error Codes • W 3 C’s HTTP specification – Identifies specific errors that can be returned in Web server’s response to HTTP requests – All HTTP-compliant Web servers support these as well as HTTP status codes – Common numeric error status codes: 2000 Deitel & Associates, Inc. All rights reserved.
- Slides: 27