Chapter 9

Adding FTP and Gopher Services


CONTENTS


In this chapter, you learn how to integrate two traditional TCP/IP network services that pre-date the World Wide Web, but that can nonetheless be important to your customers. As noted earlier, the developers of Web technology took care to build support for a number of older network services into the HTTP protocol, integrating these services into Web browsers and servers. Because you established a TCP/IP networking infrastructure for your Intranet, you easily can use these older services in it, using mostly free software.

This book began by arguing that problems of differing-and difficult-to-master-user interfaces to older networking services were prime movers in the development of the Web. Of course, the existence of the Web doesn't mean those older services no longer have value. E-mail, FTP, Gopher, Archie, WAIS, and other such services remain at the heart of the Internet.

Earlier, you saw how a Web-based front end to the Archie file-locator service vastly simplified a difficult interface, making it accessible to non-technical users. You'll learn in this chapter how you can use FTP and Gopher services in your Intranet and provide Web-based front ends to them for your customers. In doing so, you'll substantially expand the range of services available on your Intranet without requiring significant customer training.

Support for each of these services is built into both the Web network protocol and your customers' Web browsers. Integrating them into the Intranet you started building in Chapter 7, "Running the Intranet Web Server," will provide new and powerful services to your customers, making your Intranet even more valuable.

MIME and Other Intranet Services

You learned in Chapter 7 how Web servers and browsers use the MIME mechanism to identify data by MIME data types/subtypes. Also, you learned that Web servers include this identifying information in MIME data type/subtype headers when sending data back to a Web browser. You may have wondered, then, why Web browsers also have to be configured with MIME information if they already receive it from the server.

This is a good question, and the answer is fundamental to the information in this chapter. Although MIME data type/subtype information coming from a Web server may indeed be redundant to the properly set up browser, Web browsers also communicate with other kinds of Internet information services, such as FTP and Gopher. These Internet services pre-date both the World Wide Web and MIME, so they don't know anything about MIME types. Moreover, because they send back only one kind of data, not one of many kinds of data like a Web server does, they have no reason to provide any identifying information. An FTP server sends and receives data using only the FTP protocol; likewise, Gopher servers use only the Gopher protocol. These servers respond to clients by sending out data; the clients have to figure out what to do with the data. Naturally, stand-alone FTP and Gopher client software do know what type of data to expect.

Fortunately, Web browsers deal with FTP and Gopher data too, and they can use the MIME mechanism to enhance their handling of the data, even in the absence of any incoming identifying information. As mentioned before, the HyperText Transfer Protocol (HTTP), which is the Web protocol, has support for a list of older Internet services built in. This support includes both FTP and Gopher, as well as several others. Your Web browser automatically senses when it's speaking with an FTP or Gopher server and acts accordingly. As far as you're concerned, though, you're just pointing and clicking, just as you would when dealing with a Web server. If you want to retrieve a file, you just click its hyperlink. Your browser identifies the incoming data and handles it properly.

You've no doubt noticed that your Web browser often dresses up the display of FTP and Gopher server listings with identifying icons. File folder icons represent directories; other icons identify plain text and binary files. Normally, FTP servers are completely text-based, with no graphical displays. Because an FTP server, for example, has no way of telling a Web browser what sort of data is coming, Web browsers use a workaround, keying off the filename extension to a MIME data type/subtype. The set of canned icons representing different file types that you see when you connect to an FTP or Gopher server does not come from the server. Rather, these icons are a result of your browser's MIME mechanism using the filename extensions and a built-in list of MIME data types/subtypes.

Netscape, Mosaic, and Internet Explorer support a long list of standard MIME types/subtypes for communicating with non-HTTP services, such as Gopher and FTP. The browsers use a built-in set of generic icons to represent them. Table 9.1 shows a partial list of MIME types available in Netscape.

Table 9.1. MIME types/subtypes.

Content TypeExtensions Description
text/plaintxt, text Plain Text
text/htmlhtml, htm Hypertext Markup Language
application/rtfrtf Rich Text Format
application/x-textex TeX Document
application/x-latexlatex LaTeX Document
application/x-dvidvi TeX DVI Data
application/x-texinfo texitexinfo GNU TeXinfo Document
image/gifgif CompuServe Image
image/jpegjpeg, jpg, jpe JPEG Image
image/tifftiff, tif TIFF Image
image/x-cmu-rasterras CMU Raster Image
image/x-xbitmapxbm X Bitmap
image/x-xpixmapxpm X Pixmap
image/x-xwindowdumpxwd X Window Dump Image
image/x-portable-anymappnm PBM Image
image/x-portable-bitmappbm PBM Image
image/x-portable-graymappgm PGM Image
image/x-portable-pixmapppm PPM Image
image/x-rgbrgb RGB Image
image/iefief
application/fractalsfif Fractal Image Format
audio/basicau, snd ULAW Audio Data
audio/x-aiffaif, aiff, aifc AIFF Audio
audio/x-wavwav WAV Audio
video/mpegmpeg, mpg, mpe MPEG Video
video/quicktimeqt, mov Quick Time Video
video/x-msvideoavi Microsoft Video
video/x-sgi-moviemovie SGI Video
application/mac-binhex40 hqx Macintosh BinHex
application/x-stuffitsit Macintosh Archive
application/x-zip-compressedzip Zip Compressed Data
application/x-sharshar UNIX Shell Archive
application/x-tartar UNIX Tape Archive
application/x-gtargtar GNU Tape Archive
application/x-cpiocpio UNIX CPIO Archive
application/octet-streamexe, bin Binary Executable
application/postscriptai, eps, ps Postscript Program
application/x-cshcsh C Shell Program
application/x-shsh Bourne Shell Program
application/x-tcltcl TCL Program
application/x-trofft, tr, roff TROFF Document
application/x-troff-meme TROFF Document
application/x-troff-msms TROFF Document
application/x-troff-manman UNIX Manual Page
encoding/x-compressZ Compressed Data
encoding/x-gzipgz GNU Zip Compressed

You can use Netscape to view this list and the associated icons at http://www.netscape.com/assist/helper_apps/mimedefault.html.

Tip
Web browsers' built-in lists of supported MIME types/subtypes rely solely on filename extensions when dealing with Internet services such as FTP that don't provide MIME header information. Because people are free to name files anything they want, you may encounter files on the World Wide Web that are misidentified by your browser because they've been given an extension that conflicts with your browser's built-in list. Make sure you use consistent filenaming conventions in your Intranet, following your browsers' built-in lists, to ensure that your customers don't encounter files that their browsers can't identify.

How an FTP Server Can Add Value to Your Intranet

The TCP/IP file transfer protocol (FTP) is one of the Internet's mainstays. You probably used FTP to download your first Web browser software. On UNIX, FTP is a text-based application and is not particularly user-friendly for the uninitiated. Windows NT and Windows 95 also include a command-line FTP client. But you don't have to bother with those because the CD-ROM with this book includes an excellent 32-bit GUI FTP client, named WinFTP.

Sams.net and I obtained permission to include WinFTP just as this book was going to press. Before learning of this, this chapter had already been written including the instructions for installing and using another fine GUI FTP client named CuteFTP. Most of the information in this chapter about the FTP client program is directly applicable to WinFTP as well as CuteFTP. And of course, the information about the FTP server will work regardless of your choice of the FTP client program. CuteFTP is available for free download from the Internet.

Installing CuteFTP

To download and install CuteFTP from the CD to your hard drive, follow these steps:

  1. Use your Web browser to download CuteFTP from the World Wide Web. It is available in the Winsite Archive: http://www.winsite.com/pc/win3/winsock/cftp14b4.zip
  2. Unzip CuteFTP using the WinZip program on the CD into a directory on your hard disk and create a shortcut on your desktop for cuteftp32.exe. If you're upgrading from a previous release, keep your tree.dat file. All other files can be overwritten safely.

    Tip
    The file cuteftp.exe is a 16-bit version of CuteFTP for use with Windows 3.1 or 3.11. On Windows NT and Windows 95 machines, you can safely delete this file to save disk space.


  3. Copy the file ctl3dv2.dll into the \WINDOWS\SYSTEM directory (for Windows 95) or the \WINNT\SYSTEM32 directory (for Windows NT), and then delete it from the CuteFTP directory.
  4. Start CuteFTP and display the Options dialog (File | Options menu). Fill out the Mail Address field with your e-mail address. Click OK.

You now have one of the best FTP client applications available to assist you with file transfers.

Running CuteFTP

To use CuteFTP, you need a connection to the Internet. The first thing you will see when you run CuteFTP is the FTP Site Manager shown in Figure 9.1.

Figure 9.1: The CuteFTP Site Manager enables you to organize the addresses of your favorite FTP sites

This dialog shows the predefined addresses of several anonymous FTP sites. You can easily add new sites to these folders or edit the information about existing sites. To see how this software works, try to visit the Microsoft site to download the latest version of Internet Explorer. (By the time you read this, IE version 3.0 should be available and you may want to download it in case it isn't included on the Windows NT 4 CD-ROM.)

  1. Select the Company home sites folder in the left side window, and double-click the row for Microsoft in the right side window. CuteFTP shows you the login sequence in the top window, your local drive in the left window, and the remote directory structure in the right window.
  2. Double-click the folder for Softlib. (See Figure 9.2.)
  3. Double-click the folder for MSLFILES to display a directory with a long list of files you can download. It helps if you know the particular filename you are looking for. In this case, suppose you want to get MSIE20.EXE. (Please don't try to download this particular file because you already have it-it's on the CD-ROM with this book!) When IE version 3.0 becomes available, it will probably have a different filename, such as MSIE30.EXE. This hypothetical example illustrates how you could download a future version of Internet Explorer when one becomes available.
  4. Navigate the left window pane to the local directory on your system where you would like to receive the file. For example, click the double dot icon at the top to move up one level in your directory structure. In this example, I have positioned the local directory to c:\temp in the left window pane.
  5. Click the file and drag it from the right window pane to the left window pane. Then let go of the mouse button and the file transfer will begin. (See Figure 9.3.)

Figure 9.2: Double-clicking the Microsoft softlib folder takes you to that subdirectory of files on the Microsoft server.

Figure 9.3: Dragging the file from the right window to the left window will initiate the download.

CuteFTP keeps you notified of the file transfer progress in the status bar.

Note
Now that you've seen how easy it is to download a file from a remote system, you already know how to upload a file to a remote system. Basically, it is just a matter of dragging a file from your local drive (the window on the left) to the remote drive (the window pane on the right).

One other trick you might like to know about CuteFTP is how to set the default directories on the local and remote systems when a connection is established. Then you won't have to waste any time navigating the directory structures in either window pane. This trick requires you to edit the profile of the FTP site. If, for example, you wanted to edit the profile for the Microsoft site, you would perform these steps:

  1. In the FTP Site Manager dialog, select Microsoft. Then choose the Edit Site button to open the dialog shown in Figure 9.4.

    Figure 9.4: Editing the site information for Microsoft.
  2. For the Initial Remote Directory, type in the server path that you would like to be placed in when the connection opens. For example, type in /softlib/mslfiles. Note that FTP originated in the UNIX world, which uses forward slashes for directory separators.
  3. For the Initial Local Directory, type in the preferred path on your drive. For example, type in c:\temp. Then choose the OK button to save the edited profile.

Figure 9.5: Visiting the Microsoft FTP site with Navigator.

Tip
You can leave the userid and password blank for anonymous FTP sites.

Visiting an FTP Site with Netscape Navigator

To download that same file with the FTP feature built into Netscape Navigator 2.x, perform the following steps. A similar process would apply to any Web browser that your customers might run on your Intranet.

  1. Fire up Navigator, and then type this URL into the Location edit box at the top of the screen: ftp://ftp.microsoft.com/. Press Enter.
  2. Double-click the folder for Softlib, and then double-click the folder for MSLFILES. (See Figure 9.5.)

    Tip
    You can save the time of scrolling through the directories in Step 2 if you initially enter the complete URL
    ftp://ftp.microsoft.com/Softlib/MSLFILES/:


  3. When you click the file you want to download, Netscape prompts you with the 32-bit Save As common dialog. All you have to do is pick the destination directory on your local drive, and the file transfer will proceed.

Whether you use your Web browser or CuteFTP, you will find that knowing how to copy Internet/Intranet files with FTP is a very handy process to be familiar with.

How Can You Use FTP on Your Intranet?

You may have software or other data that you would like to make widely available to your customers. Setting up an FTP server on your Intranet makes this process easy. If you have Windows NT Server and IIS on your Intranet, you already have FTP server software you can use. Setting it up is fairly simple. Most of your customers will access your FTP server using their Web browsers, so they won't need to learn about FTP, or even know that they're accessing an FTP server, in order to download files.

Probably the best way to use your Intranet's FTP server is as a distribution point for Web-related software, including both browser and server software. Not only can you make it easier and faster for your customers to get the latest copy of Internet Explorer (or Netscape, if you've licensed it), but you'll also take a major load off your company's Internet connection by downloading the software from the outside once, and then having local copies of the software available on the Intranet. Your network administrators will thank you for reducing the load on their Internet link, and your customers will thank you for faster service.

You'll also do a good deed for the online community by relieving the load on the FTP server where the original software resides. Whenever a new release becomes available, you can grab a copy and make it instantly available for your customers. Major anonymous FTP servers like FTP.ncsa.uiuc.edu, home of ncSA Mosaic, are invariably very busy in the days immediately following a new release of Mosaic. Accesses are often denied when the system is too busy to handle all the requests for copies of the new software release.

Similarly, you can redistribute Web server software for those of your customers who may want to set up another server and make it part of your Intranet. Your FTP server is a good place to store libraries of image files for use in HTML markup for much the same reason. Be sure, however, that you read and follow licensing restrictions on the redistribution of copyrighted software, including shareware.

Configuring the IIS FTP Server in Windows NT 4

If you worked through the steps in Chapter 7 to set up the WWW Service with IIS, you should have a very easy time setting up the FTP Service in this section and the Gopher Service later in this chapter.

To configure the FTP server, follow these steps:

  1. Open the Microsoft Internet Service Manager. If it isn't already running, choose Start Menu | Programs | Microsoft Internet Server | Internet Service Manager.
  2. Double-click the FTP Service. If the service is not running, it will ask you if you want to start it. Choose Yes.
  3. You will see the tabbed dialog to configure the FTP Service Properties that is shown in Figure 9.6. Typically, you will want to allow anonymous connections. An anonymous connection permits people to connect to your server and retrieve or upload files based on their account files and directory permissions. The IUSR_computername password must match exactly (case-sensitive) with the password for the same user account in User Manager for Domains.

    Figure 9.6: Configuring the FTP Service properties in IIS.

  4. Click the Messages tab and configure the messages that you would like your customers to see when they visit your FTP site. Figure 9.7 shows some sample messages.
    Figure 9.7: Configuring the messages that the FTP Service will display to the clients.
  5. In the Directories tab, be sure to check UNIX-style directory listings for compatibility with most FTP client software. Depending on your computing background, you may think that MS-DOS style listings are better looking, but they aren't supported by many FTP clients.
  6. For each directory, you can choose the Edit Properties button to enable Read and/or Write access to that directory. The root directory is called <Home> (by default it is \inetsrv\ftproot) and that is where anonymous FTP clients will be placed.
  7. The Logging and Advanced tabs are identical to the WWW Service. Consult the IIS help files and Chapter 7 for further information.

Now you just need to add the files that you want to make available to your customers to the <Home> directory.

Note
Internet Security Systems in Norcross, GA maintains a Frequently Asked Questions (FAQ) document about anonymous FTP setup. To grab a copy of this document, use your Web browser to go to http://iss.net. Most of the information is written with a UNIX slant, but you should still find it useful for Windows NT networks.
In case you want to make your anonymous FTP server available on the Internet, the Anonymous FTP FAQ also tells you how to register it with the Archie service.

Populating Your Intranet's Anonymous FTP Server

Because setting up anonymous FTP creates a walled-off file system dedicated to your FTP server, you'll want to set up a directory structure that corresponds with the data you're distributing. Use the server's <Home> directory as the top of your file tree, with additional directories created within it based on your Intranet's needs.

Tip
Some people use the same file tree for their anonymous FTP and Web servers, putting the anonymous FTP file tree within the HTML document root file tree. This structure can make maintenance of both your Web server and your anonymous FTP server more convenient. You need to watch your directory and file permissions, though, to ensure you don't disable with one server the security you may have set up with the other. This issue is particularly relevant if you set up password-protected portions of your Web server tree, a subject covered in more detail in Chapter 10. The default installation of IIS creates separate root directories for WWW, Gopher, and FTP.

How a Gopher Server Can Add Value to Your Intranet

Before the World Wide Web burst onto the Internet stage in 1993, the sexiest Internet technology was something called Gopher. Developed at the University of Minnesota (whose athletic teams are nicknamed the Golden Gophers), Gopher was the first successful attempt to join several existing TCP/IP networking technologies into a single, easy-to-use interface.

The main Gopher interface is a plain text menu of choices. You start out at a top-level menu and work your way down a hierarchy of nested menus until you find the subject you're after. Once you find your subject, you're able to view text files on-screen and, in some cases, transfer files across the Internet to your own computer. Selecting a Gopher menu item can do one of several things:

The last two items are key to Gopher's success. By selecting a menu item, you can move transparently from one Gopher server to another one. You don't have to know anything about how to get there, the second server's Internet address, or anything else. Even more importantly, Gopher incorporates preexisting Internet services such as Telnet and FTP. As a result, you can access a remote computer for login and terminal emulation, or transfer a file using FTP, just by selecting a Gopher menu item.

If you're thinking that Gopher is beginning to sound a lot like the World Wide Web, you're right on target. You can do many of the same things with Gopher that you can do on the Web, such as jumping transparently from one computer system to another, accessing other Internet services, and even searching Gopherspace. Gopher can be seen as the Web's most immediate ancestor, with many of the same capabilities in a non-graphical interface. The Web's HTTP protocol reflects this ancestry: Gopher is one of many Internet services that is built into the World Wide Web. You can use your Web browser to access Gopher services.

Note
The graphical icons shown in Gopher listings don't come from the Gopher servers. Rather, your Web browser, using the MIME mechanism and its built-in list of filename extensions/MIME type/subtype associations, generates them to dress up the display.

Why Should I Use Gopher?

If you can do everything with your Web browser that you can do with a Gopher client, you may well wonder why you would want to bother with running both on your Intranet. Gopher services have limitations not present in the Web. Most notably, you can't include graphics and hyperlinks within Gopher documents. Therefore, you can't jump directly from one document to another, though you can jump using Gopher menus. Nonetheless, there are some strong reasons for you to consider setting up Gopher services as part of your Intranet.

The primary reason is that Gopher's strongest suit is plain text files. You don't have to learn the HTML markup language, and setting up a Gopher server is substantially easier than setting up a Web server. Gopher is a favorite with many U.S. Government agencies for just these reasons. The Government generates vast quantities of plain text documents, and it's quite easy to hook them into a Gopher server. Indexing plain text files (with WAIS or other indexing tools) is easy, and Gopher can search the indices that these tools create. If a lot of the data you plan to make available on your Intranet is plain text data, Gopher is for you. You may not even need a Web server and all the time and trouble of converting documents, as described in Chapter 7. There is little reason for you to learn HTML and how to convert image data if your data is plain text and you have no images to use.

Tip
The inevitable FAQ document about Gopher is at gopher://mudhoney.micro.umn.edu/00/Gopher.FAQ.

Configuring the IIS Gopher Server in Windows NT 4

If you implemented the steps in Chapter 7 to set up the IIS WWW Service and the steps in the previous section to configure the IIS FTP Service, you already know everything you need to know about the IIS Gopher Service. You see, Microsoft implemented the WWW, FTP, and Gopher Services in IIS so similarly that once you have learned how to configure any one of the servers, configuring another one is quite easy.

Note
This chapter focuses mostly on the Microsoft IIS FTP and Gopher Services. As of this writing, IIS requires NT Server. If you are using NT 4 Workstation and you want to run an FTP or Gopher server, you still have options. The CD-ROM with this book includes the freeware EMWAC Gopher server. You might also want to consider the Serv-U FTP server for a very reasonable $20 shareware registration fee (send e-mail to: RJB@eel-mail.mc.duke.edu for more information).

To configure the Gopher server, follow these steps:

  1. Open the Microsoft Internet Service Manager. If it isn't already running, choose Start Menu | Programs | Microsoft Internet Server | Internet Service Manager.
  2. Double-click the Gopher Service. If the service is not running, it will ask you if you want to start it. Choose Yes.
  3. You will see the tabbed dialog to configure the Gopher Service Properties shown in Figure 9.8. Again, the main thing you need to do here is ensure that the IUSR_computername account has the same password in User Manager and that you give the appropriate file and directory permissions to that user for the Gopher <Home> directory.

Figure 9.8: Configuring the IIS Gopher Service properties.

Creating Gopher Links

The final step in getting your Gopher server ready for your customers is to create Gopher links. Links are the items you place on Gopher menus that enable the user to jump from one place to another. A link can point to one of the following:

Tip
See the IIS help files for more information about creating Gopher links and menus. The section titled Setting Up Tag Files contains important information about the gdsset command-line utility. The gdsset utility creates hidden files that you place in the Gopher directories on your server.

Summary

This chapter has covered two of the major TCP/IP networking services that can add value to your Intranet. Your customers can access these services by using their World Wide Web browsers, and they can extend your Intranet to make it more useful to your company or organization. Although they both function as stand-alone network services, putting a Web-based front end on them can make them easy to use. In this chapter, you have done the following:

Don't think of these services in isolation. You can combine these services in imaginative ways to create truly unique and valuable additions to your Intranet; examples include using WAIS to index e-mail distribution list archives for subsequent search and retrieval, using Web fill-in forms, and using CGI-bin gateway scripts. These potential combinations of service, using Web browser front ends, constitute more than the simple sums of their parts; they create new, powerful applications for your Intranet.

Chapter 10 deals with Intranet security issues. Although your objective in setting up an Intranet is to make information available to your customers, you'll want to pay attention to its security, particularly if any part of your Intranet is accessible to the Internet. In addition, implementation of some Intranet security features can enhance the value of your Intranet's services.