Transcript chap05

Chapter 5
WEB SERVERS
Database-Driven Web Sites, Second Edition
1
Objectives
In this chapter, you will:
• Learn about Internet Information Services
• Become familiar with the components of a Web
server, and specify the Web server's home
directory and default document
• Create and configure Web server physical
directories, virtual directories, and applications
Database-Driven Web Sites, Second Edition
2
Objectives
In this chapter, you will:
• Learn how to organize a Web server
• Learn how to reference files on a Web server
• Understand the factors that impact Web site
performance
Database-Driven Web Sites, Second Edition
3
Web Servers
• Web servers: computers that are connected to
the Internet and run Web server software
• A personal Web server: allows only a limited
number of user connections
• A production Web server: available to anyone
who connects to the Internet
Database-Driven Web Sites, Second Edition
4
Internet Information Services
• Internet Information Services (IIS)
– Web server software that comes with Windows NT,
Windows 2000, and Windows XP
– Includes an administration utility to create,
manage, and administer a Web server
• A Web server is also called a Web site
Database-Driven Web Sites, Second Edition
5
Internet Information Services
• IIS administrative utility: performs Web server
administrative tasks within IIS
• In Windows XP, the administrative utility is part of
Internet Information Services
• IIS: the Web server software
• IIS console: the administrative utility within IIS
Database-Driven Web Sites, Second Edition
6
Internet Information Services
• Console: an environment for administering a
computer resource
• Microsoft Management Console (MMC): an
environment for administering computer
resources
• Snap-ins: Network administrators create custom
consoles, which are components for computer
management tasks that can be “snapped into” a
generic console as needed
Database-Driven Web Sites, Second Edition
7
Internet Information Services
• IIS console: a custom console containing the Internet
Information Services snap-in, which includes components
for administering Web servers
• Figure 5-1 shows the IIS console
Database-Driven Web Sites, Second Edition
8
Web Server Components
• Home directory: directory on the Web server that
is the starting point for accessing the Web pages,
graphic image files, programs, and other files that
are available from the Web site
• Console tree: displays the components within a
Web server’s home directory as physical
directories, virtual directories, and applications
Database-Driven Web Sites, Second Edition
9
Web Server Components
• Physical directories: created within the Web
server’s home directory, or within directories that
the Web administrator associates with other Web
server components
• Virtual directories: may or may not be physically
within the Web server’s home directory, but
appear to client browsers as though they are
• Applications: virtual directories that have the
permissions necessary to run server-side
executable programs and scripts
Database-Driven Web Sites, Second Edition
10
Web Server Components
• To administer a Web server, a Web administrator
must
– Designate and configure the Web server’s home
directory and default document
– Create and configure the Web server’s physical
directories, virtual directories, and applications
• Many Web server configuration tasks are
performed using the Web Site Properties dialog
box in the IIS console
Database-Driven Web Sites, Second Edition
11
The Web Site Properties Page
• The Web Site
properties page is
used to configure the
properties that identify
the Web site, such as
its IP address, port,
connection timeout
value, and the active
log format
Database-Driven Web Sites, Second Edition
12
The Home Directory Properties Page
• The home
directory for a
Web server is
specified on the
Home Directory
properties page
Database-Driven Web Sites, Second Edition
13
The Home Directory Properties Page
• The first three option buttons on the Home Directory
properties page specify whether the Web site displays
documents from:
– A directory located on this computer
– A share located on another computer
– A redirection to a URL
• Local Path field: specifies the path to the home directory
• The remaining properties on the Home Directory properties
page specify permissions that the system grants to users
who connect to the Web site in the home directory
Database-Driven Web Sites, Second Edition
14
The Home Directory Properties Page
• Today, most computers are connected to
networks
• Network share:
– makes computer files available to other users on a
network
– a drive or directory that network administrators
configure so that users can view and manipulate
its files and subdirectories from other network
computers
Database-Driven Web Sites, Second Edition
15
The Documents Properties Page
• When a user enters a URL that contains a Web
server domain name or IP address but no HTML
Web page filename in the Address field on his or
her Web browser, the Web server returns its
default document, if one exists
• The default document filename is specified on the
Documents properties page in the Properties
dialog box
Database-Driven Web Sites, Second Edition
16
The Documents Properties Page
• On this page, the Enable Default Document check box
is used to enable or disable the default document
Database-Driven Web Sites, Second Edition
17
Creating and Configuring Web Server
Components
• In the IIS console tree, the nodes under the Web
server represent physical directories, virtual
directories, and applications
Database-Driven Web Sites, Second Edition
18
Physical Directories
• Physical directories: enable the Web administrator to
– Organize the contents of the local Web site
– Control access privileges for files and applications
• Physical directory exists:
– Within the Web server’s home directory
– Within a directory associated with a virtual directory
– Within a directory associated with an application
Database-Driven Web Sites, Second Edition
19
Physical Directories
• To access files that are in a physical directory on
the Web server’s home directory, a user can enter
the URL for a Web server, a front slash (/), the
name of the physical directory, another front
slash, and the filename
Database-Driven Web Sites, Second Edition
20
Physical Directories
•
To control and manage physical directories, Web administrators
can specify properties for each physical directory using a
Properties dialog box
Database-Driven Web Sites, Second Edition
21
Virtual Directories
• Virtual directory
– Appears to client browsers as a physical directory
within the home directory
– Can be associated with a physical directory that is
located anywhere in the Web server’s file system,
on a network share, or using a redirection to a URL
that references a directory on another Web server
Database-Driven Web Sites, Second Edition
22
Virtual Directories
• Virtual directory:
– Can enable users to access Web pages and other
files stored in directories outside the home
directory and its subdirectories
– Has an associated alias, which is the name that
client browsers use to access the virtual
directory’s contents
• Alias:
– usually shorter than the original directory path
specification
– more convenient for users to type
Database-Driven Web Sites, Second Edition
23
Virtual Directories
• Virtual Directory Creation Wizard:
– Creates a virtual directory in the IIS console
– Presents a series of pages that prompt the
administrator to enter the specifications for the
virtual directory
Database-Driven Web Sites, Second Edition
24
Virtual Directories
• These pages include:
–
–
–
–
–
A Welcome page
An Alias page
A Web Site Content Directory page
An Access Permissions page
A Finish page
Database-Driven Web Sites, Second Edition
25
Applications
• Application: a virtual directory with access
permissions that enable users to run server-side
executable programs or scripts stored in the
physical directory associated with the virtual
directory
• Create an application: use the Virtual Directory
Creation Wizard and specify on the Access
Permissions page that users can execute scripts
or executable files within the virtual directory
Database-Driven Web Sites, Second Edition
26
Applications
• Application: created for every server-side
compiled program or script on a Web server
• A server-side compiled program or script starts a
process that runs in the Web server’s memory
and controls the program’s execution
• Process space: memory area where a process
runs
• The location of a program’s process space is
based on the memory model of its associated
application
Database-Driven Web Sites, Second Edition
27
Applications
• A memory model
specifies how an
environment
stores the data
for its processes
in the main
memory of a
computer
Database-Driven Web Sites, Second Edition
28
Organizing Your Web Server
• Web administrators organize Web server files by
placing them in directories that make the files
easier to locate and manage
• These directories enable the administrator to
control file access permissions and ensure the
security of the Web site
• Many Web administrators organize Web server
files by creating separate directories for different
types of files
Database-Driven Web Sites, Second Edition
29
Referencing Files on a Web Server
• Current working directory: contains the Web page
that currently appears in the user’s browser
• When objects such as graphic images in a Web
page are referenced, either
– the object file must be placed in the same directory
as the Web page or
– an absolute or relative file path must be specified
to the object file
Database-Driven Web Sites, Second Edition
30
Absolute URL Addresses
• Absolute URL address specifies:
– Web server IP address or domain name
– Complete path or virtual directory path to the Web
page file, and
– Name of the Web page file
• Absolute URL address
– can be placed in a browser’s Address field
– in a hyperlink tag to specify the location of a Web
page file or
– as the src attribute value in an <img> tag
Database-Driven Web Sites, Second Edition
31
Absolute URL Addresses
Figure 5-19 shows absolute URL addresses
Database-Driven Web Sites, Second Edition
32
Relative URL Addresses
• Relative URL address:
– Location of a file relative to the current working
directory
– Can be used to specify files stored in physical
directories on the Web server
• A file that is in a physical directory within the
current working directory is referenced by typing
the physical directory name, a front slash (/), and
then the filename, using the following syntax:
directory_name/filename
Database-Driven Web Sites, Second Edition
33
Relative URL Addresses
• A file that is in the parent directory of the current
working directory is referenced by specifying the
parent directory using two periods (..) followed by
a front slash (/), using the following syntax:
../filename
Database-Driven Web Sites, Second Edition
34
Factors Impacting Web Site
Performance
• Users of Web sites frequently experience delays
while waiting for their browsers to display the
pages they request
• Factors in response time include:
– Speed of the Web server’s network connection
– Amount of main memory that the Web server's
administrator allocates to process Web page
requests
– Web server's processor speed
Database-Driven Web Sites, Second Edition
35
Factors Impacting Web Site
Performance
• Factors in response time include (continued):
– Number of other visitors currently requesting
pages or files from the Web site
– Size of Web page files and their embedded
graphics objects
– Server resources required to execute Web-based
programs and scripts in Web pages
Database-Driven Web Sites, Second Edition
36
Factors Impacting Web Site
Performance
• Web server administrators can use a variety of
tools to monitor Web site performance
• IIS offers many configuration options to tune the
Web server and optimize performance
• An easy way to improve performance is to limit
the size of the Web page files and the number of
graphic objects on each page
• Web administrators should always assume that
visitors will have fairly slow network connections
Database-Driven Web Sites, Second Edition
37
Summary
• Internet Information Services (IIS) includes the IIS
console for administering a Web server and the
listener process for servicing user requests to a
Web server
• A Web server’s home directory is the Web server
directory that contains the Web server’s default
document
• A physical directory is a folder within the Web
server’s file system that is within the home
directory, a virtual directory, or an application
Database-Driven Web Sites, Second Edition
38
Summary
• A virtual directory is not necessarily physically
within the home directory, but appears to client
browsers as though it is
• Applications: virtual directories in which
permissions exist to allow users to run scripts or
executable files
• When an object on a Web page is referenced, the
referenced object must be in the same physical
or virtual directory as the Web page that currently
appears, or an absolute or relative URL address
to the object on the Web server must be specified
Database-Driven Web Sites, Second Edition
39