by Serdar Yegulap
Microsoft Personal Web Server (PWS) is a modest but useful Web server program that runs under Windows 98. It uses some of the same core technologies as Microsoft's professional-level Web server, Internet Information Server (IIS). PWS includes many of the capabilities of its bigger brother, including the capability to connect to databases and use Active Server Pages to create dynamic content.
PWS is scaled down from IIS for less demanding Web-server tasks, such as an in-office intranet. You can still use PWS to serve pages to the Internet at large, if your page demands and hardware allowances are modest, and this chapter will go into some detail about that. You can also use PWS to test Web sites before they are deployed for real.
PWS was originally created and deployed for Windows 98 as a downloadable add-on and could be found on Microsoft's Web site, in Microsoft's developer's kits, and in many shareware repositories around the world. When Windows 98 began to take shape, it was added as a standard component that could be installed from the Windows 98 CD-ROM.
Personal Web Server allows you, quite simply, to turn your computer into a Web server more than powerful enough to meet most modest Web server needs. If you have an Internet connection, or have your computer installed on a local area network (LAN), you can publish HTML documents without having to invest in a separate server. When used in conjunction with a Microsoft-compatible Web publishing tool, such as FrontPage, PWS can also be used to publish databases.
PWS can be used independently of the type of Internet or network connection it uses, provided that the connection supports the TCP/IP protocol. Anything from a LAN or a T1 connection to a 28.8 dial-up will work, albeit at different speeds.
PWS is not designed to function as a commercial-level Web server that handles, for instance, financial or secured transactions. That sort of capability is better handled by Microsoft's Internet Information Server, which runs on Windows NT and provides a far more robust platform for deploying merchant-style Web-based services.
NOTE: There has been a great deal of confusion regarding Windows NT's server capacities, especially as opposed to Windows 98. Windows NT Workstation has a built-in limit of ten inbound NetBIOS connections. (The number of TCP/IP connections is not limited, which allows NT Workstation to be used as a quick-and-dirty Web server without trouble.) Windows NT Server has no practical connection limit, but you must buy licenses for each connection on a per-server or per-seat basis. Windows 98 does not have any hard-wired limitations, in licensing or otherwise, to the number of connections that it can satisfy. The only real limit is the power of the host computer, the bandwidth of the connection, and the robustness of Windows 98 itself. Windows 98 can be used satisfactorily for a modest Web server.
Personal Web Server was originally designed as a downloadable add-on for Windows 95 Service Release 2. It appears, with some modification and updates, in Windows 98 as a feature that can be installed directly from the Windows 98 CD-ROM.
Because PWS is small and designed to run light, running PWS doesn't require a lot of hardware power. Any computer that can run Windows 98 will do for a start and should fit this bare bones description:
The network connection is the most indispensable part of PWS because it's impossible to get access to the server without a network link of some kind. PWS doesn't care whether the pages are being accessed through a dial-up connection, a LAN or a WAN, as long as a network link that uses TCP/IP is available to it.
In general, the better the configuration, the better everything will run, including PWS.
TIP: On the whole, PWS is more disk- and memory-intensive than processor-intensive. If you have a choice between using a machine that has a faster processor and a machine with more memory or a faster drive, use the one with more memory or the faster drive. The performance payoff is more visible and immediate.
As a guideline, try to dedicate a machine for your PWS installation. If someone else is working with the machine, the performance hit on the server software will be noticeable, especially if the user is running memory- or CPU-intensive applications. The less the system is doing besides running PWS, the better.
To install the Personal Web Server, insert the Windows 98 disk into the CD-ROM drive and click Start, Run. Type the following command:
[driveletter]:\add-ons\pws\setup.exe
Replace [driveletter] with the letter of your CD-ROM drive. The Personal Web Server Setup program appears (see Figure 25.1). To start the installation, click Next, and read through the licensing agreement.
NOTE: Don't be confused by the "Microsoft Windows NT 4.0 Option Pack" statement at the top of the licensing agreement. Many core components of PWS were taken directly from IIS, and the licensing arrangement is similar.
CAUTION: The licensing agreement is more than boring legal folderol. If you're planning on using PWS in any kind of public or professional application, read the agreement front to back and make sure that you're not using PWS in a fashion that violates the agreement. You might need a full-blown, properly licensed Web server for what you're doing, so save yourself the risk of being embarrassed later and read the document.
Click Next to move on to the installation options menu.
There are three basic types of installation that you can do with PWS. You choose between the types of installations by clicking the appropriate button in the installation options menu.
If you choose Custom, a list of components appears that you can select or deselect (see Figure 25.1). Here is a quick rundown of the components available in PWS through the Custom menu option:
FIG. 25.1 The Microsoft Personal Web Server Setup dialog box.
If you check every box on the list, you'll install everything included in the PWS package--development tools, documentation, FrontPage 98 server extensions, and so on. Be warned that a full install of PWS will use 52.6 megabytes of disk space, so this should only be done on a system that you're sure has the space for it, and if you really need all the pieces.
The component list does not appear if you do not select Custom.
After you've finished selecting which components you want to load, click Next. The PWS installation program asks you for the name of the directory you are going to keep your Web page files in (see Figure 25.2). This defaults to [rootdrive]:\Inetpub\wwwroot but can be changed to anything you want. The other two directories (FTP Service and Application Installation Point) are not available in PWS and are therefore grayed out by default.
Click Next to begin copying the PWS installation files from the CD-ROM. A progress meter will indicate how far along the copying process is. When the files have finished copying, you will be asked to reboot your machine. PWS will start up automatically after the next reboot.
FIG. 25.2 The PWS default directory text boxes.
While running, PWS normally appears as an icon in the system tray. The icon changes depending on the state of the server (running, paused, or stopped). Right-clicking the icon brings up a list of quick options for PWS.
The PWS properties sheet, also known as the Personal Web Manager, comes up when the user double-clicks the tray icon, or selects Properties from the icon's right-click menu. It can also be accessed from the Start button, by selecting Programs, Microsoft Personal Web Server, Personal Web Manager. See Figure 25.3 for an example of the Personal Web Manager.
The Manager is divided into two panes, with the left-hand pane containing the five main program options: the Main screen, Publish, Web Site, Tour, and Advanced. Clicking each of these will bring up the appropriate information in the right-hand pane. The default is Main.
Main Pane The Main pane is subdivided into two sections: Publishing and Monitoring.
FIG. 25.3 The Main pane of the Personal Web Manager.
Publishing The Publishing subsection of the Main pane describes the basic attributes of PWS's functioning: whether it's on or not, what the proper URL is to view the site from your local machine, and what the server's home directory is currently registered as. The two URLs shown in the Publishing subsection are live: they can be clicked and will bring up a copy of Internet Explorer to display the contents of the URL. This is a good, quick way to preview what's on the Web site. The Stop button has the same functionality as the Stop command on the tray icon's right-click menu. Once clicked, it changes to a Start button (again, same functionality), and the hotlinks to the PWS site vanish. The statistics in the Monitoring section also vanish. To reactivate the Web site, simply click the Start button.
TIP: Using Pause instead of Stop is a good way to make quick tweaks without actually turning off the Web server. If you shut down the server completely, the server won't respond to outside requests at all. If the server is paused, it will at least fire back a message stating that the site is temporarily unavailable.
CAUTION: You will need to shut down the server completely if you need to add or remove components, or change the directory structure of the server. You cannot make changes of that nature when the service is running or paused.
Monitoring The Monitoring subsection of the Main pane provides live statistics about the PWS site. These statistics are continually updated; you do not need to click a button to bring them up to date. The statistics listed are as follows:
Publishing Wizard The Publishing Wizard is a quick way to create and publish simple documents on PWS. It is not a substitute for a full-fledged HTML publishing program such as Microsoft FrontPage, but it is a good way to get a page up onto the server quickly and without programming. Windows 98 comes with a copy of FrontPage Express, a stripped-down version of FrontPage's HTML editor. It does not do full-fledged site management, but it's good for editing individual pages.
The Publishing Wizard is activated by clicking the Publish icon in the left-hand pane of the Personal Web Manager. When you do this, the Publishing Wizard (see Figure 25.4) opens in the right-hand pane.
FIG. 25.4 The first screen of the Publishing Wizard, running in the Personal Web Manager.
If you've never created a document with the Publishing Wizard before, the program will prompt you to run the Home Page Wizard first.
The Publishing Wizard contains several controls (depicted in Figure 25.5) used to publish a desired page.
FIG. 25.5 The Publishing Wizard screen.
Home Page Wizard The Home Page Wizard creates a quick and attractive home page on the server by prompting the user to answer several basic questions.
Click the design you want to use and then click the right arrow (the ">>"
symbol) to advance.
2. You can install a guest book on your home page. This is a section of
your home page where visitors can sign in and leave comments. Click Yes or No to
allow or disallow a guest book; then click the right arrow to go on.
NOTE: At any time during the Home Page Wizard, you can click the list at the left-hand side of the frame to go back and change a previously defined option. For instance, during the guest book page, the only other option is "theme"; clicking that will bring you back to the themes choice page and let you redo your choices there.
After the Home Page Wizard is run, the Publishing Wizard will allow you to edit and make changes to pages already available.
The Publish Desktop Icon The Publish desktop icon is placed on the desktop when you first install PWS. If you drag any file to this icon, including HTML files, the Publishing Wizard appears and will allow you to publish the selected document in your Web site. After the drag-and-drop, the Publishing Wizard appears, which is detailed in the section devoted to the Publishing Wizard.
The Personal Web Manager Tour The Product Tour of Personal Web Manager, which appears in the right-hand pane when you click the Tour icon in the left-hand pane, is a noninteractive summary of PWS's major features.
Advanced Options The Advanced Options pane (see Figure 25.6) lets you control some of the less commonly used but also important settings of PWS. Someone using PWS in a fairly passive context--that is, setting it up and leaving it alone--will probably not need to use any of the advanced options. However, someone looking to get the most use out of the Web server will want to make themselves familiar with the Advanced Options screen.
FIG. 25.6 The Advanced Options screen.
Virtual Directories Virtual directories are a way of more freely structuring the content on a Web site. Generally, the entire directory structure of a Web site is virtual--that is, there's no direct correspondence between the directory structure on the Web site and the organization of the files on the server. For instance, if you have a Web site that has a virtual directory named /main, the virtual directory system in your Web server will allow you to place the files for /main anywhere on your hard drive. The same goes for any other directory in the entire hierarchy. The Virtual Directories subsection of the Advanced Options pane lists all the virtual directories currently on the web server.
CAUTION: Do not edit the virtual directory structure unless you're absolutely sure that you know what you're doing. The directories that appear by default in the virtual directory window are created by PWS during the installation process and provide a good deal of the Web site's basic functionality, especially the /SCRIPTS and /IISADMIN directories. Delete them at your own risk.
Next to the Virtual Directories window is a list of buttons that provide control over the Virtual Directories list: Add, Edit Properties, and Remove.
Add The Add button lets you insert a new virtual directory into the hierarchy below the directory currently highlighted. For instance, if the highlighted directory is /New, the Add button creates a directory underneath /New. To create a virtual directory off the root directory, highlight the <Home> directory by clicking it and then click Add.
Clicking Add brings up the Add Directory window. Consider each entry in the Add Directory window before clicking OK to confirm the new directory.
CAUTION: You can only publish files from your local drive. The Personal Web Manager Publishing Wizard will not publish a file that resides on a network drive. This is for security reasons.
Edit Properties The Edit Properties button lets you bring up the properties of a virtual directory, which are the same as in the Add Directory window, and change them. To make changes to a virtual directory's properties, click on the virtual directory to highlight it and then click the Edit Properties button.
Remove The Remove button deletes the selected virtual directory. As with Add and Edit, a directory is deleted by clicking the directory first to highlight it and then clicking the Remove button.
Access The Access subsection of the Add Directory window controls how you want to restrict or allow access to a given virtual directory.
CAUTION: Don't set Execute or even Scripts on a directory unless you're absolutely sure that the executables you're providing are set up properly and cannot be used to harm your computer. For safety's sake, never set both Read and Execute permissions on any directory.
Click OK to finalize the settings and set up the new virtual directory, or Cancel to bail out.
CAUTION: Never delete any directories created by the PWS setup process. These include any directories that start with the letters IIS or MS, and the /SCRIPTS and /WEBPUB directories. PWS needs all these directories for internal management.
Enable Default Document The Enable Default Document check box lets you allow PWS to automatically display a document (you provide the name) whenever the user browses a directory without providing a specific document name. By default, this is set to Default.htm and Default.asp (for Active Server Pages). Therefore, if you provided a file named Default.htm into a virtual directory named /Sub, a user who asked for just the /Sub directory without specifying a file would get whatever was in Default.htm. Default documents are enabled by default. Default documents are a powerful way to control how content is delivered in your Web site. The root virtual directory, which is described as <Home> in the Virtual Directories list, contains a Default.htm file that can be edited freely by the user. This will change the information automatically delivered to a user when she asks for your Web site without specifying a directory or document name.
If you deselect the Enable Default Document check box, then PWS will not deliver the default document in any directory. This change is global and cannot be performed on a directory-by-directory basis. This should generally only be done in rare circumstances.
NOTE: Some Web site software programs use Index.htm rather than Default.htm as the default document. O'Reilly's WebSite is one such program. If you are transporting a Web site from a server that used such software, you will either have to rename all Index.htm files to Default.htm (and rename all corresponding links within pages), or change the default document to Index.htm. Keep in mind that changing the default document name will cause some preinstalled PWS functions, such as the Publishing Wizard, to malfunction.
Allow Directory Browsing The Allow Directory Browsing check box, when enabled, allows users to look at the contents of a directory in the Web site by simply providing the pathname. If no default document is in that directory, or if default documents have been turned off, then the entire contents of the directory are listed, with each filename hyperlinked (see Figure 25.7). This is useful if you want to publish entire directories of files quickly. Directory browsing is disabled by default.
FIG. 25.7 A browsed directory, with files.
CAUTION: Allowing directory browsing can be dangerous. If you allow unrestricted access to the contents of a directory that might contain sensitive information, you are inviting trouble. Don't enable directory browsing unless you've confirmed that everything being published through the Web site is intended for unrestricted use.
Save Web Site Activity Log Enabling the Save Web Site Activity Log check box causes all Web site activity--requests from the outside, files sent, the IP addresses of Web site users--to be logged to a file. This is a powerful alternative way of evaluating usage, aside from the built-in usage charting. Logs are saved to the \System\LogFile\W3spc1 directory. After each month of activity, a new log is started. Logs are written in the NCSA log file format and can be viewed in any text editor. Logging is disabled by default.
Here are several suggestions for intelligent usage, optimizing performance, and getting the most out of PWS in general.
Any computer used as a Web server is going to experience a lot of disk activity. Use the Task Scheduler to set the system to be defragmented at least once a week. Also, if the machine you're running PWS on is being used primarily as a Web server and not much else, use the Application Launch Accelerator in the Disk Defragmenter to place PWS and its associated files near the front of the disk for faster access.
Use the quick-glance usage charts and the activity logs to get a better idea of when the peak times for traffic to the Web site appear. If the machine is being used for more than just Web services, you can make a standing policy to keep local users off the Web server during peak hours.
One of the best uses for PWS is to provide a localized way of testing a Web site before deploying it for real. If you use PWS in conjunction with a Web publishing tool such as Microsoft FrontPage, you can leverage a good deal of PWS's power in testing everything from static pages to dynamic content, including databases and Active Server Pages.
CAUTION: Web sites tested with PWS should be double-checked for correctness if they are to be deployed on a server that does not use a Microsoft-variety Web server. Static pages will generally not be a problem, but anything that uses even simple executables, such as CGI scripts, should be written in as close to a platform-neutral manner as possible. Also make sure that the way you have the directories that hold your CGI executables locally mirrors the way that CGI is executed on the server. Contact your Web hosting company for details on how to best accomplish this.
One of the best things about Personal Web Server is its cost-effectiveness. It enables an ordinary desktop computer to serve Web pages to the Internet on any network backbone. This makes it possible for someone to use his desktop computer to create a World Wide Web site from nothing more sophisticated than his existing Internet dial-up account.
Until recently, this wasn't practical for one reason. Most Internet service providers, or ISPs, use "dynamic IP" for their dial-up clients. This means that every time someone dials in and connects to the Internet, he is assigned one of a pool of IP numbers specifically reserved by the ISP for dial-up clients. Unfortunately, this means that users rarely get the same IP address twice when they dial in. This makes it impossible to do reliable full-time hosting of a Web site through a dial-up connection because a domain name can't be given to a dynamic IP address.
There have been some intermediate solutions to this problem. For instance, there are many shareware programs that, upon connection, determine your current IP number and post it to a Web page, FTP site, or even an IRC channel. But this still requires that someone know where to look to get the IP address and can be more trouble than it's worth.
Now there is a more reliable solution to this problem. There are companies that, for a fee, will allow you to assign your dynamic IP address to a subdomain machine in their domain, such as "mycomputer.dynamic.net". This isn't as impressive as a top-level domain name like "www.mycomputer.com", but it makes it many times easier for you to create and maintain a presence on the Web and attract continuing visitors to your site. To make this feasible, the user downloads and installs a program that notifies the dynamic IP host every time the computer gets a new IP address (that is, every time it dials in). The clients themselves are generally small and unobtrusive.
There are disadvantages to doing this. One is low bandwidth because the fastest "pipe" that a dial-up connection can currently offer is 56KB inbound (and 33.6KB outbound). The other disadvantage is that it requires a phone line to be dedicated to the computer continually and should be used in an area where there is either no charge for call time (only per-call charges), or where local calls are not charged. Still, if you're not planning to serve out anything more demanding than text pages and the occasional graphic, this is a good option to investigate. For instance, nonprofit organizations and information clearinghouses might want to investigate this option because it provides some of the best results for the least expense.
As of this writing, there are two major providers of dynamic IP hosting--Monolith Internet and DynIP.com.
One of the most popular dynamic IP hosts, Monolith Internet (http://members.ml.org/) provides a dynamic IP hosting project, named DynDNS, at no charge. Monolith is subsidized by funds from other projects, which allows it to provide DynDNS for free.
Monolith hosts all dynamic IP clients from a subdomain called dyn.ml.org. Therefore, if your machine is named myserver, your URL would be myserver.dyn.ml.org.
Many people like Monolith for its openness and user-friendliness. Monolith provides the technical details of its service online, which makes it easy to write a client program to update the DynDNS IP address database. Many people have written clients for Monolith, not just for Windows but for many other OSes as well.
Because Monolith is a volunteer and not-for-profit project, its services are occasionally less dependable than a commercial service like DynIP.com. However, the fact that it's free and quite dependable the vast majority of the time more than makes up for it.
The best Monolith client for Windows 95, 98, and NT is generally considered to be DynamoDNS, a shareware program by Rage Creations, and is available through Monolith's own Web site as well. It features a wealth of options, is extremely flexible, and can be set to work with one or more modems at a time, if you use line pooling or ISDN.
DynIP.com, a division of CanWeb Internet Services, Ltd., is another service that provides dynamic IP hosting, but for a price. DynIP.com will host a dynamic IP address for $19.95 a year, with a 30-day free trial period. DynIP.com also allows you to look up other users online through its Web site.
DynIP.com also has one other drawback as compared to Monolith: you are required to use its client software. Fortunately, it has very good clients for Windows, Macintosh, and even Linux and FreeBSD. l
© Copyright, Macmillan Computer Publishing. All rights reserved.