server by athan1925



More Info
Chapter 21 – Web Servers
(IIS and Apache)
21.1      Introduction
21.2      HTTP Request Types
21.3      System Architecture
21.4      Client-Side Scripting versus Server-Side Scripting
21.5      Accessing Web Servers
21.6      Microsoft Internet Information Services (IIS)
          21.6.1 Microsoft Internet Information Services (IIS) 5.0
          21.6.2 Microsoft Internet Information Services (IIS) 6.0
21.7      Apache Web Server
21.8      Requesting Documents
          21.8.1 XHTML
          21.8.2 ASP.NET
          21.8.3 Perl
          21.8.4 PHP
          21.8.5 Python
21.9      Web Resources
 In this lesson, you will learn:
    To understand a Web server’s functionality.
    To introduce Apache Web server.
    To learn how to request documents from a Web server.

21.1 Introduction
 Web server
   Responds to client requests by providing resources
 URI (Uniform Resource Identifier)
 Web server and client communicate with platform-
  independent Hypertext Transfer Protocol (HTTP)

21.1 Introduction
               IIS 5.0          IIS 6.0              Apache Web server
Company        Microsoft        Microsoft            Apache Software
               Corporation      Corporation          Foundation
Version        5.0              6.0                  2.0.47
Released       2/17/00          3/28/03              7/10/03
Platforms      Windows 2000,    Windows Server 2003  Windows NT/2000/XP,
               Windows XP                            Mac OS X, Linux and
                                                     other UNIX-based
                                                     experimentally supports
                                                     Windows 95/98
Brief         The most popular The newest release of Currently the most
description   Web server for   IIS from Microsoft.   popular Web server.
              Windows 2000.
Price         Included with    Included with         Freeware.
              Windows 2000     Windows Server 2003
              and Windows
Fig. 21.1 Web servers discussed in this chapter.                               5
How the WWW Works

Domain Name
Server System

   (Fitzgerald and Dennis, 2005 Figure 5.8)

           Example of an HTTP Request from
           a Web browser
 Command                 URL                     HTTP version

GET HTTP/1.1 ]- Request
Date: Mon 06 Aug 2001 17:35:46 GMT                               Line
User-Agent: Mozilla/6.0 ]- Web browser (this is Netscape)
Referer:      Request Header

   URL that contained the link to the requested URL

                 HTTP response from a Web server
HTTP version   Status code   Reason
HTTP/1.1 200          OK ]- Response Status
Date: Mon 06 Aug 2001 17:35:46 GMT ]- Date
Server: NCSA/1.3 ]- Web server                                             Response
Location: http:// ]- URL
Content-type: text/html ]- Type of file
<title>Jonathan Web Server </title>
<body>                                                                    Response
<H2> Jonathan</H2>                                                        Body
<P>Welcome to the Home Page of Jonathan Dela Cruz</P>

                                      (Fitzgerald and Dennis, 2005 Figure 2-10)
21.2 HTTP Request Types
 GET (default) and POST do basically the same thing: Send
  data from the client to the server. However, they have some
    Appends form data directly to the end of the URL—visible to users
     (not suitable for sending passwords)
    Limited to 2,048 characters for the entire URL
    Result page can be bookmarked and cached
    Sends form data in the HTTP request—invisible to users
    Virtually no limit (but check your specific configuration)
    Results are not cacheable or bookmarkable

21.3 System Architecture
 Multi-tier application (n-tier application)
   Information tier (data or bottom tier)
     Maintains data for the application
     Stores data in a relational database management system
   Middle tier
     Implements business logic and presentation logic
     Control interactions between application clients and application
   Client tier (top tier)
     Application’s user interface
     Users interact directly with the application through the client tier

N-tier Client-Server Architecture

              (Fitzgerald and Dennis, 2005 Figure 2.5)
21.4 Client-Side Scripting versus Server-Side
 Client-side scripts
   Validate user input
     Reduce requests needed to be passed to server
     Access browser
     Enhance Web pages with DHTML, ActiveX controls, and applets

 Server-side scripts
   Executed on server
   Generate custom response for clients
   Wide range of programmatic capabilities
   Access to server-side software that extends server
Hosting a website:
Self hosting
 Install a web server on a computer
 Local access
   Using domain <localhost>
   or IP address
   Necessary for server-side programming development
 Global access
   Register a human-readable domain name
   Obtain IP address
     Static: Costs more
     Dynamic: Needs dynamic DNS system, e.g.
Hosting a website:
Hosting service
 Register a domain name
    Assign name servers
    Host takes care of IP addressing
 Develop website locally
 Upload website via FTP for global access
    E.g. Filezilla

Web server architecture
 LAMP: Most popular—fully open source
     Linux for operating system
     Apache for web server
     MySQL for database
     PHP for server-side scripting
 Others:
   WAMP: Uses Windows for operating system, with Apache,
    MySQL, and PHP
   WISA: Full Microsoft package
         Windows
         Internet Information Server (IIS)
         SQL Server (enterprise) or Access (small-scale)
         ASP or ASP.NET

21.7 Apache Web Server
 Currently the most popular Web server
 Stability
 Efficiency
 Portability
 Open-source

All-in-one Apache/MySQL/PHP packages
 EasyPHP (recommended)
    Includes PHPMyAdmin for administering MySQL
    Installation and configuration
 AbriaSoft Merlin Desktop Edition
    Includes PHPMyAdmin
 WAMP Server
 PHP Triad

Installing EasyPHP
 Download EasyPHP, and follow the installation instructions
 In addition, move the <mysql> and <phpmyadmin> folders into
  the <www> folder in the EasyPHP installation folder
 For Windows 95, make the following adjustments before starting
    Download the Windows NT patch, rename it to EasyPHP.exe, and
     replace the existing EasyPHP.exe
    Open DOS prompt, go to the EasyPHP installation folder, and run
     <easyphp /install>
 Run EasyPHP in Windows, and it will start Apache and MySQL
  (PHP and PHPMyAdmin do not need to “start”)
    Note that Windows 95 might show that Apache is not working, though
     actually it is working

Requesting XHTML or PHP documents
 Request PHP documents from Apache
 Save PHP documents in the www folder for
  EasyPHP (htdocs is the default Apache folder
 Launch web browser
   With EasyPHP, right-click on the status bar icon and
    click “Local Web”
 Enter PHP document’s location in Address field,
  starting with http://localhost/ or

21.8.1 XHTML and PHP

      Fig. 21.15     Requesting test.html from IIS 6 or Apache.

        Fig. 21.23     Requesting test.php from Apache.

21.9 Web Resources


To top