Configuring ColdFusion


Macromedia has made it relatively easy to configure and administer ColdFusion. Before you can begin coding pages and viewing them in your browser, though, you need to configure your local web server to handle ColdFusion requests and configure a data source that draws data from your database.

Using the Built-in Web Server

When you first set up ColdFusion on your local workstation, you may have configured the web server on your machine to handle ColdFusion requests. If you didn't, or don't know whether you did, you can take a few minutes to ensure that your machine is configured properly for serving web pages.

ColdFusion MX 7 comes with a built-in web server, but its use is limited to development purposes because it can be accessed only via the IP address 127.0.0.1, or if you use the server name localhost. In addition, the only port that the built-in server can use is port 8500.

Therefore, if you wanted to access the ColdFusion Administrator, you would have to use one of the following addresses:

http://127.0.0.1:8500/CFIDE/administrator/index.cfm

http://localhost:8500/CFIDE/administrator/index.cfm

Because of these limitations, the built-in web server isn't very effective in a real-world environment. Therefore, if you are going to be working with ColdFusion beyond your workstation, you need a more powerful server than the server included with ColdFusion. Luckily, ColdFusion can be easily configured to work with other popular web servers such as Microsoft's Internet Information Server (IIS) or Apache's HTTP Server.

Configuring ColdFusion for Use with an Alternative Web Server

Configuring ColdFusion for use with Apache or IIS is an easy process. The basic steps for configuring ColdFusion to work with IIS or Apache Server are

1.

Open the Web Server Configuration Tool by choosing Start, Programs, Macromedia, ColdFusion MX 7, Web Server Configuration Tool.

Tip

If you already have the web server application installed, you can also open the ColdFusion administrator by typing either of the following addresses in your browser:

http://127.0.0.1:8500/CFIDE/administrator/index.cfm

http://localhost:8500/CFIDE/administrator/index.cfm

Note that the reference to port 8500 is required in the URL.

2.

Add a new configuration and select the hostname and server.

3.

Choose either IIS or Apache.

4.

Choose to configure the server for ColdFusion MX applications and click OK.

Tip

For complete instructions on configuring other web server applications for use with ColdFusion, check out the document at the following address:

http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000049.htm


Configuring Data Sources

After you have ColdFusion working with a web server, the next step is to create a conduit that enables you to draw information from a database and display it on your web pages. A data source is essentially a translator that extracts data from the appropriate database and then feeds the data back to the ColdFusion server. Because each database speaks a different "language," it's important to use the correct conduit for your database.

Creating a data source is actually an easy process. The basic steps for creating one are as follows:

1.

Open the ColdFusion Administrator by choosing Start, Programs, ColdFusion Administrator, or by typing http://localhost/CFIDE/administrator in your web browser.

2.

Under Data & Services, click Data Sources (see Figure 17.2).

Figure 17.2. The ColdFusion Administrator's browser-based interface.


3.

In the Data Source Name dialog (see Figure 17.3), provide a name for the System DSN, choose a database driver type from the drop-down menu, and click the Add button.

Figure 17.3. The Add New Data Source dialog.


Caution

Do not use spaces or special characters in your DSN names. If you do, you receive an error when you submit the form.

4.

In the Data Source dialog box, provide the full path to the database file on the ColdFusion server hard disk, or browse to the database file. Figure 17.4 refers to a folder path based on the IIS folder structure. The Database file field displays the path to the database file (only partially visible in the box), which is C:\InetPub\wwwroot\retroscycles\rcdb9984048\retros_cycles_99300d2.mdb.

Figure 17.4. Type the data source name and the path to your database file.


Note

If you are using a web server other that IIS, the path to your database may be different. Most web server applications use a root folder of wwwroot to indicate the location where web pages should be placed to be accessed by the public. Be sure that you enter the correct path to your database file when creating your data source.

Caution

Be careful not to name the location and database something that someone could guess. The last thing you want is some clever person downloading your database fileespecially if you store user information (for example, usernames and passwords) or order information such as credit card numbers.

5.

Click Submit. The ColdFusion Administrator verifies that the data source was created successfully. When the connection is verified, OK appears in the status column for the connection.

In the Administrator, you can use the three Action buttons in this column to edit, verify, or delete the DSN. These actions do not affect the database file itself, but only the DSN.

After you have your web server configured to handle ColdFusion requests and a connection to your database, you're almost ready to open Dreamweaver and begin developing web pages that can display dynamic data. If, however, you are going to use Flash to display dynamic data, there a few other things to consider.



Special Edition Using Macromedia Studio 8
Special Edition Using Macromedia Studio 8
ISBN: 0789733854
EAN: 2147483647
Year: 2003
Pages: 337

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net