
David Watts
If you're interested in using Cold Fusion to build database-driven Web applications, you may already have a Web server operating on the Internet or on an intranet within your company. This chapter provides a checklist of the hardware, software, and information you need to start using Cold Fusion.
Cold Fusion's design enables you to do one thing very well: build dynamic Web sites and applications using data stored in ODBC-compliant databases. As a result, you probably won't be surprised to learn that the primary requirements for using Cold Fusion are a Web server, a database, and Open Database Connectivity (ODBC) drivers.
Cold Fusion runs on Windows 95, Windows NT 3.51 Workstation and Server, and Windows NT 4.0 Workstation and Server. Which operating system should you use? The answer to this question is easy if you're already running a Windows-based Web server: whatever your server is using! If you're starting from scratch, though, you do have choices.
Windows 95 is the least expensive alternative. Not only is the operating system cheaper to buy, but it also requires substantially less hardware than NT. Using Windows 95, however, is one of those cases in which you get what you pay for. It runs your Web server and Cold Fusion as applications rather than as services, requiring that you log in to start them, and it doesn't offer the multitasking, fault tolerance, or security of NT. You may find this option suitable for providing Web services within a workgroup on a company intranet or in some other low-traffic situation, but you're much better off using NT. You can find a few good Web servers that run on Windows 95 such as WebSite from O'Reilly Software and Netscape FastTrack Server for Windows 95.
Windows NT, on the other hand, provides everything you need for Web services that Windows 95 lacks, for a few dollars more. If you already have Windows NT 3.51 and want to use it as a Web server, be sure to set up Service Pack 4, available from the Microsoft Web site (http://www.microsoft.com/). If you don't yet have Windows NT, the latest version is Windows NT 4.0.
What is the difference between NT Workstation and Server? Both can run Web servers and Cold Fusion. Workstation costs considerably less but is not optimized for running services, and according to its license, you cannot allow more than 10 connections to it at one time. Because most browsers open up to four simultaneous connections, you are in effect limited to three concurrent users. NT Server, although it costs more, is better suited to running services, and it even comes with a capable Web server, FTP server, and Gopher server at no extra charge.
Cold Fusion uses the Common Gateway Interface, or CGI, to communicate with your Web server. Because CGI is an open standard, Cold Fusion should work with any Windows NT- or 95-based server that supports CGI. Many HTTP servers provide other communications interfaces in addition to CGI, but almost every server supports CGI. Cold Fusion has been successfully tested with the following HTTP servers:
In addition to supporting these and other servers through CGI, Cold Fusion also provides modules that communicate directly with Web servers using server-specific APIs, allowing faster responses and less server overhead. You can use server API modules with WebSite 1.1e or Pro, both versions of Internet Information Server, and Netscape FastTrack and Enterprise Servers. For more information about server API modules, read Chapter 29, "Server Modules."
The last major components that you need to use Cold Fusion are, of course, an ODBC-accessible database and drivers with which to access it. Most databases available for Windows 95 and NT can be accessed by ODBC, and ODBC drivers exist for access to databases on other platforms.
Cold Fusion comes with the Microsoft ODBC Desktop Drivers, which support the following databases:
Cold Fusion has also been tested with some of the drivers in the Intersolv DataDirect ODBC Pack:
If you have another ODBC driver that you want to use, it must meet the following criteria:
You can administer ODBC drivers by using the ODBC icon in the Control Panel, which launches the ODBC Administrator shown in Figure 3.1. From here, you can add and modify data sources that are accessed through ODBC. This subject is explained in more detail in the next chapter.
Figure 3.1 The ODBC Administrator lists the installed ODBC drivers in the Drivers window.
You need to know some things about the system on which you're setting up Cold Fusion, especially if it is an NT system. Windows NT is designed as a multiuser system, so you have to have the necessary rights to install and configure software, for instance. If you are not the system administrator for the Web server, you'll have to get the administrator to do this for you.
Figure 3.2 Using the NT Server Manager, you can administer any server on which you have administrative rights. From here, you can start and stop services.
Figure 3.3 CGI path mapping under WebSite shows multihoming mappings to the same directory for different virtual servers.
If you already have a Web server up and running, either on your internal network or the Internet, you may want to skip to the next chapter now. Here, you learn the pieces of information you need to know to use Cold Fusion, as well as Web servers in general.
Transmission Control Protocol/Internet Protocol, or TCP/IP, is the networking protocol that links computers on the Internet and is used by Web servers like yours. For someone to view documents on your Web site, you must have an IP address that the browser can find. IP addresses take the format xxx.xxx.xxx.xxx, where xxx is a number between 1 and 255. If your server is on the Internet, this IP address must be a valid, unique IP address issued by InterNIC. If you're building a Web server on an internal network not connected to the Internet, you can use any address you want. This complex topic is beyond the scope of this book, so you should talk to your network administrator for more information.
On the other hand, if you just want to set up a Web server and Cold Fusion on a single test machine, not connected to any TCP/IP network, for your own use, you can set up TCP/IP on your machine, run your Web server and Cold Fusion, and access it from a Web browser on that machine.
Figure 3.4 TCP/IP Properties selected from the Protocols tab in the uppermost dialog panel. Note that this machine has several IP addresses mapped to a single network card; this is necessary for multihoming.
Setting Up TCP/IP Under NT 4.0. Before you begin setting up and configuring TCP/IP
under NT 4.0, you need administrative rights to your computer and access to the NT
4.0 installation CD. Then follow these steps:
TIP: Under NT 3.51 and early releases of NT 4.0, you can enter only five IP addresses from the Network control panel application, but you can bind up to 16 IP addresses to each network card. In fact, you can bind more than 16 to a card, but that's the limit that Microsoft recom-mends. To add more addresses, run the Registry Editor, regedt32.exe, and then open the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\network_card\Parameters\Tcpip key, where network_card corresponds to your card. Double-click the IP Address value and then add more IP addresses under the ones currently listed.
Setting Up and Configuring TCP/IP Under NT 3.51. The methods of setting up and configuring TCP/IP under NT 3.51 are the same, but the interface is a little different. When you open the Network control panel application shown in Figure 3.5, you can view both installed adapters and software at the same time. Simply follow the procedure outlined in the preceding section. Note also the tip above about binding multiple IP addresses to a single network card.
Figure 3.5 The Network control panel interface under NT 3.51; note that protocols are grouped with all other network software categories, such as services.
Setting Up and Configuring TCP/IP Under Windows 95. No MS Loopback Adapter is
available in Windows 95, but you can use the Dial-Up Adapter, which is used for connecting
to an Internet service provider or a remote network, instead to set up TCP/IP under
Windows 95. In addition, in Windows 95 you cannot bind more than one IP address to
a card, so you can't use multihoming with multiple IP addresses. Some Web servers,
however, do allow multihoming using one IP address.
Follow these steps to set up and configure TCP/IP under Windows 95:
CAUTION: If you're using Dial-Up Networking under Windows 95 and do not have a network card installed, you have to return your IP settings back to those needed by your remote network when you want to connect to it. Most dial-up Internet connections issue you a dynamic IP address that is different each time you connect, so you can't enter a static IP address in the Network control panel application. Instead, you can use the localhost address to run your Web server. The localhost address is always 127.0.0.1, regardless of whether you have a static or dynamic IP address.
Using Cold Fusion is only a small part of the development of a good Web site. You need to know how to set up and manage a Web server and how to develop appropriate content to make your Web site a success. After you learn these topics, you'll find that using Cold Fusion is a tremendously effective way to build dynamic content into your Web.
© Copyright, Macmillan Computer Publishing. All rights reserved.