Afterburner, AppletAce, Attain, Attain Enterprise Learning System, Attain Essentials, Attain Objects for Dreamweaver,
Authorware, Authorware Attain, Authorware Interactive Studio, Authorware Star, Authorware Synergy, Backstage, Backstage
Designer, Backstage Desktop Studio, Backstage Enterprise Studio, Backstage Internet Studio, ColdFusion, Design in Motion,
Director, Director Multimedia Studio, Doc Around the Clock, Dreamweaver, Dreamweaver Attain, Drumbeat, Drumbeat 2000,
Extreme 3D, Fireworks, Flash, Fontographer, FreeHand, FreeHand Graphics Studio, Generator, Generator Developer's Studio,
Generator Dynamic Graphics Server, JRun, Knowledge Objects, Knowledge Stream, Knowledge Track, Lingo, Live Effects,
Macromedia, Macromedia M Logo & Design, Macromedia Flash, Macromedia Xres, Macromind, Macromind Action, MAGIC,
Mediamaker, Object Authoring, Power Applets, Priority Access, Roundtrip HTML, Scriptlets, SoundEdit, ShockRave,
Shockmachine, Shockwave, Shockwave Remote, Shockwave Internet Studio, Showcase, Tools to Power Your Ideas, Universal
Media, Virtuoso, Web Design 101, Whirlwind and Xtra are trademarks of Macromedia, Inc. and may be registered in the United
States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words or phrases mentioned
within this publication may be trademarks, servicemarks, or tradenames of Macromedia, Inc. or other entities and may be
registered in certain jurisdictions including internationally.
This product includes code licensed from RSA Data Security.
This guide contains links to third-party websites that are not under the control of Macromedia, and Macromedia is not
responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your
own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia
endorses or accepts any responsibility for the content on those third-party sites.
Apple Disclaimer
APPLE COMPUTER, INC. MAKES NO WARRANTIES, EITHER EXPRESS OR IMPLIED, REGARDING THE
ENCLOSED COMPUTER SOFTWARE PACKAGE, ITS MERCHANTABILITY OR ITS FITNESS FOR ANY
PARTICULAR PURPOSE. THE EXCLUSION OF IMPLIED WARRANTIES IS NOT PERMITTED BY SOME STATES.
THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. THIS WARRANTY PROVIDES YOU WITH SPECIFIC LEGAL
RIGHTS. THERE MAY BE OTHER RIGHTS THAT YOU MAY HAVE WHICH VARY FROM STATE TO STATE.
Configuring and Administering ColdFusion MX is intended for anyone who needs to configure and
manage their ColdFusion development environment.
About Macromedia ColdFusion MX documentation
The ColdFusion documentation is designed to provide support for the complete spectrum of
participants.
Documentation set
The ColdFusion documentation set includes the following titles:
BookDescription
Installing and Using
ColdFusion MX
Configuring and
Administering
ColdFusion MX
Developing ColdFusion
MX Applications
Getting Started
Building ColdFusion
MX Applications
CFML ReferenceProvides descriptions, syntax, usage, and code examples for all ColdFusion
CFML Quick Reference A brief guide that shows the syntax of ColdFusion tags, functions, and variables.
Describes system installation and basic configuration for Windows, Solaris,
Linux, and HP-UX.
Part I describes how to manage the ColdFusion environment, including
connecting to your data sources and configuring security for your applications.
Part II describes Verity search tools and utilities that you can use for configuring
the Verity K2 Server search engine, as well as creating, managing, and
troubleshooting Verity collections.
Describes how to develop your dynamic web applications, including retrieving
and updating your data, using structures, and forms.
Contains an overview of ColdFusion features and application development
procedures. Includes a tutorial that guides you through the process of
developing an example ColdFusion application.
tags, functions, and variables.
Viewing online documentation
All ColdFusion MX documentation is available online in HTML and Adobe Acrobat Portable
Document Format (PDF) files. Go to the documentation home page for ColdFusion MX on the
Macromedia website: www.macromedia.com.
10Introduction
PART I
Administering ColdFusion MX
This part describes how to use the ColdFusion MX Administrator to manage
the ColdFusion environment, including connecting to your data sources and
configuring security for your applications
The ColdFusion MX Administrator provides a browser-based interface for managing your
ColdFusion environment. You can configure many settings to provide optimal levels of security
and functionality. The available options are based on your edition of ColdFusion: Standard or
Enterprise, as well as your configuration: server or J2EE.
The default location for the ColdFusion MX Administrator login page is:
http://servername/CFIDE/administrator/index.cfm
In the previous URL, servername is the fully qualified domain name of your web server. Common
values for servername are localhost or 127.0.0.1 (each refers to the web server on the local
computer).
If you are using the ColdFusion built-in web server, include the port number as part of the
servername. The default port number is 8500. For example, http://servername:8500/CFIDE/
administrator/index.cfm.
If you are using the J2EE configuration, include the port number used the J2EE application
server’s web server. For example, http: //servername:8100/CFIDE/administrator/index.cfm.
If your ColdFusion MX Administrator is on a remote computer, use the DNS name or IP address
of the remote host.
To access the ColdFusion MX Administrator, enter the password specified when you installed
ColdFusion MX.
13
Accessing user assistance
You can obtain assistance from the ColdFusion MX Administrator in the following ways:
• Online Help You access the context-sensitive online Help by clicking the question-mark icon
on any ColdFusion MX Administrator page. The online Help has procedural and brief
overview content for the ColdFusion MX Administrator page that you are viewing. This
information appears in a new browser window and contains standard Contents, Index, and
Search tabs.
• Documentation Click the link to access the entire ColdFusion MX documentation set
online.
• Examples The example applications provide samples for you to learn about ColdFusion
MX.
• Tech notes You can access the collection of articles about ColdFusion MX from the
Macromedia website.
Administrator layout
The home page of the ColdFusion MX Administrator includes links to Documentation, the
Macromedia Servers TechNotes Knowledge Base, Release Notes, System Information, online
Help, and Code Examples.
The tasks that you perform in the ColdFusion MX Administrator are grouped into the following
sections. Each section contains links to pages for managing aspects of the system.
• Server Settings Manage whitespace, client and memory variables, locking, and mappings.
Register a mail server and configure mail logging. Configure your JVM, the ColdFusion
charting and graphing engine, and create and manage archives.
• Data & Services Configure data sources, Verity collections, and the Verity K2 Server.
Define mappings to web services.
• Debugging & Logging Manage options that can assist you in troubleshooting your
ColdFusion applications. Manage scheduled tasks, system probes, and a variety of log files and
server statistics. Run the Code Compatibility Analyzer to assist you in migrating older
ColdFusion applications.
• Extensions Configure and register Java Applets, CORBA ORBs, and CFX Tags.
• Security Control passwords for ColdFusion MX Administrator and Remote Development
Services (RDS) access. Restrict the use of resources, such as data sources.
For more information about each section, see Chapter 2, “Basic ColdFusion MX
Administration,” on page 17.
Server Settings section
The Server Settings section contains the following areas:
• Settings Manage the number of simultaneous requests, request timeouts, whitespace, and
handlers.
• Caching Manage caching options for memory, database connection time, the number of
cached queries, and using a trusted template cache.
14Chapter 1: Administering ColdFusion MX
• Client Variables Configure an external data source, the operating system registry, or web
browser cookies to store client variables. These can use and store information about a client
browsing your site to provide customized page content.
• Memory Variables Specify timeout values for Application and Session variables. These
variables are stored in RAM and maintain information throughout a ColdFusion session.
• Mappings Create logical aliases for physical directories on your server. One of your first tasks
after installing ColdFusion is to configure the mapping for your web server.
• Mail Server Configure the mail server that ColdFusion uses to send dynamic mail messages
using SMTP (Simple Mail Transfer Protocol). Specify backup mail servers for failover and
manage concurrent threads (Enterprise Edition only).
• Charting Specify caching and thread settings for the ColdFusion charting and graphing
engine.
• Java and JVM Settings Manage Java Virtual Machine settings such as paths, heap sizes,
and implementation options. Not available in the J2EE configuration.
• Archives and Deployment Create and deploy application archives.
• Settings Summary View the status of all ColdFusion configuration settings. You can
navigate to a particular area of the ColdFusion MX Administrator by clicking its name.
Data & Services section
The Data & Services section contains the following pages:
• Data Sources Create and manage your data sources. You can specify login parameters,
connection information, and restrict certain SQL operations. For more information, see
Chapter 3, “Data Source Management,” on page 37.
• Verity Collections Create and manage your Verity collections. Search engines for your
ColdFusion applications use these indexes of various files within specified directories.
• Verity K2 Server Configure the Host Name and Port settings for your K2 Server. This
specialized server is optimized for high-performance Verity searches.
• Web Services Define a mapping to the location of a web service.
Debugging & Logging section
The Debugging & Logging section contains the following pages:
• Debugging Settings Enable and configure information to help you diagnose ColdFusion
page failures. You can return information on items such as template stack, database activity,
and variable values.
• Debugging IP Addresses Control which IP addresses receive debug messages.
• Logging Settings Specify the directory for your log files, and whether to write some
ColdFusion log messages to the operating system’s logging facility (such as EventLog for
Windows and syslog for UNIX).
• Log Files Search, view, download, schedule, archive, or delete a file from a list of all available
log files.
• Scheduled Tasks Add, edit, or delete scheduled tasks. These tasks are helpful for such items
as daily reports, inventories, and statistical reports.
Administrator layout15
• System Probes Manage probes that monitor your application’s status. If a potential
problem is detected, a system probe can send an alert e-mail message and execute a recovery
script.
• Code Analyzer Evaluate application code for potential incompatibilities between
ColdFusion MX and ColdFusion Server 5.
Extensions section
The Extensions section contains the following pages:
• Java Applets Register, edit, or delete Java applets. You must register a Java applet prior to
adding it to your CFFORM forms using the
cfapplet tag.
• CFX Tags Register, edit, or delete C++ and Java custom tags.
• Custom Tag Paths Register the paths that contain your custom tags.
• CORBA Connectors Register, edit, or delete CORBA connectors. You can also specify ORB
initialization options.
Security section
The Security section contains the following pages:
• CF Admin Password Set the password for the administrator.
• RDS Password Set the password for Dreamweaver MX and CF Studio users connecting to
ColdFusion.
• Sandbox Security Restrict access to ColdFusion resources such as data sources, tags,
functions, files and directories, and IP addresses. This is called Resource Security in
ColdFusion MX Standard Edition.
For more information, see Chapter 5, “Administering Security,” on page 69.
16Chapter 1: Administering ColdFusion MX
CHAPTER 2
Basic ColdFusion MX Administration
This chapter explains the basic ColdFusion MX administration tasks, following the structure of
Immediately after installing ColdFusion MX, you might have to perform some or all of the
administrative tasks described in the following table:
TaskDescription
Establish database
connections
Specify directory
mappings
Configure debugging
settings
ColdFusion applications require data source connections to query and
write to databases. To create, verify, edit, and delete database
connections, use the Data Sources pages in the Administrator.
For more information, see Chapter 3, “Data Source Management,”
on page 37.
Directory mappings redirect relative file paths to physical directories on
your server. To specify server-wide directory aliases, use the Mappings
page in the Administrator.
For more information, see “Mappings page” on page 22.
Debugging information provides important data about CFML page
processing. To choose the debugging information to display, and to
designate an IP address to receive debugging information, use the
Debugging & Logging section of the Administrator.
For more information, see “Debugging Settings page” on page 28.
17
TaskDescription
Set up e-mailE-mail lets ColdFusion MX and ColdFusion applications send automated
Change passwordsYou might have to change the passwords that you set for the ColdFusion
Configure Java settings Java and Java applets require configuring Java settings, such as JVM
Restrict tag accessSome CFML tags might present a potential security risk for your server. To
mail messages. To configure an e-mail server and mail options, use the
Mail Server page of the Administrator.
For more information, see “Mail Server page” on page 23.
MX Administrator and RDS during ColdFusion MX installation. To change
passwords, use the Security section of the Administrator.
For more information, see “CF Admin Password page” on page 34 and
“RDS Password page” on page 34.
paths. To change Java settings, use the Java and JVM page of the
Administrator.
For more information, see “Extensions section” on page 33.
disable certain tags, use the Sandbox Security page of the Administrator.
For more information, see “Administering Security” on page 69.
Server Settings section
The Server Settings section lets you manage client and memory variables, mappings, charting,
and archiving. You also configure mail and Java settings in this section.
Settings page
The Settings page of the ColdFusion MX Administrator contains configuration options that you
can set or enable to manage ColdFusion MX. These options can significantly affect server
performance. The following table describes the settings:
Use UUID for cftokenSpecify whether to use a universally unique identifier (UUID), rather
Enable HTTP status codes Select this option to configure ColdFusion MX to set a status code of
Enable Whitespace
Management
(Server configuration only)
18Chapter 2: Basic ColdFusion MX Administration
Enter a number to limit simultaneous requests to ColdFusion MX.
When the server reaches the limit, requests are queued and handled in
the order received. Limiting the number of simultaneous requests can
improve performance.
Enable this option to prevent unusually lengthy requests from using up
server resources. Enter a limit to the time that ColdFusion MX waits
before terminating a request. Requests that take longer than the
timeout period are terminated.
than a random number, for a cftoken.
500 Internal Server Error for an unhandled error. Disable this option to
configure ColdFusion MX to set a status code of 200 OK for
everything, including unhandled errors.
Enable this option to compress runs of spaces, tabs and carriage
return/line feeds. Compressing whitespace can significantly compact
the output of a ColdFusion page.
SettingDescription
Missing Template Handler Specify a page to execute when ColdFusion MX cannot find a
Site-wide Error HandlerSpecify a page to execute when ColdFusion MX encounters an error
requested page. This specification is relative to the web root.
If the user is running Internet Explorer with "Show Friendly HTTP error
messages" enabled in advanced settings (the default), Internet
Explorer will only display this page if it contains more than 512 bytes.
while processing a request. This specification is relative to the web
root. If the user is running Internet Explorer with "Show Friendly HTTP
error messages" enabled in advanced settings (the default), Internet
Explorer will only display this page if it contains more than 512 bytes.
Caching page
The Caching page of the Administrator contains configuration options that you can set or enable
to cache templates, queries, and data sources
. These options can significantly affect server
performance. The following table describes the settings:
SettingDescription
Template cache size
(number of templates)
Trusted cacheEnable this option if you want ColdFusion MX to use cached templates
Save Class FilesSelect this option to save to disk the class files generated by the
Cache web server paths
(Server configuration only)
Limit the maximum number
of cached queries on the
server to [n] queries
Enable this option to limit the memory reserved for template caching.
For best performance, set this to a value that is large enough to contain
your application’s commonly accessed ColdFusion pages, yet small
enough to avoid excessive reloading. You can experiment with a range
of values on your development server; a suitable starting point is one
page per MB of JVM size.
without checking whether they changed. For sites that are not updated
frequently, using this option minimizes file system overhead.
ColdFusion bytecode compiler. During the development phase, it is
typically faster to disable this option.
Select this option to cache ColdFusion page paths for a single server.
Deselect this option if ColdFusion MX connects to a web server with
multiple websites or multiple virtual websites.
Enable this option by entering a value to limit the maximum number of
cached queries that the server maintains. Cached queries allow
retrieval of result sets from memory rather than through a database
transaction. Because queries reside in memory, and query result set
sizes differ, you must provide a limit for the number of cached queries.
You enable cached queries with the
attributes of the
cfquery tag.
cachedwithin or cachedafter
Server Settings section19
Client Variables page
Client variables let you store user information and preferences between sessions. Using
information from client variables, you can customize page content for individual users.
You enable client variable default settings in ColdFusion MX on the Client Variables page of the
Administrator. ColdFusion MX lets you store client variables in the following ways:
• In database tables
If your data source uses one of the JDBC drivers bundled with ColdFusion, ColdFusion can
automatically create the necessary tables. If your data source uses the ODBC Socket or a thirdparty JDBC driver, you must manually create the necessary CDATA and CGLOBAL database
tables. For more information, see Developing ColdFusion MX Applications.
• As cookies in users’ web browsers
• In the operating system registry
Caution: Macromedia recommends that you do not store client variables in the registry because it
can critically degrade performance of the server. If you do use the registry to store client variables,
you must allocate sufficient memory and disk space.
You can override settings specified in the Client Variables page using the attributes of the
cfapplication tag. For more information, see Developing ColdFusion MX Applications.
The following table compares these storage options:
Storage typeAdvantagesDisadvantages
Data source• Can use existing data source
• Portable: not tied to the host
system or operating system
Browser cookies • Simple implementation
• Good performance
• Can be set to expire automatically
• Client-side control
System registry• Simple implementation
• Good performance
• Registry can be exported easily to
other systems
• Server-side control
• Requires database transaction to read/
write variables
• More complex to implement
• Users can configure browsers to
disallow cookies
• Cookie data to is limited to 4 KB
• Netscape Navigator allows only 20
cookies from one host; ColdFusion MX
uses three cookies to store read-only
data, leaving only 17 cookies available
• Possible restriction of the registry’s
maximum size limit in Windows in the
Control Panel
• Integrated with the host system: not
practical for clustered servers
• Solaris, Linux, and HP-UX registries are
text files. Their registries deliver slow
performance and low scalability.
20Chapter 2: Basic ColdFusion MX Administration
Migrating client variable data
To migrate your client variable data to another data source, you should know the structure of the
database tables that store this information. Client variables stored externally use two simple
database tables, like those shown in the following tables:
CDATA Table
ColumnData type
cfidCHAR(64), TEXT, VARCHAR, or equivalent
appCHAR(64), TEXT, VARCHAR, or equivalent
dataMEMO, LONGTEXT, LONG VARCHAR, or equivalent
CGLOBAL Table
ColumnData type
cfidCHAR(64), TEXT, VARCHAR, or equivalent
dataMEMO, LONGTEXT, LONG VARCHAR, or equivalent
lvisitTIMESTAMP, DATETIME, DATE, or equivalent
Creating client variable tables
Use the following sample ColdFusion page as a model for creating client variable database tables
in your own database. However, keep in mind that not all databases support the same column
data type names. For the proper data type, see your database documentation.
Tip: The ColdFusion MX Administrator can create client variable tables for data sources that use
bundled JDBC drivers. For more information, see the online Help.
Sample table creation page
<!---- Create the Client variable storage tables in a datasource.
This example applies to Microsoft Access databases --->
You use the Memory Variables page of the ColdFusion Administrator to enable application and
session variables server-wide. By default, application and session variables are enabled when you
install ColdFusion MX. If you disable either type of variable in the Memory Variables page, you
cannot use them in a ColdFusion application.
You can specify maximum and default timeout values for session and application variables. Unless
you define a timeout value in Application.cfm, application variables expire in two days. Session
variables expire when user sessions end. To change these behaviors, enter new default and
maximum timeout values on the Memory Variables page of the Administrator.
Note: Timeout values that you specify for application variables override the timeout values set in
Application.cfm.
You can also specify whether to use J2EE session variables. When you enable the J2EE session
variables, ColdFusion creates an identifier for each session and does not use the CFToken or
CFID cookie value. For more information, see Developing ColdFusion MX Applications.
Mappings page
You use the Mappings page of the ColdFusion MX Administrator to add, update, and delete
logical aliases for paths to directories on your server. ColdFusion mappings apply only to pages
processed by ColdFusion MX with the
cfinclude and cfmodule tags. If you save CFML pages
outside of the web_root (or whatever directory is mapped to "/"), you must add a mapping to the
location of those files on your server.
Assume that the "/" mapping on your server points to C:\CFusionMX\wwwroot, but all your
ColdFusion header pages reside in c:\2002\newpages\headers. In order for ColdFusion MX to
find your header pages, you must add a mapping in the ColdFusion Administrator that points to
c:\2002\newpages\headers (for example, add a mapping for /headers that points to
c:\2002\newpages\headers). In the ColdFusion pages located in C:\CFusionMX\wwwroot, you
reference these header pages using /headers in your
Note: ColdFusion mappings are different from web server virtual directories. For information on
creating a virtual directory to access a given directory using a URL in your web browser, consult your
web server’s documentation.
22Chapter 2: Basic ColdFusion MX Administration
cfinclude and cfmodule tags.
Mail Server page
You use the Mail Server page of the ColdFusion MX Administrator to specify a mail server to
send automated e-mail messages. ColdFusion MX supports the Simple Mail Transfer Protocol
(SMTP) for sending e-mail messages and the Post Office Protocol (POP) for retrieving e-mail
messages from your mail server. To use e-mail messaging in your ColdFusion applications, you
must have access to an SMTP server and/or a POP account.
The ColdFusion MX Enterprise edition supports mail server failover as well as additional mail
delivery options.
The ColdFusion implementation of SMTP mail uses a spooled architecture. This means that
when a
cfmail tag is processed in an application page, the messages generated might not be sent
immediately. If ColdFusion is extremely busy or has a large queue, delivery could occur after some
delay.
Note: For more information about the cfmail tag, see Developing ColdFusion MX Applications.
Mail Connection Settings area
Select preferences for handling mail logs, as described in the following table:
SettingDescription
Mail ServerLets you enter a valid mail server for sending dynamic SMTP mail
messages in the text box. You can enter an Internet address, such as
mail.company.com or the IP address of the mail server, such as 127.0.0.1.
Server PortEnter the number of the port on which the mail server is running. Contact
your server administrator if you are unsure of the appropriate port number.
Verify Mail Server
Connection
Backup Mail Servers
(Enterprise Edition only)
Maintain Connection to
Mail Server
(Enterprise Edition only)
Connection Timeout
(seconds)
Spool Interval (seconds) Enter the number of seconds at which you want the mail server to process
Mail Delivery Threads
(Enterprise Edition only)
Select this option to verify that ColdFusion MX can connect to your
specified mail server after you submit this form.
Whether or not you use this option, you should verify that your mail server
connection works by sending a test message.
Enter zero or more backup servers for sending SMTP mail messages.
You can enter an Internet address, such as mail.company.com, or the IP
address of the mail server, such as 127.0.0.1. Separate multiple servers
with a comma.
If the mail server requires authentication, prefix the mail server with the
username and password, as follows:
username:password@mailserveraddress.
To use a port number other than the default (25), specify
mailserveraddress:portnumber.
Select this option to keep mail server connections open after sending a
mail message. Enabling this option can enhance performance when
delivering multiple messages.
Enter the number of seconds that ColdFusion MX should wait for a
response from the mail server.
spooled mail.
The maximum number of simultaneous threads used to deliver spooled
mail.
Server Settings section23
SettingDescription
Spool mail messages for
delivery
(Memory spooling
available for Enterprise
Edition only)
Maximum number of
messages spooled to
memory
(Enterprise Edition only)
Select this option to route outgoing mail messages to the mail spooler. If
you disable this option, ColdFusion MX delivers outgoing mail messages
immediately. In ColdFusion MX Enterprise Edition, you can spool
messages either to disk (slower, but messages persist across shutdowns)
or to memory (faster, but messages do not persist).
You can override this setting in the
Enter the maximum number of messages ColdFusion MX will spool to
memory before switching to disk spooling.
cfmail tag.
Mail Logging Settings area
Select preferences for handling mail logs, as described in the following table:
SettingDescription
Error Log SeverityFrom the drop-down list box, select the type of SMTP-related error
Log all e-mail messages
sent by ColdFusion MX
message to write to a log file. The options are: Debug, Warning, Debug,
Information, and Error.
Enable this option to save to a log file the To, From, and Subject fields of
all e-mail messages.
ColdFusion MX writes sent mail and mail error logs to either of the following directories:
• \CFusionMX\logs, in Windows
• /opt/coldfusionmx/log, on Solaris, Linux, and HP-UX
The following table describes the e-mail log files:
LogDescription
mailsent.logRecords sent e-mail messages
mail.logRecords general e-mail errors
Charting Settings page
The ColdFusion charting and graphing engine lets you produce highly customizable business
graphics, in a variety of formats, using the
cfquery tag. You use the Charting page in the
Administrator to control characteristics of the engine.
The following table describes the caching and thread settings for the ColdFusion charting and
graphing engine:
SettingDescription
Cache TypeSet the cache type. Charts can be cached either in memory or to disk. In
memory caching is faster, but more memory intensive.
Maximum number of
images in cache
24Chapter 2: Basic ColdFusion MX Administration
Specify the maximum number of charts to store in the cache. After the
cache is full, if you generate a new chart, ColdFusion discards the oldest
chart in the cache.
SettingDescription
Max number of charting
threads
Disk cache locationWhen caching to disk, specify the directory in which to store the
Specify the maximum number of chart requests that can be processed
concurrently. The minimum number is 1 and the maximum is 5. Higher
numbers are more memory intensive.
generated charts.
Java and JVM Settings page
The Java and JVM Settings page lets you specify the following settings, which enable ColdFusion
MX to work with Java:
SettingDescription
Java Virtual Machine PathThe absolute file path to the location of the Java virtual machine
(JVM) root directory. Default is cf_root/runtime/jre.
Maximum Memory Size The JVM maximum heap size. Default is 512 MB.
Class PathThe file paths to the directories that contain the JAR files used by
ColdFusion MX. Specify either the fully qualified name of a
directory that contains your JAR files or a fully qualified JAR file
name. Use a comma to separate multiple entries.
JVM ArgumentsThe arguments to the JVM. Use a space to separate multiple
entries; for example, -Xint -Xincgc
Before ColdFusion saves your changes, it saves a copy of the current cf_root/runtime/bin/
jvm.config file as jvm.bak. If your changes prevent ColdFusion from restarting, use jvm.bak to
restore your system. For more information, see the online Help.
Note: This page is not enabled in the J2EE configuration.
Archives and Deployment page
The Archives and Deployment page includes tools that let you archive and deploy ColdFusion
applications, configuration settings, data source information, and other types of information to
back up your files quickly and easily. The complete list of archivable information includes the
following:
• Name and file location
• Server settings
• ColdFusion mappings
• Data sources
• Verity collections
• Scheduled tasks
• Java applets
• CFX tags
• Archive to do lists
Server Settings section25
After you archive the information, you can use the Administrator to deploy your web applications
to the same ColdFusion MX server or to a ColdFusion MX server running on a different
computer. Additionally, you can use these features to deploy and receive any ColdFusion archive
file electronically.
The Archive Settings page in the Administrator lets you configure various archive system settings
that apply to all archive and deploy operations. For more information, see the online Help.
Settings Summary page
The Settings Summary page shows all ColdFusion configuration settings. Click a group name to
open that group’s Administrator section, where you can edit settings. This page is not enabled in
the Standard Edition.
Data & Services section
The Data & Services section of the Administrator is the interface between you, ColdFusion MX,
data sources, and Verity search and indexing features. The following table describes some
common tasks that you can perform in the Data & Services section of the Administrator:
TaskDescription
Create and manage
JDBC data sources
Create and maintain
Verity collections
Register a Verity K2
Server with ColdFusion
MX
Define mappings for web
services
The Data Sources page lets you establish, edit, and delete JDBC data
source connections for ColdFusion MX. For more information, see
Chapter 3, “Data Source Management,” on page 37.
The Verity Collections page lets you create and delete Verity collections
and perform maintenance operations on collections that you create. For
more information, see “Verity Collections page” on page 26.
The Verity K2 Server page lets you register a K2 Server to use with
ColdFusion MX. For more information, see “Verity K2 Server page”
on page 27.
Web services let you produce and consume remote application
functionality over the internet. For more information, see “Web Services
page” on page 27.
Data Sources page
The Data Sources page lets you create, edit, and delete data sources. Before you can use a database
in a ColdFusion application, you must register the data source in the ColdFusion MX
Administrator. For more information,
see Chapter 3, “Data Source Management,” on page 37.
Verity Collections page
The Verity Development Kit (VDK) provides indexing and searching technology to create,
populate, and manage collections of indexed data that are optimized for fast and efficient site
searches. It is available on the Verity Collections page.
A collection is a logical group of documents and metadata about the documents. The metadata
includes word indexes, an internal documents table of document field information, and logical
pointers to the document files.
26Chapter 2: Basic ColdFusion MX Administration
For more information about building search interfaces, see the chapters about the cfindex,
cfsearch, and cfcollection tags in Developing ColdFusion MX Applications.
ColdFusion lets you manage your collections from the Administrator. You can index, repair,
optimize, purge, or delete Verity collections that are connected to ColdFusion. You use the
buttons along the bottom of the Connected Verity Collections table to perform the following
actions:
ActionDescription
IndexAnalyzes the files in a collection and assembles metadata and pointers to the files.
RepairRe-indexes a collection to fix broken links and update indexes.
OptimizeReclaims space left by deleted and changed files by consolidating collection indexes
for faster searching. You should optimize collections regularly.
PurgeDeletes all documents in a collection, but not the collection itself. Leaves the collection
directory structure intact.
DeleteDeletes a collection.
Note: Before performing management operations, ensure that the K2 Server is not using the
collections. For more information, see “Administering Verity” on page 83.
Verity K2 Server page
For faster searching, configure a K2 Server in the ColdFusion MX Administrator. The highperformance K2 Server caches collection information so that your searches retrieve documents
more quickly. The Verity K2 Server delivers rapid search results in a highly efficient and scalable
architecture.
For more information on configuring and using K2 Server with ColdFusion, see
Verity” on page 83
.
“Administering
Web Services page
You can use web services to produce and consume remote application functionality over the
Internet. The ColdFusion MX Administrator lets you register web services so that you do not
have to specify the entire Web Services Description Language (WSDL) URL when you reference
the web service. The first time you reference a web service, ColdFusion MX automatically
registers it in the Administrator.
When you register a web service, you can shorten your code and change a web service’s URL
without editing your code. For more information, see Developing ColdFusion MX Applications.
Debugging & Logging section
You use the Debugging Settings and Debugging IPs pages of the Administrator to configure
ColdFusion MX to provide debugging information for every application page requested by a
browser. You specify debugging preferences using the pages as follows:
• On the Debugging Settings page, select debugging output options. If debugging is enabled, the
output appears in block format after normal page output.
• On the Debugging IPs page, restrict access to debugging output. If a debugging option is
enabled, debugging output is visible to all users by default.
Debugging & Logging section27
This section also includes pages for managing your Log Files, Scheduled Tasks, System Probes,
and the Code Compatibility Analyzer.
Debugging Settings page
The Debugging Settings page provides the following debugging options:
SettingDescription
Enable Robust Exception
Information
Enable DebuggingEnables the ColdFusion debugging service.
Select Debugging Output FormatSelect a format of:
Report stack trace to a depth of [n]
rows
Database Activity Shows the database activity for the SQL Query events and
Exception InformationShows all ColdFusion exceptions raised for the request in the
Tracing InformationShows trace event information in the debugging output.
VariablesDisplays information about parameters, URL parameters,
Displays detailed information in the exceptions page, including
the template’s physical path and URI, the line number and
snippet, the SQL statement used (if any), the data source
name (if any), and the Java stack trace.
• classic.cfm - The format available in ColdFusion 5 and
earlier. It provides a basic view and few browser restrictions.
• dockable.cfm - A dockable tree-based debugging panel.
For details about the panel and browser restrictions, see the
online Help.
Reports execution times. The stack trace shows a hierarchical
tree of executed templates, includes, modules, and custom
tags that were executing at the time of the exception. The
default is 5. A blank value or 0 implies no limit.
Stored Procedure events in the debugging output.
debugging output.
Tracing lets you track program flow and efficiency through the
use of the
cookies, session, and CGI variables in the debugging output.
Lets visitors view detailed information in the exceptions page,
including: the template’s physical path and URI, the line
number and snippet, the SQL statement used (if any), the
Data Source Name (if any), and the Java stack trace.
Enables the standard NT Performance Monitor application to
display information about a running ColdFusion Application
Server.
Shows performance information on platforms that do not
support the NT Performance Monitor. For more information,
see “Using the cfstat utility” on page 29.
cftrace tag.
* Restart ColdFusion MX after changing this setting.
28Chapter 2: Basic ColdFusion MX Administration
Using the cfstat utility
The cfstat command-line utility provides real-time performance metrics for ColdFusion MX.
Using a socket connection to obtain metric data, the cfstat utility displays the information that
ColdFusion MX writes to the System Monitor without actually using the System Monitor
application. The following table lists the metrics that cfstat returns:
Metric
abbreviationMetric nameDescription
Pg/SecPage hits per secondThe number of ColdFusion pages processed
DB/SecDatabase accesses per
second
CP/SecCache pops per secondThe number of ColdFusion template cache
Req Q'edNumber of queued requestsThe number of requests that are currently
Req Run'gNumber of running requestsThe number of requests that ColdFusion MX is
Req TO'edNumber of timed out requests The total number of ColdFusion requests that
AvgQ TimeAverage queue timeA running average of the time, in milliseconds,
AvgReq TimeAverage request timeA running average of the time, in milliseconds,
AvgDB TimeAverage database transaction
time
per second. You can reduce this by moving
static content to HTML pages.
The number of database accesses per second
made by ColdFusion MX. Any difference in
complexity and resource load between calls is
ignored.
pops per second. A cache pop occurs when
ColdFusion MX ejects a cached template from
the template cache to make room for a new
template.
waiting for ColdFusion MX to process them.
Lower values, which you can achieve with
efficient CFML, are better.
currently actively processing.
have timed out. Lower values, which you can
achieve by aggressive caching, removing
unnecessary dynamic operations and thirdparty events, are better.
that requests spend waiting for ColdFusion MX
to process them. Lower values, which you can
achieve with efficient CFML and enhanced
caching, are better.
that ColdFusion MX spends to process a
request (including queued time). Lower values,
which you can achieve with efficient CFML, are
better.
A running average of the time that ColdFusion
MX spends on database-related processing of
ColdFusion requests.
Debugging & Logging section29
Metric
abbreviationMetric nameDescription
Bytes In/SecBytes incoming per secondThe number of bytes that ColdFusion MX read
in the last second (not an average).
Bytes Out/SecBytes outgoing per secondThe number of bytes that ColdFusion MX wrote
in the last second (not an average).
Before you use the cfstat utility, ensure that you selected the Enable Performance Monitoring
check box in the ColdFusion MX Administrator (on the Debugging & Logging > Debugging Settings page). If you select this check box, you must restart ColdFusion MX for this change to
take effect.
Your cfusionmx\bin directory contains the cfstat utility. From that directory, type cfstat and use
the following available switches:
SwitchDescription/Comment
-nSuppress column headers (useful for saving output to a file).
-sDisplay output in a single line (delay display of the first line so cfstat can display
#Where # is an integer, delay display output by # seconds. If you do not specify an
-hWeb server hostname (localhost is the default).
-pWeb server listening port number (80 is the default).
meaningful values in the per-second counters).
integer, cfstat returns one line.
Debugging IP Addresses page
You use the Debugging IP Addresses page to restrict debugging output to one or more IP
addresses. You can add and remove IP addresses.
Note: If you do not specify IP addresses, and debugging options are active, debugging output is
displayed for all users.
30Chapter 2: Basic ColdFusion MX Administration
Logging Settings page
You use the Logging Settings page of the Administrator to change ColdFusion MX logging
options. The following table describes the settings:
SettingDescription
Log directory*Directory to which error log files are written.
Maximum file size (kb) Set the maximum file size for log files. Once a file hits this size, it will be
automatically archived.
Maximum number of
archives
Log slow pages taking
longer than [n]
seconds
Log all CORBA callsLog all CORBA calls.
Enable logging for
scheduled tasks
* Restart ColdFusion MX after changing this setting.
Set the maximum number of log archives to create. After reaching this limit,
files will be deleted in order of oldest to newest.
Log the names of pages that take longer than the specified interval to
process. Logging slow pages can help you diagnose potential problems or
bottlenecks in your ColdFusion applications. Entries are written to
server.log.
Log ColdFusion Executive task scheduling.
Log Files page
The Log Files page of the Administrator lets you perform operations on log files, such as
searching, viewing, downloading, archiving, and deleting.
Click on a Log File icon, located in the Actions column of the Available Log Files table, to search,
view, download, archive, or delete a log file.
For more information, see the online Help.
The following table describes the ColdFusion MX log files:
Log Description
rdservice.logRecords errors occurring in the ColdFusion Remote Development Services
(RDS). This service provides remote HTTP-based access to files and
databases.
application.logRecords every ColdFusion MX error reported to a user. Application page errors,
including ColdFusion MX syntax, ODBC, and SQL errors are written to the log
file.
webserver.logRecords errors that occur in the web server and the ColdFusion MX stub.
exceptions.log Records stacktraces for exceptions that occur in the server.
scheduler.logRecords scheduled events that have been submitted for execution. Indicates
whether task submission was initiated and whether it succeeded. Provides the
scheduled page URL, the date and time executed, and a task ID.
server.logRecords errors for ColdFusion MX.
customtag.logRecords errors generated in custom tag processing.
Debugging & Logging section31
Log Description
car.logRecords errors associated with Site Archive and Restore operations.
mail.logRecords errors generated by an SMTP mail server.
mailsent.logRecords messages sent by ColdFusion MX.
flash.logRecords entries for Flash Remoting.
Scheduled Tasks page
You use the Scheduled Tasks page to schedule the execution of local and remote web pages and to
generate static HTML pages. The scheduling facility is useful for applications that do not require
user interactions or customized output. ColdFusion developers use this facility to schedule daily
sales reports, corporate directories, statistical reports, and so on.
Information that is read more often than written is a good candidate for scheduled tasks. Instead
of executing a query to a database every time the page is requested, ColdFusion MX renders the
static page with information generated by the scheduled event. Response time is faster because no
database transaction takes place.
You can run scheduled tasks once; on a specified date; or at a specified time, daily, weekly, or
monthly. You can run a scheduled task daily, at a specified interval, or between specified dates.
The Schedule Task page lets you create, edit, and delete scheduled tasks. For more information,
see the online Help.
System Probes page
System probes help you evaluate the status of your ColdFusion applications. Like scheduled tasks,
they access a URL at a specified interval, but they can also check for the presence or absence of a
string in the URL. If the URL contents are unexpected, or if an error occurred while accessing the
URL, the probe can send an e-mail alert to the address specified in the System Probes page. The
probe can also execute a script to perform a recovery action, such as restarting the server. All probe
actions are logged in logs/probes.log. The System Probes page also displays the status of each
probe.
You use the buttons in the Actions column in the System Probes table to perform the following
actions:
ActionDescription
EditLets you edit the probe.
RunRuns the probe immediately, even if it was previously disabled.
Enable/
Disable
DeleteDeletes the probe.
Starts and stops the probe from automatically executing at its specified interval.
Because probes run as scheduled ColdFusion tasks, they will not run if the ColdFusion MX server
on which they are hosted crashes, or if the host web server crashes or otherwise does not respond.
32Chapter 2: Basic ColdFusion MX Administration
Code Compatibility Analyzer page
The Code Compatibility Analyzer evaluates your ColdFusion pages for potential
incompatibilities between ColdFusion MX and ColdFusion Server 5.
Extensions section
You use the Extensions section of the Administrator to configure ColdFusion MX to work with
other technologies, such as Java and CORBA. This section contains the Java Applets, CFX Tags,
Custom Tag Paths, and CORBA Connectors pages.
Java Applets page
The Java Applets page of the Administrator lets you register applets and edit and delete applet
registrations. Before you can use Java applets in your ColdFusion applications, you must register
them in the Java Applets page.
When your applet is registered with ColdFusion MX, using the
cfapplet tag in your CFML
code is very simple, because all parameters are predefined. Simply enter the applet source and the
form variable name you want to use.
Note: Parameters set in the cfapplet tag override parameters defined in the Java Applets page.
For more information, see the online Help.
CFX Tags page
Before you can use a CFX tag in ColdFusion applications, you must register it. You use the CFX
Tags page to register and manage ColdFusion custom tags built with C++ and Java.
You can build CFX tags in the following two ways:
• Using C++ as a dynamic link library (DLL) in Windows; as shared objects (so/sl) on Solaris,
Linux, and HP-UX
• Using Java interfaces defined within the cfx.jar file
For more information, see the online Help.
Custom Tag Paths page
You use the Custom Tag Paths page of the Administrator to add, edit, and delete custom tag
directory paths. The default custom tag path is under the installation directory. To use custom
tags in another path, register the path on this Administrator page.
For more information, see the online Help.
CORBA Connectors page
You use the CORBA Connectors page of the Administrator to register, edit, and delete CORBA
connectors. You must register CORBA connectors before using them in your ColdFusion
applications. You must also restart the server when you are done with the CORBA Connector
configuration.
Extensions section33
ColdFusion MX loads ORB libraries dynamically using a connector, which does not restrict
ColdFusion developers to a specific ORB vendor. The connectors depend on the ORB runtime
libraries provided by the vendor. A connector for Borland Visibroker is embedded within
ColdFusion MX. Make sure that the ORB runtime libraries are in cf_root/runtime/lib.
The following table contains information about the libraries and connectors:
Note: Macromedia will provide implementations of the connectors for some of the popular ORBs.
For those that are not supported, Macromedia will make the source available under NDA to a select
group of third-party candidates and/or ORB vendors.
The following lines are an example of a CORBA connector configuration for VisiBroker:
ORB Namevisibroker
ORB Class Name coldfusion.runtime.corba.VisibrokerConnector
ORB Property Filec:\cfusionmx\runtime\cfusion\lib\vbjorb.properties
Classpath[blank]
ColdFusion includes the vbjorb.properties file, which contains the following properties that
configure the ORB:
The Security section of the Administrator lets you configure the security frameworks of
ColdFusion MX.
For more information on security, see Chapter 5, “Administering Security,” on page 69.
vbjorb.jar
vbjorb.jar
vbjorb.jar
CF Admin Password page
You use the CF Admin Password page of the Administrator to enable and disable passwordrestricted access to the Administrator, and to change the Administrator password.
RDS Password page
You use the RDS Password page to enable and disable password-restricted access to server
resources from Macromedia Dreamweaver MX or Macromedia HomeSite+ using Remote
Development Services (RDS), and to change the password.
34Chapter 2: Basic ColdFusion MX Administration
Sandbox Security page
You use the Sandbox Security page (called Resource Security in the Standard Edition) to specify
security permissions for data sources, tags, functions, files, and directories.
Sandbox security uses the location of your ColdFusion pages to determine functionality. A
sandbox is a designated area (CFM files or directories containing CFM files) of your site to which
you apply security restrictions. By default, a subdirectory (or child directory) inherits the sandbox
settings of the directory one level above it (the parent directory). If you define sandbox settings for
a subdirectory, you override the sandbox settings inherited from the parent directory.
Use sandbox security to control access to:
• Data sources
• Ta g s
• Functions
• Files and directories
• IP addresses and ports
Custom Extensions section
You can extend the functionality of the ColdFusion Administrator by adding links to other web
applications and sites. These links appear under the Custom Extensions section in the left
navigation pane of the Administrator.
Note: You must create a link for the Custom Extensions section to appear in the Administrator.
To extend the Administrator, create a file that contains the HTML link code, followed by a <BR>,
with a separate line for each link. Do not include other HTML code, such as
tags. Save this file as extensionscustom.cfm in the Administrator root directory (/CFIDE/
administrator/).
For example, the following file adds to the Administrator links for Bowdoin College, Universidad
Complutense de Madrid, and La Sapienza:
When you click a link, the page displays. The target attribute is required; if you specify
target="content", the page appears in the main pane of the Administrator. If you specify any other
value for the target attribute, the page appears in a new window.
<head> or <body>
Custom Extensions section35
36Chapter 2: Basic ColdFusion MX Administration
CHAPTER 3
Data Source Management
This chapter describes the configuration options for ColdFusion MX data sources. For basic
information on data sources and connecting to databases, see Developing ColdFusion MX Applications.
JDBC is a Java Application Programming Interface (API) that you use to execute SQL statements.
JDBC enables an application, such as ColdFusion MX, to interact with a variety of relational
databases, without using interfaces that are database- and platform-specific.
37
The following table describes the four types of JDBC drivers:
TypeNameDescription
1JDBC-ODBC
bridge
2Native-API/partly
Java driver
3JDBC-Net pure
Java driver
4Native-protocol/
all-Java driver
Translates JDBC calls into ODBC calls, and sends them to the ODBC
driver.
Advantages Allows access to many different databases.
Disadvantages The ODBC driver, and possibly the client database
libraries, must reside on the ColdFusion server computer. Performance
is also below par.
Macromedia does not recommend this driver type unless your
application requires specific features of these drivers.
Converts JDBC calls into database-specific calls.
Advantages Better performance than Type 1 Driver.
Disadvantages The vendor’s client database libraries must reside on
the same computer as ColdFusion.
Macromedia does not recommend this driver type unless your
application requires specific features of these drivers, such as the
Unicode support offered by the ColdFusion MX Microsoft Access with
Unicode driver.
Translates JDBC calls to the middle-tier server, which then translates
the request to the database-specific native-connectivity interface.
Advantages No need for vendor’s database libraries to be present on
client computer. Can be tailored for small size (faster loading).
Disadvantages Database-specific code must be executed in the
middle-tier.
ColdFusion MX includes an ODBC socket type 3 driver for use with
Microsoft Access databases and ODBC data sources.
Converts JDBC calls into the network protocol used directly by the
database.
Advantages Fast performance. No special software needed on the
computer on which you run ColdFusion MX.
Disadvantages Many of these protocols are proprietary, requiring a
different driver for each database.
ColdFusion MX includes type 4 drivers for many popular DBMSs,
however, not all DBMSs are supported in ColdFusion MX Standard
Edition.
Supplied drivers
The following table shows the database drivers supplied with ColdFusion MX and where you can
find more information:
DriverType Reference
DB2 Universal Database 6.x, 7.2,
and OS/390
Informix 9.x4“Connecting to Informix 9.x” on page 43
Microsoft Access3“Connecting to Microsoft Access” on page 44
38Chapter 3: Data Source Management
4“Connecting to DB2 Universal Database 6.x, 7.2, and
OS/390” on page 41
DriverType Reference
Microsoft Access with Unicode
support
Microsoft SQL Server 7.x, 20004“Connecting to Microsoft SQL Server 7.x, 2000”
MySQL4“Connecting to MySQL” on page 48
ODBC Socket3“Connecting to ODBC Socket” on page 50
Other“Connecting to other data sources” on page 52
Sybase 11.5, 11.9, 12.0, 12.54“Connecting to Sybase 11.5, 11.9, 12.0, and 12.5”
2“Connecting to Microsoft Access with Unicode”
on page 46
on page 47
on page 51
on page 54
Adding data sources
In the ColdFusion MX Administrator, you configure your data sources to communicate with
ColdFusion. Once you add a data source to the Administrator, you access it by name in any
CFML tag that establishes database connections; for example,
source tells ColdFusion which database to connect to and what parameters to use for the
connection.
The ColdFusion MX Administrator organizes all the information about a ColdFusion MX
server’s database connections in a single, easy-to-manage location. In addition to adding new data
sources, you can use the Administrator to specify changes to your database configuration, such as
relocation, renaming, or changes in security permissions.
cfquery. During a query, the data
Adding data sources in the Administrator
You use the ColdFusion MX Administrator to quickly add a data source for use in your
ColdFusion applications. When you add a data source, you assign it a data source name (DSN)
and set all information required to establish a connection.
Note: ColdFusion MX includes several data sources that are configured by default, including
cfsnippets, CompanyInfo, and exampleapps. This procedure should not be necessary to work with
these data sources.
To add a data source:
1 In the ColdFusion MX Administrator, select Data & Services > Data Sources.
2 Under Add New Data Source, enter a Data Source Name; for example, MyTestDSN. The
following names are reserved. You cannot use them for data source names:
■ service
■ jms_provider
■ comp
■ jms
3 Select a Driver from the drop-down list box; for example, Microsoft SQL Server.
Adding data sources39
4 Click Add.
A form for additional DSN information appears. The available fields in this form depend on
the Driver that you selected.
5 In the Database field, enter the name of the database; for example, Northwind.
6 In the Server field, enter the network name or IP address of the server that hosts the database,
and enter any required Port value; for example, the bullwinkle server on the default port.
7 If your database requires login information, enter your Username and Password.
Tip: The omission of required username and password information is a common reason why a
data source fails to verify.
8 (Optional) Enter a Description.
9 (Optional) Click Show Advanced Settings to specify any ColdFusion-specific settings; for
example, to configure which SQL commands can interact with this data source.
10 Create Submit to create the data source.
ColdFusion MX automatically verifies that it can connect to the data source.
11 (Optional) To verify this data source later, click the verify icon:
Note: To check the status of all data sources available to ColdFusion MX, click Verify All
Connections.
Specifying connection string arguments
You can use the ColdFusion MX Administrator to specify connection string arguments for data
sources that use the Microsoft Access, ODBC Socket, MYSQL, or DB2 drivers. In the Advanced
Settings page for one of these drivers,in the Connection String field, enter name=value pairs
separated by a semicolon. The Administrator configures the following ODBC connection string:
DSN=odbcdsnname;APP=RaiseGenerator;WSID=TWriter01
In the preceding string, odbcdsnname is the name of the ODBC DSN. This is the string that the
Microsoft Access or ODBC Socket driver uses to connect to the data source at runtime.
Note: The connectstring tag attribute (cfquery tag) is not supported in ColdFusion MX.
Adding data source notes and considerations
When adding data sources to ColdFusion MX, keep these guidelines in mind:
• Data source names should be all one word.
• Data source names can contain only letters, numbers, hyphens, and the underscore.
• Data source names should not contain special characters or spaces.
• Although data source names are not case-sensitive, you should use a consistent capitalization
scheme.
• Depending on the JDBC driver, connection strings and JDBC URLs might be case-sensitive.
• Ensure that you use the Administrator to verify that ColdFusion MX can connect to the data
source.
A data source must exist in the ColdFusion MX Administrator before you use it on an application
page to retrieve data.
40Chapter 3: Data Source Management
Connecting to DB2 Universal Database 6.x, 7.2, and OS/390
Use the settings in the following table to connect ColdFusion to DB2 Universal Database 6.x,
7.2, and OS/390 data sources:
SettingDescription
CF Data Source Name The data source name (DSN) used by ColdFusion MX to connect to the
DatabaseThe name of the database.
ServerThe name of the server that hosts the database that you want to use. If the
PortThe number of the TCP/IP port that the server monitors for connections.
UsernameThe user name that ColdFusion MX passes to the JDBC driver to connect
PasswordThe password (16-character limit) that ColdFusion MX passes to the JDBC
Description(Optional) A description for this connection.
Connection StringA field that passes database-specific parameters, such as login credentials,
data source.
database is local, enclose the word local in parentheses.
to the data source if a ColdFusion application does not supply a user name;
for example, in a
cfquery tag.
The username must have CREATE PACKAGE privileges for the database,
or the database administrator must create a package. Consult the database
administrator when configuring this type of data source.
driver to connect to the data source if a ColdFusion application does not
supply a password—for example, in a
cfquery tag.
to the data source.
For UDB on the initial connection, specify DatabaseName, PackageName,
CreateDefaultPackage, and ReplacePackage, as shown in the following
example:
DatabaseName=SAMPLE;PackageName=pkgname;
CreateDefaultPackage=TRUE;ReplacePackage=TRUE
For UDB on subsequent connections, specify DatabaseName and
PackageName, as shown in the following example:
DatabaseName=SAMPLE;PackageName=pkgname
For OS/390 on the initial connection, specify LocationName, CollectionId,
PackageName, and CreateDefaultPackage, as shown in the following
example:
LocationName=SAMPLE;CollectionId=DEFAULT;
PackageName=pkgname;CreateDefaultPackage=TRUE
For OS/390 on subsequent connections, specify LocationName,
CollectionId, and PackageName, as shown in the following example:
LocationName=SAMPLE;CollectionId=DEFAULT;
PackageName=pkgname
Where pkgname is the name of the package (maximum of 7 characters)
that the driver uses to process SQL statements.
Your user ID must have CREATE PACKAGE privileges on the database, or
your database administrator must create a package for you.
Connecting to DB2 Universal Database 6.x, 7.2, and OS/39041
SettingDescription
Limit ConnectionsSpecifies whether ColdFusion MX limits the number of database
connections for the data source. If you enable this option, use the Restrict
Connections to field to specify the maximum.
Restrict Connections toSpecifies the maximum number of database connections for the data
source. To use this restriction, you must enable Limit Connections.
Maintain Connections ColdFusion establishes a connection to a data source for every operation
that requires one. Enable this option to improve performance by caching
the data source connection.
String FormatEnable this option if your application uses Unicode data in DBMS-specific
Unicode datatypes such as National Character or nchar.
Max Pooled
Statements
Enables reuse of prepared statements (that is, stored procedures and
queries that use the
cfqueryparam tag). Although you tune this setting
based on your application, start by setting it to the sum of the following:
• Unique
cfquery tags that use cfqueryparam
• Unique cfstoredproc tags
Timeout (min)The maximum number of minutes after the data source connection is made
that you want ColdFusion to cache a connection after it is used.
Interval (min)The time (in minutes) that the server waits between cycles to check for
expired data source connections to close.
Disable ConnectionsIf selected, suspends all client connections.
Login Timeout (sec)The number of seconds before ColdFusion times out the data source
connection login attempt.
CLOBSelect to return the entire contents of any CLOB/Text columns in the
database for this data source. If unchecked, ColdFusion retrieves the
amount specified in the Long Text Buffer setting.
BLOB Select to return the entire contents of any BLOB/Image columns in the
database for this data source. If unchecked, ColdFusion retrieves the
amount specified in the Blob Buffer setting.
LongText Buffer (chr) The default buffer size, used if Enable Long Text Retrieval (CLOB) is not
selected. Default is 64000 bytes.
BLOB Buffer (bytes)The default buffer size, used if Enable binary large object retrieval (BLOB)
is not selected. Default is 64000 bytes.
Allowed SQLThe SQL operations that can interact with the current data source.
42Chapter 3: Data Source Management
Connecting to Informix 9.x
Use the settings in the following table to connect ColdFusion MX to Informix 9.x data sources:
SettingDescription
CF Data Source Name The data source name (DSN) used by ColdFusion MX to connect to the
data source.
DatabaseThe database to which this data source connects.
Informix ServerThe name of the Informix database server to which you want to connect.
ServerThe name of the server that hosts the database that you want to use. If the
database is local, enclose the word local in parentheses.
PortThe number of the TCP/IP port that the server monitors for connections.
UsernameThe user name that ColdFusion MX passes to the JDBC driver to connect
to the data source if a ColdFusion application does not supply a user name;
for example, in a
PasswordThe password (16-character limit) that ColdFusion MX passes to the JDBC
driver to connect to the data source if a ColdFusion application does not
supply a password; for example, in a
Description(Optional) A description for this connection.
Limit ConnectionsSpecifies whether ColdFusion MX limits the number of database
connections for the data source. If you enable this option, use the Restrict
Connections to field to specify the maximum.
Restrict Connections toSpecifies the maximum number of database connections for the data
source. To use this restriction, you must enable Limit Connections.
Maintain Connections ColdFusion MX establishes a connection to a data source for every
operation that requires one. Enable this option to improve performance by
caching the data source connection.
String FormatEnable Unicode for data sources that are configured for non-Latin
characters.
Max Pooled
Statements
Timeout (min)The maximum number of minutes after the data source connection is made
Interval (min)The time (in minutes) that the server waits between cycles to check for
Disable ConnectionsIf selected, suspends all client connections.
Login Timeout (sec)The number of seconds before ColdFusion MX times out the data source
Enables reuse of prepared statements (that is, stored procedures and
queries that use the cfqueryparam tag). Although you tune this setting
based on your application, start by setting it to the sum of the following:
• Unique
• Unique cfstoredproc tags
that you want ColdFusion MX to cache a connection after it is used.
expired data source connections to close.
connection login attempt.
cfquery tag.
cfquery tag.
cfquery tags that use cfqueryparam
Connecting to Informix 9.x43
SettingDescription
CLOBSelect to return the entire contents of any CLOB/Text columns in the
BLOB Select to return the entire contents of any BLOB/Image columns in the
LongText BufferThe default buffer size, used if Enable Long Text Retrieval(CLOB) is not
BLOB BufferThe default buffer size; used if Enable binary large object retrieval (BLOB)
Allowed SQLThe SQL operations that can interact with the current data source.
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Long Text Buffer setting.
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Blob Buffer setting.
selected. Default is 64000 bytes.
is not selected. Default is 64000 bytes.
Connecting to Microsoft Access
Use the settings in the following table to connect ColdFusion MX to Microsoft Access data
sources:
SettingDescription
CF Data Source Name The data source name (DSN) used by ColdFusion MX to connect to the
data source.
Database FileThe file that contains the database.
System Database FileTo secure access to the specified database file, click Browse Server to
locate and enter a database that contains database security information.
The system database is usually located in winnt\system32\system.mdw.
Use Default UsernameIf selected, ColdFusion MX does not pass a user name or password when
requesting a connection. The Microsoft Access driver uses the default
user name and password. (specified in Advanced Settings).
ColdFusion UsernameThe user name that ColdFusion MX passes to the JDBC driver to connect
to the data source if a ColdFusion application does not supply a user
name; for example, in a
ColdFusion PasswordThe password (16-character limit) that ColdFusion MX passes to the
JDBC driver to connect to the data source if a ColdFusion application
does not supply a password; for example, in a
Description(Optional) A description for this connection.
Page TimeoutThe time (in tenths of a second) before a request for a ColdFusion page
times out.
Max Buffer SizeThe total number of bytes that ColdFusion MX uses to cache application
pages. Enter a value to optimize ColdFusion performance.
Connection StringA field that passes database-specific parameters, such as login
credentials, to the data source.
Default UsernameThe user name that ColdFusion MX passes to the JDBC driver to connect
to the data source if a ColdFusion application does not supply a user
name-for example, in a
cfquery tag.
cfquery tag.
cfquery tag.
44Chapter 3: Data Source Management
SettingDescription
Default PasswordThe password (16-character limit) that ColdFusion MX passes to the
JDBC driver to connect to the data source if a ColdFusion application
Return Timestamp as
String
does not supply a password-for example, in a
Enable this setting if your application retrieves Date/Time data and then
re-uses it in SQL statements without applying formatting (using functions
cfquery tag.
such as DateFormat, TimeFormat, and CreateODBCDateTime).
Limit ConnectionsSpecifies whether ColdFusion MX limits the number of database
connections for the data source. If you enable this option, use the Restrict
Connections to field to specify the maximum.
Restrict Connections to Specifies the maximum number of database connections for the data
source. To use this restriction, you must enable Limit Connections.
Maintain ConnectionsColdFusion MX establishes a connection to a data source for every
operation that requires one. Enable this option to improve performance by
caching the data source connection.
Timeout (min)The maximum number of minutes after the data source connection is
made that you want ColdFusion MX to cache a connection after it is used.
The Timeout setting does not return a connection to the cache after a
specified period of time, regardless of how infrequently it is used. The
default is "" or 0, which means that the connection timeout is never
enforced.
Interval (min)The time (in minutes) that the server waits between cycles to check for
expired data source connections to close.
Disable ConnectionsIf selected, suspends all client connections.
Login Timeout (sec)The number of seconds before ColdFusion MX times out the data source
connection login attempt.
CLOBSelect to return the entire contents of any CLOB/Text columns in the
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Long Text Buffer setting.
BLOB Select to return the entire contents of any BLOB/Image columns in the
database for this data source. If unchecked, ColdFusion retrieves the
amount specified in the Blob Buffer setting.
LongText BufferThe default buffer size, used if Enable Long Text Retrieval(CLOB) is not
selected. Default is 64000 bytes.
BLOB BufferThe default buffer size, used if Enable binary large object retrieval (BLOB)
is not selected. Default is 64000 bytes.
Allowed SQLThe SQL operations that can interact with the current data source.
Connecting to Microsoft Access45
Connecting to Microsoft Access with Unicode
Type 2 driver. Use the settings in the following table to connect ColdFusion MX to Microsoft
Access with Unicode data sources:
SettingDescription
CF Data Source NameThe data source name (DSN) used by ColdFusion MX to connect to the
Database FileThe file that contains the database.
Description(Optional) A description for this connection.
ColdFusion UsernameThe user name that ColdFusion MX passes to the JDBC driver to connect
ColdFusion PasswordThe password (16-character limit) that ColdFusion MX passes to the
Page TimeoutThe time (in tenths of a second) before a request for a ColdFusion page
Max Buffer SizeThe total number of bytes that ColdFusion MX uses to cache application
Connection StringA field that passes database-specific parameters, such as login
Limit ConnectionsSpecifies whether ColdFusion MX limits the number of database
Restrict Connections to Specifies the maximum number of database connections for the data
Maintain ConnectionsColdFusion MX establishes a connection to a data source for every
Timeout (min)The maximum number of minutes after the data source connection is
Interval (min)The time (in minutes) that the server waits between cycles to check for
Disable ConnectionsIf selected, suspends all client connections.
Login Timeout (sec)The number of seconds before ColdFusion MX times out the data source
CLOBSelect to return the entire contents of any CLOB/Text columns in the
data source.
to the data source if a ColdFusion application does not supply a user
name; for example, in a
JDBC driver to connect to the data source if a ColdFusion application
does not supply a password; for example, in a
times out.
pages. Enter a value to optimize ColdFusion performance.
credentials, to the data source.
connections for the data source. If you enable this option, use the Restrict
Connections to field to specify the maximum.
source. To use this restriction, you must enable Limit Connections.
operation that requires one. Enable this option to improve performance by
caching the data source connection.
made that you want ColdFusion MX to cache a connection after it is used.
The Timeout setting does not return a connection to the cache after a
specified period of time, regardless of how infrequently it is used. The
default is "" or 0, which means that the connection timeout is never
enforced.
expired data source connections to close.
connection login attempt.
database for this data source. If not selected, ColdFusion MX retrieves
the amount specified in the Long Text Buffer setting.
cfquery tag.
cfquery tag.
46Chapter 3: Data Source Management
SettingDescription
BLOB Select to return the entire contents of any BLOB/Image columns in the
LongText BufferThe default buffer size, used if Enable Long Text Retrieval(CLOB) is not
BLOB BufferThe default buffer size, used if Enable binary large object retrieval (BLOB)
Allowed SQLThe SQL operations that can interact with the current data source.
database for this data source. If not selected, ColdFusion MX retrieves
the amount specified in the Blob Buffer setting.
selected. Default is 64000 bytes.
is not selected. Default is 64000 bytes.
Connecting to Microsoft SQL Server 7.x, 2000
Use the settings in the following table to connect ColdFusion MX to Microsoft SQL Server 7.x,
2000 data sources:
SettingDescription
CF Data Source NameThe data source name (DSN) used by ColdFusion MX to connect to the
DatabaseThe database to which this data source connects.
ServerThe name of the server that hosts the database that you want to use. If the
PortThe number of the TCP/IP port that the server monitors for connections.
UsernameThe user name that ColdFusion MX passes to the JDBC driver to
PasswordThe password (16-character limit) that ColdFusion MX passes to the
Description(Optional) A description for this connection.
Select MethodDetermines whether server cursors are used for SQL queries.
data source.
database is local, enclose the word local in parentheses.
connect to the data source if a ColdFusion application does not supply a
user name; for example, in a
JDBC driver to connect to the data source if a ColdFusion application
does not supply a password—for example, in a cfquery tag.
cfquery tag.
The Direct method provides more efficient retrieval of data when you
retrieve record sets in a forward-only direction and you limit your SQL
Server connection to a single open SQL statement at a time. This is
typical for ColdFusion applications.
The Cursor method lets you have multiple open SQL statements on a
connection. This is not typical for ColdFusion applications, unless you use
pooled statements.
Limit ConnectionsSpecifies whether ColdFusion MX limits the number of database
Restrict Connections to Specifies the maximum number of database connections for the data
connections for the data source. If you enable this option, use the Restrict
Connections to field to specify the maximum.
source. To use this restriction, you must enable Limit Connections.
Connecting to Microsoft SQL Server 7.x, 200047
SettingDescription
Maintain ConnectionsColdFusion MX establishes a connection to a data source for every
String FormatEnable this option if your application uses Unicode data in DBMS-
Max Pooled Statements Enables reuse of prepared statements (that is, stored procedures and
Timeout (min)The maximum number of minutes after the data source connection is
Interval (min)The time (in minutes) that the server waits between cycles to check for
Disable ConnectionsIf selected, suspends all client connections.
Login Timeout (sec)The number of seconds before ColdFusion MX times out the data source
CLOBSelect to return the entire contents of any CLOB/Text columns in the
BLOB Select to return the entire contents of any BLOB/Image columns in the
LongText BufferThe default buffer size, used if Enable Long Text Retrieval(CLOB) is not
BLOB BufferThe default buffer size, used if Enable binary large object retrieval
Allowed SQLThe SQL operations that can interact with the current data source.
operation that requires one. Enable this option to improve performance
by caching the data source connection.
specific Unicode datatypes such as National Character or nchar.
queries that use the
based on your application, start by setting it to the sum of the following:
• Unique
• Unique cfstoredproc tags
made that you want ColdFusion MX to cache a connection after it is used.
expired data source connections to close.
connection login attempt.
database for this data source. If not selected, ColdFusion MX retrieves
the amount specified in the Long Text Buffer setting.
database for this data source. If not selected, ColdFusion MX retrieves
the amount specified in the Blob Buffer setting.
selected. Default is 64000 bytes.
(BLOB) is not selected. Default is 64000 bytes.
cfquery tags that use cfqueryparam
cfqueryparam tag). Although you tune this setting
Connecting to MySQL
Use the settings in the following table to connect ColdFusion MX to MySQL data sources:
SettingDescription
CF Data Source NameThe data source name (DSN) used by ColdFusion MX to connect to the
data source.
DatabaseThe database to which this data source connects.
ServerThe name of the server that hosts the database that you want to use. If the
database is local, enclose the word local in parentheses.
PortThe number of the TCP/IP port that the server monitors for connections.
48Chapter 3: Data Source Management
SettingDescription
UsernameThe user name that ColdFusion MX passes to the JDBC driver to connect
to the data source if a ColdFusion application does not supply a user
name; for example, in a
cfquery tag.
PasswordThe password (16-character limit) that ColdFusion MX passes to the
JDBC driver to connect to the data source if a ColdFusion application
does not supply a password; for example, in a
cfquery tag.
Description(Optional) A description for this connection.
Connection StringA field that passes database-specific parameters, such as login
credentials, to the data source.
Limit ConnectionsSpecifies whether ColdFusion MX limits the number of database
connections for the data source. If you enable this option, use the Restrict
Connections to field to specify the maximum.
Restrict Connections to Specifies the maximum number of database connections for the data
source. To use this restriction, you must enable Limit Connections.
Maintain ConnectionsColdFusion MX establishes a connection to a data source for every
operation that requires one. Enable this option to improve performance by
caching the data source connection.
Timeout (min)The maximum number of minutes after the data source connection is
made that you want ColdFusion MX to cache a connection after it is used.
Interval (min)The time (in minutes) that the server waits between cycles to check for
expired data source connections to close.
Disable ConnectionsIf selected, suspends all client connections.
Login Timeout (sec)The number of seconds before ColdFusion MX times out the data source
connection login attempt.
CLOBSelect to return the entire contents of any CLOB/Text columns in the
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Long Text Buffer setting.
BLOB Select to return the entire contents of any BLOB/Image columns in the
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Blob Buffer setting.
LongText BufferThe default buffer size, used if Enable Long Text Retrieval(CLOB) is not
selected. Default is 64000 bytes.
BLOB BufferThe default buffer size, used if Enable binary large object retrieval (BLOB)
is not selected. Default is 64000 bytes.
Allowed SQLThe SQL operations that can interact with the current data source.
Connecting to MySQL49
Connecting to ODBC Socket
Type 3 driver. Use the settings in the following table to connect ColdFusion MX to ODBC
Socket data sources:
SettingDescription
CF Data Source NameThe data source name (DSN) used by ColdFusion MX to connect to the
ODBC DSNSelect the ODBC DSN to which you want ColdFusion MX to connect.
Trusted ConnectionSpecifies whether to use domain user account access to the database.
UsernameThe user name that ColdFusion MX passes to the JDBC driver to connect
PasswordThe password (16-character limit) that ColdFusion MX passes to the
Description(Optional) A description for this connection.
Connection StringA field that passes database-specific parameters, such as login
Limit ConnectionsSpecifies whether ColdFusion MX limits the number of database
Restrict Connections to Specifies the maximum number of database connections for the data
Maintain ConnectionsColdFusion MX establishes a connection to a data source for every
Timeout (min)The maximum number of minutes after the data source connection is
Interval (min)The time (in minutes) that the server waits between cycles to check for
Disable ConnectionsIf selected, suspends all client connections.
Login Timeout (sec)The number of seconds before ColdFusion MX times out the data source
CLOBSelect to return the entire contents of any CLOB/Text columns in the
BLOB Select to return the entire contents of any BLOB/Image columns in the
LongText BufferThe default buffer size, used if Enable Long Text Retrieval(CLOB) is not
data source.
Only valid for SQL Server.
to the data source if a ColdFusion application does not supply a user
name; for example, in a
JDBC driver to connect to the data source if a ColdFusion application
does not supply a password; for example, in a
credentials, to the data source.
connections for the data source. If you enable this option, use the Restrict
Connections to field to specify the maximum.
source. To use this restriction, you must enable Limit Connections.
operation that requires one. Enable this option to improve performance by
caching the data source connection.
made that you want ColdFusion MX to cache a connection after it is used.
expired data source connections to close.
connection login attempt.
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Long Text Buffer setting.
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Blob Buffer setting.
selected. Default is 64000 bytes.
cfquery tag.
cfquery tag.
50Chapter 3: Data Source Management
SettingDescription
BLOB BufferThe default buffer size, used if Enable binary large object retrieval (BLOB)
Allowed SQLThe SQL operations that can interact with the current data source.
is not selected. Default is 64000 bytes.
Connecting to Oracle R3 (8.1.7), Oracle 9i
Use the settings in the following table to connect ColdFusion MX to Oracle R3 (8.1.7), Oracle 9i
data sources:
SettingDescription
CF Data Source Name The data source name (DSN) used by ColdFusion MX to connect to the
data source.
SID NameThe Oracle System Identifier that refers to the instance of the Oracle
ServerThe name of the server that hosts the database that you want to use. If the
PortThe number of the TCP/IP port that the server monitors for connections.
UsernameThe user name that ColdFusion MX passes to the JDBC driver to connect
PasswordThe password (16-character limit) that ColdFusion MX passes to the
Description(Optional) A description for this connection.
Limit ConnectionsSpecifies whether ColdFusion MX limits the number of database
Restrict Connections to Specifies the maximum number of database connections for the data
Maintain ConnectionsColdFusion MX establishes a connection to a data source for every
String FormatEnable this option if your application uses Unicode data in DBMS-specific
Max Pooled Statements Enables reuse of prepared statements (that is, stored procedures and
Timeout (min)The maximum number of minutes after the data source connection is
database software running on the server. 'ORCL' is the default.
database is local, enclose the word local in parentheses.
to the data source if a ColdFusion application does not supply a user
name; for example, in a
JDBC driver to connect to the data source if a ColdFusion application
does not supply a password; for example, in a
connections for the data source. If you enable this option, use the Restrict
Connections to field to specify the maximum.
source. To use this restriction, you must enable Limit Connections.
operation that requires one. Enable this option to improve performance by
caching the data source connection.
Unicode datatypes such as National Character or nchar.
queries that use the
based on your application, start by setting it to the sum of the following:
• Unique
• Unique cfstoredproc tags
made that you want ColdFusion MX to cache a connection after it is used.
cfquery tags that use cfqueryparam
cfquery tag.
cfquery tag.
cfqueryparam tag). Although you tune this setting
Connecting to Oracle R3 (8.1.7), Oracle 9i51
SettingDescription
Interval (min)The time (in minutes) that the server waits between cycles to check for
Disable ConnectionsIf selected, suspends all client connections.
Login Timeout (sec)The number of seconds before ColdFusion MX times out the data source
CLOBSelect to return the entire contents of any CLOB/Text columns in the
BLOB Select to return the entire contents of any BLOB/Image columns in the
LongText BufferThe default buffer size, used if Enable Long Text Retrieval(CLOB) is not
BLOB BufferThe default buffer size, used if Enable binary large object retrieval (BLOB)
Allowed SQLThe SQL operations that can interact with the current data source.
expired data source connections to close.
connection login attempt.
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Long Text Buffer setting.
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Blob Buffer setting.
selected. Default is 64000 bytes.
is not selected. Default is 64000 bytes.
Connecting to other data sources
Use the settings in the following table to connect ColdFusion MX to data sources through JDBC
drivers that do not appear in the drop-down list of drivers:
SettingDescription
CF Data Source Name The data source name (DSN) used by ColdFusion MX to connect to the
data source.
JDBC URLThe JDBC Connection URL for this data source.
Driver ClassThe fully qualified class name of the driver. For example,
com.inet.tds.TdsDriver. The JAR file that contains this class must be in a
directory defined to the ColdFusion classpath.
Driver Name(Optional) The name of the driver.
UsernameThe user name that ColdFusion MX passes to the JDBC driver to connect
to the data source if a ColdFusion application does not supply a user name;
for example, in a
PasswordThe password (16-character limit) that ColdFusion MX passes to the
JDBC driver to connect to the data source if a ColdFusion application
does not supply a password; for example, in a
Description(Optional) A description for this connection.
Limit ConnectionsSpecifies whether ColdFusion MX limits the number of database
connections for the data source. If you enable this option, use the Restrict
Connections to field to specify the maximum.
Restrict Connections to Specifies the maximum number of database connections for the data
source. To use this restriction, you must enable Limit Connections.
cfquery tag.
cfquery tag.
52Chapter 3: Data Source Management
SettingDescription
Maintain ConnectionsColdFusion MX establishes a connection to a data source for every
operation that requires one. Enable this option to improve performance by
caching the data source connection.
Timeout (min)The maximum number of minutes after the data source connection is made
that you want ColdFusion MX to cache a connection after it is used.
Interval (min)The time (in minutes) that the server waits between cycles to check for
expired data source connections to close.
Disable ConnectionsIf selected, suspends all client connections.
Login Timeout (sec)The number of seconds before ColdFusion MX times out the data source
connection login attempt.
CLOBSelect to return the entire contents of any CLOB/Text columns in the
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Long Text Buffer setting.
BLOB Select to return the entire contents of any BLOB/Image columns in the
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Blob Buffer setting.
LongText BufferThe default buffer size, used if Enable Long Text Retrieval(CLOB) is not
selected. Default is 64000 bytes.
BLOB BufferThe default buffer size, used if Enable binary large object retrieval (BLOB)
is not selected. Default is 64000 bytes.
Allowed SQLThe SQL operations that can interact with the current data source.
Connecting to other data sources53
Connecting to Sybase 11.5, 11.9, 12.0, and 12.5
Use the settings in the following table to connect ColdFusion MX to Sybase 11.5, 11.9, 12.0, and
12.5 data sources:
SettingDescription
CF Data Source Name The data source name (DSN) used by ColdFusion MX to connect to the
DatabaseThe database to which this data source connects.
ServerThe name of the server that hosts the database that you want to use. If the
PortThe number of the TCP/IP port that the server monitors for connections.
UsernameThe user name that ColdFusion MX passes to the JDBC driver to connect
PasswordThe password (16-character limit) that ColdFusion MX passes to the
Description(Optional) A description for this connection.
Select MethodDetermines whether server cursors are used for SQL queries.
data source.
database is local, enclose the word local in parentheses. This name must
be either a fully qualified domain name (resolvable through DNS) or an IP
address. It cannot be a netbios name (even if you are running NBT), or an
alias you set up using the client connectivity wizard (both of these
approaches worked in earlier ColdFusion versions).
to the data source if a ColdFusion application does not supply a user
name; for example, in a
JDBC driver to connect to the data source if a ColdFusion application
does not supply a password; for example, in a
cfquery tag.
cfquery tag.
The Direct method provides more efficient retrieval of data when you
retrieve record sets in a forward-only direction and you limit your Sybase
connection to a single open SQL statement at a time. This is typical for
ColdFusion applications.
The Cursor method lets you have multiple open SQL statements on a
connection. This is not typical for ColdFusion applications, unless you use
pooled statements.
Limit ConnectionsSpecifies whether ColdFusion MX limits the number of database
connections for the data source. If you enable this option, use the Restrict
Connections to field to specify the maximum.
Restrict Connections to Specifies the maximum number of database connections for the data
source. To use this restriction, you must enable Limit Connections.
Maintain ConnectionsColdFusion MX establishes a connection to a data source for every
String FormatEnable this option if your application uses Unicode data in DBMS-specific
54Chapter 3: Data Source Management
operation that requires one. Enable this option to improve performance by
caching the data source connection.
Unicode datatypes such as National Character or nchar.
SettingDescription
Max Pooled Statements Enables reuse of prepared statements (that is, stored procedures and
queries that use the
cfqueryparam tag). Although you tune this setting
based on your application, start by setting it to the sum of the following:
• Unique
cfquery tags that use cfqueryparam
• Unique cfstoredproc tags
Timeout (min)The maximum number of minutes after the data source connection is
made that you want ColdFusion MX to cache a connection after it is used.
Interval (min)The time (in minutes) that the server waits between cycles to check for
expired data source connections to close.
Disable ConnectionsIf selected, suspends all client connections.
Login Timeout (sec)The number of seconds before ColdFusion MX times out the data source
connection login attempt.
CLOBSelect to return the entire contents of any CLOB/Text columns in the
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Long Text Buffer setting.
BLOB Select to return the entire contents of any BLOB/Image columns in the
database for this data source. If not selected, ColdFusion MX retrieves the
amount specified in the Blob Buffer setting.
LongText BufferThe default buffer size, used if Enable Long Text Retrieval(CLOB) is not
selected. Default is 64000 bytes.
BLOB BufferThe default buffer size, used if Enable binary large object retrieval (BLOB)
is not selected. Default is 64000 bytes.
Allowed SQLThe SQL operations that can interact with the current data source.
Connecting to Sybase 11.5, 11.9, 12.0, and 12.555
56Chapter 3: Data Source Management
CHAPTER 4
Web Server Management
This chapter discusses connecting ColdFusion MX to the built-in web server and to external web
servers, such as Apache, IIS, and SunONE Web Server (formerly known as iPlanet). It explores
common scenarios, security, multi-hosting, and other issues that you might find helpful.
The discussions in this chapter apply when running ColdFusion MX in the server configuration;
they do not apply when running ColdFusion MX in the J2EE configuration. However, certain
discussions may apply when running ColdFusion MX as an EAR or WAR on JRun 4.
Additionally, some J2EE application servers include web server plug-ins that provide similar
functionality.
The web server is a critical component in your ColdFusion MX environment and understanding
how ColdFusion interacts with web servers can help you administer your site. ColdFusion MX
provides the following options with regard to web servers:
• Built-in web server Lightweight, all-Java, HTTP 1.0 web server. Suitable for development
but not intended for use in production applications. For more information, see “Using the
built-in web server” on page 58.
• External web server Customized web server connector module that forwards requests for
ColdFusion pages from an external web server to ColdFusion MX. For more information, see
“Using an external web server” on page 59.
57
Using the built-in web server
The ColdFusion MX server configuration is built on top of JRun, which includes the JRun web
server, also called the built-in web server. Although not intended for use in a production
environment, the built-in web server is particularly useful in the following cases:
• Coexistence/transition The built-in web server lets you run a previous version of
ColdFusion (using an external web server) and ColdFusion MX (using the built-in web server)
on the same machine while you migrate your existing applications to ColdFusion MX.
• Development If your workstation runs ColdFusion MX but does not run an external web
server, you can still develop and test ColdFusion applications locally through the built-in web
server.
All web servers listen on a TCP/IP port and this port can be specified in the URL. By default, web
servers listen for HTTP request on port 80 (for example, http://www.macromedia.com and http:/
/www.macromedia.com:80 are the same). Similarly, 443 is the default port for HTTPS requests.
By default in the server configuration, the built-in web server listens on port 8500. For example,
to access the ColdFusion MX Administrator through the built-in web server, specify http://
servername:8500/CFIDE/administrator/index.cfm.
If you enable the built-in web server during the installation process and port 8500 is already in
use, the installer automatically finds the next available port above 8500 and configures the builtin web server to use that port. If you think that your built-in web server is using a port other than
8500, open cf_root/runtime/servers/default/SERVER-INF/jrun.xml in a text editor and examine
the
port attribute of the WebService service.
Note: When installing ColdFusion MX Enterprise Edition using the option that also installs JRun 4,
the installation wizard always configures the built-in web server, even if you select an external web
server.
The following list outlines additional facts related to the built-in web server.
• Whenever possible, you should choose to configure your external web server as part of
ColdFusion MX installation, except for the two cases mentioned at the beginning of this
discussion (coexistence with a previous ColdFusion version and when there is no web server on
the computer). If you select the built-in web server by mistake, you must run the Web Server
Configuration Tool manually to configure your external web server after the installation. The
Web Server Configuration Tool is described in “Web server configuration” on page 59.
• The default web root when using the built-in web server is cf_root/wwwroot.
• When using the built-in web server, the ColdFusion MX Administrator is in the cf_root/
wwwroot/CFIDE directory by default.
• If you want the built-in web server to serve pages from a different web root directory, define a
virtual mapping in the cf_root/wwwroot/WEB-INF/jrun-web.xml file, as the following
example shows:
Warning: If you have CFML pages under your external web server's root, ensure that ColdFusion
MX has been configured to serve these pages through the external web server. If you have not
configured ColdFusion MX to use an external web server, your external web server will serve
CFML source code for ColdFusion pages saved under its web root.
58Chapter 4: Web Server Management
Using an external web server
ColdFusion MX uses the JRun web server connector to forward requests from an external web
server to the ColdFusion MX runtime system.
When a request is made for a CFM page, the connector on the web server opens a network
connection to the JRun proxy service. The ColdFusion MX runtime system handles the request
and sends its reply back through the proxy service and connector. The web server connector uses
web server-specific plug-in modules, as the following table shows:
Web serverConnector details
ApacheThe Web Server Configuration Tool adds the following elements to the
Apache httpd.conf file:
• A LoadModule directive defines the connector.
• An AddHandler directive tells Apache to route requests for ColdFusion
pages through the connector.
For Apache 1.3.x, the connection module is mod_jrun.so; for Apache 2.x,
the connection module is mod_jrun20.so.
IISThe Web Server Configuration Tool adds the following elements at either
the global level (default) or web server level:
• An ISAPI filter.
• Extension mappings tell IIS to route requests for ColdFusion pages
through the connector.
With IIS 4 and 5, the IIS connection module is jrun.dll. IIS 6 uses a
connection module named jrun_iis6.dll and a helper DLL named
jrun_iis6_wildcard.dll.
SunONE Web Server,
includes iPlanet and
Netscape Enterprise
Server (NES)
The Web Server Configuration Tool adds the following elements to
SunONE Web Server configuration files:
• obj.conA NameTrans directive for the JRun filter and ObjectType
directives to route requests for ColdFusion pages through the connector.
• magnus.conf Init directives to load and initialize the connector.
In Windows, the SunONE web server connection module is
jrun_nsapi35.dll; on UNIX and Linux, the SunONE web server connection
module is libjrun_nsapi35.so; on AIX, the module name is
libjrun_nsapi40.so.
With NES 3.5 and iPlanet 4.x, the Web Server Configuration Tool places all
settings in the obj.conf file.
Web server configuration
ColdFusion MX uses the Web Server Configuration Tool to configure an external web server with
the modules and settings the connector needs to connect to ColdFusion MX. You can run the
Web Server Configuration Tool through either the command-line interface or the GUI mode. In
either case, the Web Server Configuration Tool configures your external web server to interact
with a ColdFusion MX server, as explained in the following discussions:
• Using GUI mode
• Using the command-line interface
• Configuration files
Web server configuration59
Using GUI mode
The Web Server Configuration Tool includes a GUI mode, which you can use to specify external
web server configuration settings through a graphical interface.
Note: When using the Web Server Configuration Tool in GUI mode, it is critical that you select the
Configure web server for ColdFusion MX applications checkbox.
To run the Web Server Configuration Tool in GUI mode:
1 Open a console window.
Tip: In Windows, you can start the Web Server Configuration Tool by selecting Start > Programs >
Macromedia ColdFusion MX > Web Server Configuration Tool.
2 Change to the cf_root/runtime/lib (server configuration) or jrun_root/lib (JRun J2EE
configuration) directory.
3 Start the Web Server Configuration Tool using the following command:
java_home/bin/java -jar wsconfig.jar
The Web Server Configuration Tool window appears.
4 Click the Add button.
5 Select the Configure web server for ColdFusion MX applications option.
6 In the Server drop-down list box, select the server or cluster name that you want to configure.
Individual server names in a cluster do not appear. Clustering support is only available on the
JRun J2EE configuration.
Note: The server or cluster does not have to reside on the web server computer. In this case, enter
the IP address or server name of the remote computer in the JRun Host field.
7 In the Web Server Properties area, enter web-server-specific information, and click OK.
8 Move the CFIDE and cfdocs directories from cf_root\wwwroot to your web server root
directory. In addition, copy your application’s CFM pages from cf_root\wwwroot to your web
server root directory.
Using the command-line interface
You can also run the Web Server Configuration Tool through a command-line interface. To run
the command-line interface, open a console window, change to the cf_root/runtime/lib (server
configuration) or jrun_root/lib (J2EE configuration with JRun) directory, and use the following
command-line syntax:
java_home/bin/java -jar wsconfig.jar [-options]
The following table lists the options:
OptionDescription
-ws
-dir
60Chapter 4: Web Server Management
Specifies the web server, as follows:
• IIS
• Apache
• NES
• iPlanet
Path to the configuration directory (Apache conf or NES/iPlanet
config)
OptionDescription
-site
Specifies the IIS website name. Specify All or 0 to configure the
connector at a global level, which applies to all IIS websites.
-host
-server
-username
Specifies the ColdFusion server address. The default is localhost.
Specifies the ColdFusion server name. The default is default.
Specifies a username defined to the JRun server.The default is guest
account.
-password
Specifies a password that corresponds to -username. The default is
guest account.
-norestart
-cluster
Do not restart the web server.
Specifies the JRun cluster name. Use this option to define a
connection to a JRun cluster instead of a single server.
-l
-a
-s
-map
.cfm,.cfc,.cfml,.jsp,.jws
Enables verbose logging for the connector.
Enables native OS memory allocation.
Enables SSL between the connector and JRun server.
Specifies the extension mappings list (to use the webserver
connector with ColdFusion MX, you should specify
.cfm,.cfc,.cfml,.jsp,.jws)
-filter-prefix-only
Sets ignoresuffixmap=true in the jrun.ini file. This means that the
connector module runs as an IIS extension. (IIS only).
-coldfusion
In conjunction with -upgrade, forces the replace of the connector
module regardless of version or date stamp and starts the web server
if it is down. Always use this option when configuring a web server for
use with ColdFusion MX.
-upgrade
Upgrades existing configured connectors with newer modules from a
newer wsconfig.jar.
-service
-bin
Specifies the Apache Windows service name. The default is Apache.
Path to Apache server binary file (apache.exe in Windows, httpd on
Unix).
-script
Path to Apache UNIX control script file (apachectl, slightly different
with certain Apache variants, such as Stronghold).
-v
-list
-list -host server-host
-remove
-uninstall
-h
Enables verbose output from the Web Server Configuration Tool.
Lists all configured web servers.
Lists all JRun servers on the specified host.
Removes a configuration. Requires -ws and either -dir or -site.
Uninstalls all configured connectors.
Lists all parameters.
Web server configuration61
Using the batch files and shell scripts
ColdFusion MX ships with batch files and shell scripts that implement typical command-line
connector configurations. These files are in cf_root/bin/connectors. For example,
IIS_connector.bat configures all sites in IIS to site 0, which establishes a globally defined
connector so that all sites inherit the filter and mappings.
If you use Apache or iPlanet, use these files as prototypes, editing and saving them, as appropriate
for your site.
Command-line interface examples
This section provides examples of multiple use-cases for different web servers:
This does not automatically configure newly added sites after the first "-site 0" run but you can
rerun with "-site 0" at a later time and the Web Server Configuration Tool configures new sites
only.
• Netscape on UNIX:
java_home/bin/java -jar /opt/coldfusionmx/runtime/lib/wsconfig.jar -ws nes
-dir [path to config] -map .cfm,.cfc,.cfml,.jsp,.jws -coldfusion -v
The Web Server Configuration Tool stores properties in configuration files, as follows:
• IIS In the jrun.ini file, typically found in a subdirectory of the cf_root/runtime/lib/wsconfig
directory. It also defines a filter and extension mappings in the IIS metabase.
• Apache In the httpd.conf file, typically found in the apache_root/conf directory.
• Netscape/iPlanet In the obj.conf and magnus.conf files, typically found in the server-http-
xxx/config directory.
62Chapter 4: Web Server Management
The following table describes the web server connector properties in the web server configuration
files. The web server connector uses these settings to help it find the ColdFusion server and know
which servers to connect to.
PropertyDescription
bootstrapThe IP address and port on which the JRun server’s proxy service is listening for
connector requests. JRun must also be configured to listen on this port/address
combination, the ProxyService must be activated, and the JRun server must be
running. For example, 127.0.0.1 51010.
serverstoreThe name of file that contains information on for the associated JRun server. The
connector creates this file automatically. The default is jrunserver.store.
verboseCreates more detailed web server log file entries for the connector. Enabling this
option can cause the web server’s log files to fill quickly. Specify true or false; the
default is false. In Apache, the connector writes to the error log; on iPlanet, to errors;
and on IIS, the connector writes to its own log in the related wsconfig subdirectory.
scriptpathIIS only. Points to the virtual /JRunScripts directory on the web server.
errorurl(Optional) Specifies the URL to a file containing a customized error message. This
ssl(Optional) Enables SSL between the web server and the JRun server. Specify true or
apiallocEnables native OS memory allocation rather than the web server’s allocator (for use
property is commented out by default.
false. Because most web servers are already inside a firewall, you typically leave this
property set to false (the default).
on Solaris with iPlanet at the direction of Macromedia Support staff).
Each time you run the Web Server Configuration Tool, it creates a new directory beneath cf_root/
runtime/lib/wsconfig. For example, the first time you run the tool, it creates files under cf_root/
runtime/lib/wsconfig/1, the second time, it creates cf_root/runtime/lib/wsconfig/2, and so on.
Each of these subdirectories contains the appropriate platform-specific connector module and
web server-specific supporting files.
Example configuration files
To help describe the web server configuration file parameters, this section provides examples of
connector-specific web server properties. These examples assume that JRun and the web server are
on the same computer.
Apache configuration file
A typical httpd.conf file for an installation of ColdFusion on the same machine as an Apache 2.0
web server follows.
#JRunConfig Errorurl <optionally redirect to this URL on errors>
AddHandler jrun-handler .cfm .cfc .cfml .jsp .jws
</IfModule>
IIS configuration file
For IIS, JRun uses the jrun.ini file to initialize jrun.dll (jrun_iis6.dll on IIS 6). A typical jrun.ini
file follows:
verbose=false
scriptpath=/JRunScripts/jrun.dll
serverstore=C:/CFusionMX/runtime/lib/wsconfig/1/jrunserver.store
bootstrap=127.0.0.1:51010
apialloc=false
ssl=false
ignoresuffixmap=true
#errorurl=<optionally redirect to this URL on errors>
Netscape/iPlanet configuration file
A typical obj.conf file for Netscape/iPlanet web servers follows:
You typically use the Web Server Configuration Tool to configure a connection between the web
server and ColdFusion server running on the same computer. However, you can use the web
server connector to route requests to multiple virtual sites to a single ColdFusion server. This
section also describes how to configure SSL between the web server and ColdFusion MX.
Multihoming
In a multihomed environment, you have multiple virtual hosts (also known as virtual sites)
connected to a single ColdFusion server. You might use these virtual hosts for separate
applications, such as HR, payroll, and marketing or for separate users in a hosting environment.
Note: You use web-server-specific methods to create separate virtual websites for each use.
Two important multihoming configuration tasks are copying the cfform.js file and disabling the
cacheRealPath attribute:
• Copying the cfform.js file If any of the applications under a virtual host use the cfform tag,
you must enable the virtual website to find the JavaScript files under the CFIDE/scripts
directory. You can either copy the original_web_root/CFIDE/scripts directory to a CFIDE/
scripts directory on your virtual website or modify the
cfform tags to use the scriptsrc
attribute to specify the location of the cfform.js file.
• Disabling cacheRealPath To ensure that ColdFusion MX always returns pages from the
correct server, ensure that Cache Web Server Paths is disabled in the Caching page of the
ColdFusion MX Administrator (when using the J2EE configuration on JRun, set the
cacheRealPath attribute to false for the ProxyService in the jrun.xml file).
The procedures you perform to enable multihoming differ for each web server:
• IIS
• Apache
• Sun ONE Web Server (iPlanet)
IIS
When using IIS, you use the IIS Administrator to create additional websites and run the Web
Server Configuration Tool. You store CFM pages under the web root of each virtual website.
To connect multiple virtual sites on IIS to a single ColdFusion server:
1 Use the IIS Administrator to create virtual websites, as necessary. The web root directory should
enable read, write, and execute access. For more information, see your IIS documentation.
2 Configure DNS for each virtual website, as described in your IIS documentation.
3 Test each virtual website to ensure that HTML pages are served correctly.
4 Run the Web Server Configuration Tool, as follows:
■ GUI Specify IIS for the Web Server, All for the IIS Web Site dropdown listbox and select
the Configure web server for ColdFusion MX applications field.
■ Command line Specify -site 0 and -map options, as shown in the following example:
5 The JavaScript validation used by the cfform tag references the CFIDE/scripts/cfform.js file.
However in a multi-homed environment, each virtual website may not contain this directory
and file. Either copy this file and store it in your virtual website’s web root in a CFIDE/scripts
directory or modify all
cfform tags to use the scriptsrc attribute to specify the location of the
cfform.js file.
6 Ensure that Cache Web Server Paths is disabled in the Caching page of the ColdFusion MX
Administrator (J2EE configuration on JRun, set the
cacheRealPath attribute to false for the
ProxyService in the jrun.xml file).
7 Test each virtual website to ensure that CFM pages are served correctly.
Apache
When using Apache, you modify the apache_root/conf/httpd.conf file to create virtual hosts and
run the Web Server Configuration Tool. You store CFM pages under the web root of each virtual
website.
To connect multiple virtual hosts on a web server to a single ColdFusion server:
1 Open the apache_root/conf/httpd.conf file in a text editor and create virtual hosts, as necessary.
For more information, see your Apache documentation. For example:
For additional Unix command-line examples, see “Using the command-line interface”
on page 60.
6 The JavaScript validation used by the cfform tag references the CFIDE/scripts/cfform.js file.
However in a multi-homed environment, each virtual website may not contain this directory
and file. Either copy this file and store it in your virtual website’s web root in a CFIDE/scripts
directory or modify all
cfform tags to use the scriptsrc attribute to specify the location of the
cfform.js file.
7 Ensure that Cache Web Server Paths is disabled in the Caching page of the ColdFusion MX
Administrator (in the J2EE configuration on JRun, set the
cacheRealPath attribute to false for
the ProxyService in the jrun.xml file).
8 Test each virtual host to ensure that CFM pages are served correctly.
Sun ONE Web Server (iPlanet)
When using Sun ONE Web Server version 6, you use the Server Administrator to create virtual
servers and run the Web Server Configuration Tool. You store CFM pages under the web root of
each virtual website.
Note: For earlier versions of iPlanet and Netscape Enterprise Server (NES), you must create
separate server instances for each site and run the Web Server Configuration Tool once for each site.
To connect multiple virtual hosts on a web server to a single ColdFusion server:
1 Using the Sun ONE Web Server Administrator, create virtual web servers for use by
ColdFusion MX. For more information, see your Sun ONE Web Server documentation.
2 Configure DNS for each virtual website, as described in your web server documentation.
3 Test each virtual server to ensure that HTML pages are served correctly.
4 Run the Web Server Configuration Tool, as follows:
■ GUI Specify Netscape Enterprise Server/iPlanet for the Web Server, specify the directory
containing the obj.conf and magnus.conf files, and select the Configure web server for
ColdFusion MX applications option.
■ Command line Specify -wsiplanet and the directory containing the obj.conf file, as
wsconfig.jar -ws iplanet -dir [path to config] -map
.cfm,.cfc,.cfml,.jsp,.jws -coldfusion -v
Advanced configurations67
5 The JavaScript validation used by the cfform tag references the CFIDE/scripts/cfform.js file.
However in a multi-homed environment, each virtual website may not contain this directory
and file. Either copy this file and store it in your virtual website’s web root in a CFIDE/scripts
directory or modify all
cfform tags to use the scriptsrc attribute to specify the location of the
cfform.js file.
6 Ensure that Cache Web Server Paths is disabled in the Caching page of the ColdFusion MX
Administrator (in the J2EE configuration on JRun, set the
cacheRealPath attribute to false for
the ProxyService in the jrun.xml file).
7 Test each virtual server to ensure that CFM pages are served correctly.
SSL
The web server connectors supports the use of secure sockets layer (SSL) between the web server
and a ColdFusion server. This is typically not necessary, since the web server is behind a firewall in
most production configurations. However, for maximum security, you can use SSL with the web
server connector.
To enable SSL for the web server connector:
1 Generate a keystore using the following Java keytool command. For example:
keytool -genkey -dname "cn=<server name or IP address>, ou=CFEngineering,
2 When prompted, enter appropriate passwords that are six or more characters in length.
3 Rerun keytool to add certificates to the keystore.
Note: In a production environment you would obtain a signed certificate from a certificate
authority.
4 Open the cf_root/runtime/servers/default/SERVER-INF/jrun.xml file in a text editor and set
the ProxyService
keyStore, keyStorePassword, and trustStore (optional) attributes to
appropriate values. The keyStore and trustStore attributes should be the paths and filenames
of the keystore and truststore files.
5 Download and build OpenSSL. The OpenSSL distribution is available at http://openssl.org in
a tar.gz file. You must download the distribution and build it for your operating system based
on the included installation instructions. Place the compiled OpenSSL code in a directory that
is in your system path, such as cf_root/runtime/servers/lib.
6 Open the web server connector configuration file (for example, jrun.ini, httpd.conf, or
magnus.conf) and set the
Note: If using Apache virtual hosts, the ssl property must be outside of any VirtualHost
directives.
ssl property to true.
To use SSL with the built-in web server, enable the SSLService in the cf_root/runtime/servers/
default/SERVER-INF/jrun.xml file and set the
keyStore, keyStorePassword, and trustStore
attributes to appropriate values.
68Chapter 4: Web Server Management
CHAPTER 5
Administering Security
You can secure a number of ColdFusion MX resources with password access and configure
sandbox security. This chapter describes configuration options for ColdFusion security.
Security is especially important in web-based applications, such as those you develop in
ColdFusion MX. ColdFusion developers and administrators must fully understand the security
risks that could affect their development and runtime environments so they can enable and
restrict access appropriately.
You implement development security by requiring a password to use the ColdFusion MX
Administrator and a password for Remote Development Services (RDS), which allows developers
to develop CFML pages remotely. You implement runtime security in your CFML pages and in
the ColdFusion MX Administrator. ColdFusion MX has the following runtime security
categories:
• User security Programmatically determine the logged-in user and allow or disallow
restricted functionality based on the roles assigned to that user. For more information about
user security, see Developing ColdFusion MX Applications.
• Sandbox security Using the Administrator, define the actions and resources that the
ColdFusion pages in and below a specified directory can use.
The Security area in the Administrator lets you do the following tasks:
• Configure password protection for the Administrator.
• Configure password protection for RDS access.
• Enable, disable, and customize ColdFusion security, on the Security > Sandbox Security page
(called Resource Security page in the Standard edition).
69
Security and edition differences
If you have the Enterprise Edition of ColdFusion MX, you can configure multiple security
sandboxes. If you have the Standard Edition of ColdFusion MX, you can only configure a single
security sandbox. For more on sandbox security, see “Using sandbox security” on page 70.
ColdFusion MX Administrator password protection
The Administrator installs with secure access enabled. The password that you enter during
installation is saved as the default. You are prompted to enter this password whenever you open
the Administrator.
Password protection for accessing the Administrator helps guard against unauthorized
modifications of ColdFusion MX, and Macromedia highly recommends using passwords. You
can disable or change the Administrator password on the Security > CF Admin Password page.
RDS password protection
If you configured password protection for RDS access when you installed ColdFusion, you are
prompted for the password when you attempt to access ColdFusion MX from Macromedai
Dreamweaver MX or Macromedia HomeSite+.
You can disable or change the RDS password on the Security > RDS Password page.
If you use RDS security, you rely on web server and operating system security settings to set
permissions for ColdFusion application and document directories.
Using sandbox security
Sandbox security (called Resource security in the Standard Edition) uses the location of your
ColdFusion pages to control access to ColdFusion resources. A sandbox is a designated directory
of your site to which you apply security restrictions. Sandbox security lets you specify which tags,
functions, and resources (for example, files, directories, and data sources) can be used by
ColdFusion pages located in and below the designated directory.
Note: Sandbox security is not enabled by default. You must enable it on the Security > Sandbox
Security page before ColdFusion enforces the settings.
Using multiple sandboxes (Enterprise Edition only)
By default, a subdirectory of a sandbox inherits the settings of the directory one level above it.
However, if you define a sandbox for a subdirectory, the subdirectory no longer inherits settings
from the parent, completely overriding the parent directory’s sandbox settings. For example,
consider the following directories:
If you define a sandbox for the wwwroot directory, the settings also apply to the sales, and rnd
directories. If you also define a sandbox for the rnd directory, the rnd sandbox settings also apply
to the dev and qa directories; the wwwroot and sales directories maintain their original settings.
70Chapter 5: Administering Security
This hierarchical arrangement of security permits the configuration of personalized sandboxes for
users with different security levels. For example, if you are a web hosting administrator who hosts
several clients on a ColdFusion shared server, you can configure a sandbox for each customer.
This prevents one customer from accessing the data sources or files of another customer.
Resources that can be restricted
You can restrict the following resources:
• Data Sources Restrict the usage of ColdFusion data sources.
• CF Tags Restrict usage of the ColdFusion tags that manipulate resources on the server (or
on an external server), such as files, the registry, LDAP, mail, and the log.
• CF Functions Restrict usage of the ColdFusion functions that access the file system.
• Files/Dirs Enable tags and functions in the sandbox to access files and directories outside of
the sandbox.
• IP/Ports Specify the IP addresses, ports, and port ranges that the ColdFusion tags that call
third-party resources can use.
For more information, see the Administrator online Help.
Note: When running ColdFusion MX in the J2EE configuration on IBM WebSphere, file/directory
security and IP/port security are not enabled.
About directories and permissions
When enabling access to files outside of the sandbox, you specify the filename. When enabling
access to directories outside of the sandbox, you specify directoryname\indicator, where indicator is
a dash or asterisk, as follows:
• A backslash followed by a dash (\-) lets tags and functions access all files in the specified
directory and recursively allows access to all files in subdirectories.
• A backslash followed by an asterisk (\*) lets tags and functions access all files in the specified
directory and a list of subdirectories, but denies access to files in any subdirectories.
You can also specify the actions that ColdFusion tags and functions are allowed to perform on
files and directories outside the sandbox. The following table shows the relationship between
permissions of a file and a directory:
PermissionAffect on filesAffect on directories
ReadView the fileList all files in the directory
WriteWrite to the fileNot applicable
ExecuteExecute the file Not applicable
DeleteDelete the fileDelete the directory
Using sandbox security71
Adding a sandbox (Enterprise Edition only)
ColdFusion MX Enterprise Edition lets you define multiple security sandboxes.
To add a sandbox:
1 Open the Security > Sandbox Security page in the ColdFusion MX Administrator.
The Sandbox Security Permissions page appears.
2 In the Add Security Sandbox box, enter the name of the new sandbox. This name must be either
a ColdFusion mapping (defined in the Administrator) or an absolute path.
3 Select New Sandbox from the drop-down list to create a sandbox based on the default sandbox,
or select an existing sandbox to copy its settings to your new sandbox.
4 Click Add.
The new sandbox appears in the list of Defined Directory Permissions.
Configuring a sandbox
Before you begin security sandbox configuration, analyze your application and its usage to
determine the tags, functions, and resources that it requires. You can then configure the sandbox
to enable access to the required resources and disable usage of the appropriate tags and functions.
For example, if the applications in the sandbox do not use the
cfregistry tag, you can safely
disable it.
Note: In the Standard Edition, the Root Security Context is the only sandbox. There is no initial list of
defined directory permissions.
To configure a sandbox:
1 Open the Security > Sandbox Security page (Security > Resource Security in Standard Edition)
in the ColdFusion MX Administrator.
2 (Enterprise Edition only) In the list of Defined Directory Permissions, click the name or Edit
icon for the directory.
A screen with several tabs appears. This is the initial screen in Standard Edition. The remaining
steps describe the use of each tab.
3 To disable a data source, in the left column of the Datasources tab, highlight the data source,
and click the right arrow.
By default, ColdFusion pages in this sandbox can access all data sources.
Note: If <<ALL DATASOURCES>> is in the Enabled Datasources column, any data source that you
add when creating this sandbox is enabled. If you move <<ALL DATASOURCES>> to the Disabled
Datasources column, any new data source is disabled.
4 Click the CFTags tab.
5 To disable tags, in the left column of the CFTags tab, highlight the tags, and click the right
arrow.
By default, ColdFusion pages in this sandbox can access all listed tags.
6 Click the CFFunctions tab.
7 To disable functions, in the left column of the CFFunctions tab, highlight the functions, and
click the right arrow.
By default, ColdFusion pages in this sandbox can access all listed functions.
8 Click the Files/Dirs tab.
72Chapter 5: Administering Security
9 To enable files or directories, in the File Path box, enter or browse to the files or directories; for
example, C:\pix. A file path consisting of the special token <<ALL FILES>> matches any file.
For information on using the \- and \* wildcard characters, see “About directories and
permissions” on page 71.
10 Select the permissions.
For example, select the Read check box to let ColdFusion pages in the mytestapps sandbox
read files in the C:\pix directory.
11 Click Add Files/Paths. When editing an existing sandbox, this button reads Edit Files/Paths.
The file path and its permissions appear in the Secured Files and Directories list.
12 In the Secured Files and Directories list, verify that the file path is correct.
The character after the backslash is important. For information, see “About directories and
permissions” on page 71.
Note: The Files/Dirs tab works together with the file-based permissions of the operating system.
To restrict a user from browsing another user’s directory, you must use file-based permissions.
13 Click the IP/Port tab.
14 To turn off default behavior (global access to all IP addresses and ports) enter the IP addresses
and port numbers that pages in this sandbox can connect to using tags that access external
resources (for example,
cfmail, cfpop, cfldap, cfhttp, and so on). You can specify an IP
address, a server name (such as www.someservername.com), or a domain name (such as
someservername.com). Specifying a port restriction is optional.
Note: This behavior differs from other tabs, such as CFTags, where you select items to disable. If
you set any values in this tab, external-resource tags executed in this sandbox can access only the
specified servers and ports.
For example, to allow this sandbox access to 207.88.220.3 on ports 80 and lower, perform the
following steps:
a In the IP Address field, enter 207.88.220.3.
b In the Port field, enter 80, and click This Port and Lower.
Tip: To deny access by these ColdFusion tags to an entire site, enable access for a local resource,
such as your local mail server, ftp server, and so on.
15 Click Finish to save changes to the sandbox.
Using sandbox security73
74Chapter 5: Administering Security
CHAPTER 6
Using Multiple Server Instances
When you install ColdFusion MX Enterprise using a J2EE deployment, you can use J2EE
application-server-specific functionality to create multiple server instances. Deploying
ColdFusion MX on multiple server instances lets you isolate individual applications and leverage
clustering functionality.
When using the J2EE install, you can define multiple server instances on a single machine, each
running ColdFusion MX. Running multiple instances of ColdFusion MX has the following
advantages:
• Application isolation You deploy an independent application to each server instance. Each
server instance has separate settings and because each server instance runs in its own JVM,
problems encountered by one application have no effect on other applications.
• Load balancing and failover You deploy the same application to each server instance and
add the instances to a cluster. The web server connector optimizes performance and stability by
automatically balancing load and by switching requests to another server instance when a
server instance stops running.
The remaining discussions in this chapter assume that you have installed JRun. If you have not
installed JRun, rerun the ColdFusion MX Enterprise install, selecting the JRun with CFMX
option. This installs JRun and deploys ColdFusion MX as an expanded EAR in the cfusion JRun
server.
Note: Discussions in this chapter apply to running ColdFusion MX Enterprise as a J2EE application
deployed on top of a J2EE application server. Although the examples in this chapter describe using
JRun 4, other J2EE application servers provide equivalent capabilities, and most of the concepts
described in this chapter apply when deploying ColdFusion MX Enterprise on those J2EE servers.
75
File location considerations
In the J2EE configuration, you can store CFM pages either under the external web server root or
under the ColdFusion web application root. ColdFusion MX first looks for CFM files in the web
application root and then looks in the external web server root.
The discussions in this chapter assume that you are using an external web server and that you
store your CFM pages under the external web server root.
Defining additional server instances
A single installation of JRun supports multiple server instances (also called JRun servers) running
on the same machine. Each server instance has associated with it a separate running Java Virtual
Machine (JVM), which executes all ColdFusion pages for that instance. The JVM, also known as
the Java Runtime Environment (JRE), is the software implementation of a CPU. It contains
everything necessary to run programs written for the Java platform. Additionally, you can define
classpaths, data sources, and other resources for each application at the server instance level.
You use the J2EE application server’s management console to define and manage server instances.
For JRun, this is the JRun Management Console (JMC). For more information on the JMC, see
Getting Started with JRun in the JRun documentation set.
To define a server instance:
1 Ensure that the admin JRun server is running by starting the JRun Launcher (jrun_root/bin/
jrun.exe in Windows, jrun_root/bin/jrun on UNIX). Start the admin server if it is not running.
2 Open the JMC by typing http://hostname:8000 in a browser. You are prompted for the user
name and password specified during the installation.
3 Select Create New Server, and specify a host name, server name, and server directory. In most
cases you can accept the suggested host name and server directory.
4 Click Create Server. JRun shows the ports to be used by the new server instance.
5 (Optional) Specify different port numbers and click Update Port Numbers. The JMC
automatically looks for unused ports so you don’t typically change the suggested port numbers.
Make a note of the JRun web server (JWS) port number; you use it later in this procedure to
ensure a successful server startup.
6 Click Finish. JRun creates a server that includes a default enterprise application.
7 Start the server instance using the JMC, the JRun Launcher, or the command line (jrun_root/
bin jrun start
8 Ensure that the server instance is running by typing http://hostname:jwsportnumber/index.jsp in
a browser. A Welcome page appears.
servername).
Deploying ColdFusion MX
After you create the new server instance, you must deploy the ColdFusion MX application. When
using JRun, you must deploy an expanded directory structure. If you already have ColdFusion
MX deployed on a JRun server, you can copy the ColdFusion application to the new JRun server
and it will deploy automatically. Depending on your requirements, you might have to modify
server settings, such as the data sources defined to each server instance.
For more information on deploying ColdFusion MX, see Installing and Using ColdFusion MX.
76Chapter 6: Using Multiple Server Instances
Enabling application isolation
When you install the J2EE version of ColdFusion MX Enterprise on top of JRun, you can use the
JMC to create multiple server instances and deploy ColdFusion MX on each instance. This
configuration provides multiple ColdFusion MX web applications in fully independent processes,
with no shared ColdFusion or J2EE server resources. In this configuration, you typically have a
single web server with multiple virtual hosts (or sites) and multiple server instances on one
computer.
Note: Although this discussion describes using JRun 4, other J2EE application servers provide
equivalent capabilities, and most of the concepts apply when deploying ColdFusion MX Enterprise
on those J2EE servers.
Running independent applications this way has several advantages, including the following:
• Errors at the levels of the ColdFusion application or the JRun server do not affect any other
ColdFusion applications.
• You can support multihomed servers, where a single web server supports multiple IP addresses
or domain names, such as www.mycompany.com and services.anothercompany.com, each
running out of a separate web root.
• Individual applications can use different JVM configurations, or even different JVM
implementations. This feature is particularly useful if one application requires a particularly
large Java heap. To specify customized JVM options, start the JRun server instance from the
command line using the
jvm.config file. This is explained in the “Starting and stopping JRun servers” discussion in
Installing JRun.
Note: These instructions describe creating multiple server instances on a single computer. To create
multiple server instances on separate computers, each computer requires a separate license of
ColdFusion MX Enterprise Edition.
-config option of the jrun command, which specifies a customized
To achieve complete application isolation, you use web-server-specific functionality to create a
separate website for each application. Web servers have different terminology for this concept. For
example, in IIS, you define separate websites (available in Windows server editions only) and in
Apache, you create multiple virtual hosts.
These instructions apply when running ColdFusion MX on JRun. The principles apply when
running ColdFusion MX on other J2EE application servers. However, not all J2EE application
servers integrate with external web servers. For more information, see “Multihoming” on page 65.
These instructions assume that you deploy each application at the context root of /, which enables
users to access CFM pages by specifying http://hostname/pagename.cfm. If other web applications
are running in the server instance, another web application may already use the context root of /
and you must deploy ColdFusion MX using a different context root, such as /cfusion, which
requires that users access CFM pages by specifying http://hostname/cfusion/pagename.cfm. For
more information on using a context root, see Installing and Using ColdFusion MX.
Note: Although cfusion is the context root, it does not relate to your web root directory structure and
you still store CFM pages in the web root directory.
To use multiple server instances for application isolation:
1 Create a separate server instance.
2 Deploy ColdFusion MX on the server instance.
Enabling application isolation77
3 Open the ColdFusion MX Administrator on the server instance using the built-in web server
(hostname:portnumber/CFIDE/administrator/index.cfm) and define the resources (such as data
sources and Verity collections) required for the application. Performing this step also ensures
that ColdFusion MX was deployed successfully.
4 Using your web-server-specific method, create a virtual website (or separate website) for the
application.
This is different for each web server; for more information, see “Multihoming” on page 65 or
consult your web server documentation.
5 Test each virtual website to ensure that HTML pages are served correctly.
6 Follow the instructions for your web server to configure the connection between your virtual
website and the server instance. For more information, see “Web server configuration for
application isolation” on page 78.
7 Store your application’s CFM files in the web root of the virtual website.
8 Test your application using the virtual website.
9 Test the ColdFusion MX Administrator. If you configured your web server during installation,
the CFIDE directory is under the original web root and you must copy it to each virtual website
or create a web server mapping to the original CFIDE directory.
10 Repeat these steps for each server instance.
Web server configuration for application isolation
When using multiple server instances for application isolation, the steps you perform to configure
communication between the website and the server instance differ by web server. This section
contains the following discussions:
• Configuring application isolation in IIS
• Configuring application isolation in Apache
• Configuring application isolation in SunONE Web Server
Configuring application isolation in IIS
When using multiple virtual websites with multiple server instances under IIS, you define
separate filters and mappings for each virtual website/server instance combination.
This discussion assumes that you have already created server instances and virtual websites, as
described in “Enabling application isolation” on page 77.
To configure multiple server instances for application isolation when using IIS:
• Run the Web Server Configuration Tool multiple times, once for each virtual website,
specifying a different site and server instance each time. For more information on running the
Web Server Configuration Tool, see “Using an external web server” on page 59.
Configuring application isolation in Apache
When using multiple virtual hosts with multiple server instances under Apache, you edit the
httpd.conf file manually.
This discussion assumes that you have already created server instances and virtual websites, as
described in “Enabling application isolation” on page 77.
78Chapter 6: Using Multiple Server Instances
To configure multiple server instances for application isolation when using Apache:
1 Run the Web Server Configuration Tool once, specifying the location of the Apache httpd.conf
file and any other required information.
2 The Web Server Configuration Tool creates a sequentially numbered subdirectory under
jrun_root/lib/wsconfig. You can use the subdirectory created by the Web Server Configuration
Tool for one of your virtual hosts but you must create additional subdirectories for all other
virtual hosts. For example, the first time you run the Web Server Configuration Tool, it creates
jrun_root/lib/wsconfig/1; if you have two other virtual hosts, you must manually create two
other directories, jrun_root/lib/wsconfig/mystore and jrun_root/lib/wsconfig/myemp
directories. These directories can be empty.
3 Open the jrun_root/servers/servername/SERVER-INF/jrun.xml file for each of your server
instances, ensure that the
deactivated element is set to false, and note the value of the port
element for the ProxyService service. For example:
5 For each VirtualHost directive, copy the IfModule directive from its default location outside
the
VirtualHost directive to the last element in the VirtualHost directive.
6 Delete the Apialloc, Ssl, and Ignoresuffixmap elements in the IfModule directive for each
virtual host. Modify the
Serverstore and Bootstrap elements to point to the appropriate
proxy port (from the jrun.xml file) and jrun_root/lib/wsconfig/subdirectory/jrunserver.store file,
which the web server connector creates automatically. Do not modify the
7 In the original IfModule directive, remove the Serverstore and Bootstrap lines. The
jrun-handler line.
following example shows three virtual hosts, two of which are configured for ColdFusion MX:
Configuring application isolation in SunONE Web Server
When using multiple virtual hosts with multiple server instances under SunONE Web Server,
you create multiple SunONE Web Server instances, one for each ColdFusion server instance.
This discussion assumes that you have already created server instances, as described in “Enabling
application isolation” on page 77.
To configure multiple server instances for application isolation when using SunONE Web
Server:
• Run the Web Server Configuration Tool multiple times, once for each SunONE Web Server
server instance, specifying a different configuration directory and ColdFusion server instance
each time.
Enabling load balancing and failover
Load balancing is an enterprise-level feature in which the application server automatically
alternates requests among the server instances in a cluster. Clustering also enables application
servers to route requests to a running server instance when the original server instance goes down.
Note: These instructions apply only when running ColdFusion MX on JRun. When deploying
ColdFusion MX on other J2EE application servers, consult the application server documentation for
information on enabling session replication.
You can get load balancing and failover by deploying the ColdFusion application to multiple
server instances and adding the instances to a cluster. The web server connector optimizes
performance and stability by automatically balancing load and by switching requests to another
server instance when a server instance stops running.
For maximum failover protection, use multiple computers in a cluster. However, you must
purchase a separate ColdFusion MX license for each computer.
Note: If you set up and test multiple server instances while running the 30-day Trial version, the
cluster may not continue to function appropriately when the Trial version reverts to Developer version
after 30 days.
To implement failover for the server instances in a cluster, you must enable session replication.
Session replication coordinates session information in real-time among the server instances in a
cluster. Enabling session replication lets a request be automatically routed to a running server if
the current server is unavailable.
To configure a cluster of server instances for load balancing and failover:
1 Create server instances for the cluster as described in “Defining additional server instances”
on page 76.
2 Deploy ColdFusion on each server instance as described in “Deploying ColdFusion MX”
on page 76.
3 Start each server instance.
4 Open the ColdFusion MX Administrator on each server instance using the built-in web server.
Define the resources (such as data sources and Verity collections) required for the application.
If using failover, go to the Memory Variables pages, and enable J2EE sessions. You must do this
for all server instances in the cluster.
Note: Session variables are the only memory variables that support failover. In particular,
ColdFusion components do not support failover.
Enabling load balancing and failover81
5 Open the jrun_root/lib/security.properties file and add the IP addresses of the other JRun
servers in the cluster to
6 Open the JMC and create a cluster that contains your server instances.
Note: Do not add the admin JRun server to a cluster.
7 If using failover, perform the following steps in the JMC:
a Open the cluster by clicking the cluster name in the left panel.
b Open the first server instance by clicking its name in the list.
c Open the Macromedia ColdFusion MX application.
d Specify the context path (usually /).
e Select Enable Session Replication.
f In the New Replication Buddy field, enter the names of the other servers in the cluster one-
jrun.trusted.hosts.
by-one, and click Add.
g Click Apply.
h Perform these steps for every server instance in the cluster.
8 Run the Web Server Configuration Tool. Choose your website, but instead of choosing a single
server instance, select the cluster. For more information, see “Web server configuration”
on page 59.
9 Store the application’s CFM files in your external web server root directory.
10 Test the application to ensure that load balancing and failover work as expected.
82Chapter 6: Using Multiple Server Instances
PART II
Administering Verity
This part describes the Verity search tools and utilities that you can use for
configuring the Verity K2 Server search engine, as well as creating, managing,
and troubleshooting Verity collection.
This chapter provides an overview of the advanced Verity features included in ColdFusion MX.
These include several utilities that you can use to configure, manage, and troubleshoot search
functionality in your ColdFusion applications. This chapter also introduces the Verity K2 Server,
which lets you provide high-performance search capabilities for your ColdFusion applications.
ColdFusion MX includes several Verity utilities to diagnose and manage your collections. These
tools include the mkvdk, rcvdk, rck2, and vspider utilities.
The following table describes the relationship between the major Verity utilities and the
corresponding
operates on the entire collection; the
more information, see Chapter 12, “Troubleshooting Collections with Verity Utilities,”
on page 149.
cfcollection, cfsearch, and cfindex ColdFusion tags (the cfcollection tag
cfindex tag operates on records within a collection). For
Note: Collections created with ColdFusion MX and those created externally using native Verity tools
differ in structure. When performing operations on Verity collections created with ColdFusion MX,
you may be required to include the full path to the collection. For more information, see “Collection
structure and ColdFusion MX” on page 86.
85
ColdFusion MX OEM restrictions
ColdFusion MX includes an OEM-restricted version of the Verity Server. The version of Verity
Server that is part of ColdFusion MX is restricted in the following areas:
• ColdFusion MX can only interact with one Verity Server at a time.
• Verity Server has the following document search limits (limits are for all collections registered
to Verity Server):
■ 10,000 documents for ColdFusion MX Developer
■ 125,000 documents for ColdFusion MX Professional
■ 250,000 documents for ColdFusion MX Enterprise
■ 750,000 documents for Macromedia Spectra sites
Note: Each row in a database table is considered a document.
If you install a fully licensed version of Verity Server and you configure ColdFusion MX to use
it, ColdFusion MX will not restrict document searches.
• The Verity Spider that is included with ColdFusion MX is licensed for local host indexing
only. Contact Verity Sales for licensing options regarding the use of the Verity Spider for
remote host indexing.
Collection structure and ColdFusion MX
Collections created in ColdFusion MX, either through the ColdFusion MX Administrator or by
using the
external collection is one created by a tool other than ColdFusion MX, such as the native Verity
indexing tool mkvdk. For more information on mkvdk, see Chapter 8, “Managing Collections
with the mkvdk Utility,” on page 89.
The directory structure of a collection that was created with ColdFusion MX consists of two
subdirectories—custom and file—that are not present in external collections.
The type of index used dictates which folder is populated with index data. Based on the
attribute of the
custom folder is used for
ColdFusion MX Applications.
The
your k2server.ini file. The name of the external collection (for example, col_01) is
C:\myColls\col_01. In contrast, the collection created by ColdFusion MX (cfdocumentation)
actually contains two collections—C:\CFusionMX\Verity\Collections\cfdocumentation\file and
C:\CFusionMX\Verity\Collections\cfdocumentation\custom. Using CFML tags, you only need
to refer to cfdocumentation to access both the file and custom collections. However, since Verity
tools, such as K2 Server, do not understand the ColdFusion MX collection structure, you must
explicitly specify both the file collection and the custom collection in order for K2 Server to
search collections created with ColdFusion MX.
For more information about configuring the
file” on page 133.
cfcollection tag, have different directory structures than external collections. An
cfindex tag, the file folder is used for type="File" and for type="Path"; the
type="Custom". For more information on indexing, see Developing
type information is important when you configure the collPath attribute of a collection in
collPath attribute, see “Editing the k2server.ini
type
86Chapter 7: Introducing Verity Tools
Verity search modes in ColdFusion MX
Your ColdFusion MX applications can search Verity collections using two modes:
• VDK mode The default ColdFusion MX search mode. You register a collection with
ColdFusion MX by using the
ColdFusion MX Administrator (which also uses the
cfcollection tag or by using the Verity Collections page in the
cfcollection tag).
• K2 mode The high-performance K2 Server mode. Use the ColdFusion MX Administrator
Verity Server page to configure ColdFusion MX to also search using K2 Server. Once you add
the existing collections to k2server.ini and start K2 Server, the ColdFusion MX Administrator
Verity Collections page indicates these K2 Server-registered collections. For more information,
see “Using K2 Server” on page 133.
By default, unless you configure ColdFusion MX to use K2 Server, ColdFusion MX uses VDK
mode to search collections. The
For more information about the benefits and restrictions of K2 Server, see “About K2 Server”
on page 88.
For more information on using VDK mode (the default Verity search mode), see Developing ColdFusion MX Applications.
How ColdFusion MX determines which mode to use
ColdFusion MX determines which search mode to use by examining which server (ColdFusion or
K2 Server) has registered the collection name(s) that you specified in your
Note: You cannot combine collections registered with ColdFusion MX and with K2 Server in a single
cfsearch tag. Use two cfsearch tags to search both collection types from the same ColdFusion page.
Your server may contain several Verity collections. You can register a collection with the
ColdFusion server (for VDK mode searches) and with the K2 Server (for K2 mode searches). To
register a collection for VDK mode searches, you use a
CFML or indirectly with the ColdFusion MX Administrator. To register a collection for K2 mode
searches, edit the k2server.ini file. For more information, see “Editing the k2server.ini file”
on page 133.
In the following example, the plants collection has been registered with ColdFusion MX and is
not listed in the k2server.ini file. ColdFusion MX uses the VDK mode to search this collection:
<cfsearch
collection="plants"
name="getData"
criteria="#form.criteria#">
In the following example, plants_al has been listed in k2server.ini and is a unique alias. That is,
the collection name, plants_al, is different than any Verity collections that are configured for use
by ColdFusion MX. ColdFusion MX uses K2 mode to search this collection:
<cfsearch
collection="plants_al"
name="getData"
criteria="#form.criteria#">
Tip: Check the Verity Collections page in the ColdFusion MX Administrator for possible naming
conflicts between collection and collection alias names. If you have a collection named plants that is
registered with ColdFusion MX, you must have a unique alias in the k2server.ini file to run a K2 mode
search.
cfsearch tag is functionally identical between the two modes.
cfsearch tag.
cfcollection tag, either directly in
Verity search modes in ColdFusion MX87
Verity information storage
All Verity configuration data and collection name registration information are stored in an XML
file (neo-verity.xml), which is used solely by the ColdFusion server. This XML file, which is
located in cf_root/lib, contains two collection lists. One list contains collections that are registered
with ColdFusion MX; ColdFusion MX uses the VDK mode to search these collections. The
second list contains collections that are registered with K2 Server; ColdFusion MX uses the K2
mode to search these collections. You do not need to edit this XML file.
ColdFusion MX updates neo-verity.xml whenever one of the following occurs:
• ColdFusion starts.
• You change Verity or K2 information in the ColdFusion MX Administrator.
• You change the list of registered collections in the cfcollection tag.
• ColdFusion stops.
Before ColdFusion updates neo-verity.xml, it copies the file, using the BAK extension.
Tip: If the neo-verity.xml and neo-verity.bak files become damaged, use the neo-verity.org file. This
file is a valid neo-verity.xml file that has not been modified since you installed ColdFusion MX.
About K2 Server
The Verity K2 Server is a high-performance search engine designed to process searches quickly in
a high-performance, distributed system. The K2 search system has a client/server model. K2
client applications, such as ColdFusion server, provide users access to document indexes stored in
Verity collections. K2 Server supports simultaneous indexing of distributed enterprise repositories
and handles hundreds of concurrent queries and users. You will see considerable performance
improvements when using K2 Server to search Verity collections.
The K2 search system takes advantage of the latest advances in hardware and software technology,
and provides the following features:
• Multithreaded architecture
• Support for Verity knowledge retrieval features, including topics
• Continuous operation support
• High scalability
ColdFusion MX installs K2 Server by default. You must make minor changes to configure K2
Server to work with ColdFusion MX.
88Chapter 7: Introducing Verity Tools
CHAPTER 8
Managing Collections with the
mkvdk Utility
The mkvdk utility is a command-line utility installed with ColdFusion MX. You can use it to
perform maintenance operations on Verity collections.
The mkvdk utility is an indexing application, provided with other Verity utilities, that you can
use to create and maintain collections. It is a command-line utility that you can use within other
applications or shell scripts to provide more sophisticated scheduling and other capabilities.
The mkvdk.exe file, which starts the mkvdk utility, is located in the cf_root\lib\_nti40\bin
directory in Windows, and in the cf_root/lib/platform/bin directory on UNIX.
In these pathnames, cf_root refers to the ColdFusion MX root directory. In Windows, this is
typically C:\CFusionMX; on UNIX, this is typically /opt/coldfusionmx. On UNIX, platform
refers to the UNIX version of the server that runs ColdFusion: _solaris, _hpux11, or _ilnx21.
The mkvdk utility syntax
The following is the basic syntax of the mkvdk command:
mkvdk -collection path [option] [dockey]
Multiple options and dockeys can be included, as needed. If dockey is a list of files, it should
consist of an at sign (@) followed by the filename that contains a simple list of files (for example,
@filelist). For more information about the options for the mkvdk utility, see “Getting started
with the Verity mkvdk utility” on page 91.
The following operations occur when you use the mkvdk utility to create a new collection:
1 New collection directories are created and the specified style files are copied to the style
subdirectory.
2 The style file settings are read and the required information is passed to the Verity search engine.
3 The gateway is used to open the document files, which are parsed according to the settings in
various style files.
89
4 A new partition is created, which includes an index and an attribute table.
5 Assist data is generated, which might include a spanning word list.
When problems occur during an operation, the mkvdk utility writes error messages to the system
log file (sysinfo.log). You can direct error and other messages to the console by using the mkvdk
command with the
the
-loglevel and -logfile options.
-outlevel option. You can direct messages to a file of your choice by using
The log file contains the following fields:
• Date
• Time
• Level
• Code
• Component
• Description
You can use the log file to view details about what happens during the collection creation process.
Use the mkvdk
want, as summarized in the following table:
TypeNumber
Fatal1
Error2
Warning4
Status8
Info16
Verbose32
Debug64
-loglevel command and specify the numeric identifier for the message level you
To calculate the numeric parameter, add the numbers for the message types you want to include.
The default for both
-outlevel and -loglevel is 15, which selects fatal, error, warning, and
status messages (1+2+4+8).
90Chapter 8: Managing Collections with the mkvdk Utility
■ An ellipsis (...) indicates repetition of the previous item. Thus, [filespec] [...] indicates
an optional series of filespec items.
■ filespec represents a document filename or a list of document filenames. If filespec is a
list of files, it should consist of an at sign (@) followed by the filename containing the list
(for example,
■ The -collection path argument creates or opens a collection. This argument is required.
Numerous optional syntax options are listed below. All syntax options must precede the first
filespec parameter.
Creating a collection
Creating a collection with the mkvdk utility involves setting up a collection directory structure
and inserting documents into this structure. You can create a collection in two steps, using two
separate commands.
To create a collection:
1 Set up a collection using the following syntax:
mkvdk -create -collection collectionname
Where collectionname is the path to the collection directory. Running this command creates
a collection directory that includes style files with configuration information.
Note: You can use the
collection directory structure has been created, do not to use the
collection.
@filelist).
-create option only once to create the collection directory structure. After a
-create option to update the
Accessing online Help for the mkvdk utility
To display a list of mkvdk command-line options, enter the following command:
mkvdk -help
Getting started with the Verity mkvdk utility91
Collection setup options
The mkvdk utility has a variety of collection setup options, which the following table describes:
OptionDescription
-create
-style dir
-description desc
-words
Creates a collection in the specified collection directory. It creates the
directory structure, determines the index contents and sets up the
document’s table schema according to the style files used. If the specified
collection already exists, the mkvdk utility exits rather than overwriting the
existing collection.
Specifies the style directory that contains the style files to use to create a
collection. This option can only be used with the
specify this option when you use the mkvdk utility to create a collection, the
mkvdk utility uses the style files in the common/style directory.
Sets the collection’s description. Enter alphanumeric text, such as “This
collection contains electronic mail from ABC Company.” Include the
quotation marks.
Builds the word list for all partitions in the collection.
-create option. If you do not
Examples: setting up collections
The following examples show the commands for creating a collection and building the word list.
Creating a collection
The following command creates a collection in path_2 using the style files in path_1, and submits
and indexes the document(s) in filespec:
The following command builds the word list in the collection residing in the path directory:
mkvdk -words -collection path
92Chapter 8: Managing Collections with the mkvdk Utility
General processing options
The mkvdk utility provides a variety of general processing options, which the following table
describes:
OptionDescription
-collection path
-nolock
-synch
-about
-datapath path
-topicset path
-mode mode
-common
-help
-debug
-nooptimize
-nohousekeep
Specifies the path of the collection to create or open. This option is required
to execute the mkvdk utility.
Turns off file locking. Locking is on by default.
Performs work immediately. If this option is not used, indexing work is done in
the background, as time permits.
Shows information about the collection, such as its description and the date
when it was last modified.
Specifies the datapath to use to find documents that are added to the
specified collection. All relative document paths are relative to this setting. If
you do not set this option, the mkvdk utility looks for documents next to the
collection directory.
Creates a topic index for the collection, based on the specified topic set, and
stores it in the collection directory. This facilitates quick and efficient searches
over the collection data when using topics.
Sets the indexing mode. Values are case-insensitive. The following are the
valid settings:
• Generic
• FastSearch
• NewsfeedIdx
• NewsfeedOpt
• BulkLoad
• ReadOnly
• Any custom mode defined in the style.plc file.
The default is Generic mode.
Specifies the path of the Verity common directory. If you do not use this
option, the Verity engine looks for the common directory in the directory
containing the mkvdk executable, and then along the executable search path.
The executable search path is determined by your operating system
environment settings. It is the path used by the OS to find the programs you
run.
Displays the mkvdk utility syntax options.
Runs the mkvdk command in debugging mode.
Prevents optimization by this instance of the mkvdk utility. Using this option
turns off the service-level VdkServiceType_Optimize. The service types
determine the type of work the Verity engine and its self-administration
features will execute on a collection.
Prevents housekeeping by this instance of the mkvdk utility. Housekeeping
includes deleting files that are no longer needed. Using this option turns off
the service-level VdkServiceType_DBA. (Service types are described under
-nooptimize.)
Getting started with the Verity mkvdk utility93
OptionDescription
-noindex
-charmap name
-locale name
-datefmt format
-servlev level
Prevents indexing by this instance of mkvdk. Documents are not inserted or
deleted. Using this option turns off the service-level VdkServiceType_Index.
(Service types are described under
Specifies the name of the character set to which to map all strings for your
application. Set this to a character set that your system can display properly.
Using the search engine with the English locale, the character set that any
version of Windows displays is 8859. This is NOT the name of the character
set of documents being indexed, it is only the name of the character set that
your display can handle properly. (The character set of the document is set in
the style.dft file using the /charmap option.)
Valid options are 850 and 8859. The default is no mapping.
Specifies the name of the Verity locale to be used by the mkvdk utility. The
locale name must correspond to the name of an existing locale directory,
which must exist in the install_dir/common/locale directory. Valid options are
english, deutsch, and francais. The default is english.
Converts a date field value into Verity’s internal data representation.You can
use this option in conjunction with the mkvdk options
extraction feature) and
string identifies to the date parsing routines in what order dates are written
when the date string only consists of a sequence of numbers (for example,
03/03/96). Valid options are described in “Date format options” on page 95.
The default is MDY.
Specifies service level. The specifier, level, is a string consisting of keywords
separated by hyphens, such as search-index-optimize. Valid keywords are
described in “Service-level keywords” on page 95.
-nooptimize.)
-extract (for the field
-bulk (for the bulk submit feature). The named format
Examples: processing documents
The following examples show the commands for processing documents.
Using the default options
By default, the mkvdk command submits and indexes documents specified in the command, and
services the specified collection. The following command executes the default options:
mkvdk -collection path filespec
Servicing only
The following command performs servicing only. Use this command to only index submitted
documents and service the collection:
mkvdk -collection path
Deleting documents from a collection
The following command deletes documents from a collection:
mkvdk -delete -collection path filespec
94Chapter 8: Managing Collections with the mkvdk Utility
Bulk inserting or deleting
The following command specifies bulk insertion of a list of documents:
mkvdk -collection coll -bulk -insert filespec
Where filespec is the list of files to insert. Since insert is the default, the following command is
equivalent to the preceding command:
mkvdk -collection coll -bulk filespec
The following command specifies bulk deletion of a list of documents:
mkvdk -collection coll -bulk -delete filespec
Where filespec is the list of files to delete. It can be the same file used to insert documents; the
only difference is that
-delete is specified instead of -insert (or no specification).
Date format options
The Verity engine supports many import date formats, including many textual date formats, and
the numeric date formats listed in the following table:
Format variableDescription
MDYDates written as month-day-year (US format, the default)
DMYDates written as day-month-year (European format)
YMDDates written as year-month-day (ISO international format)
YDMDates written as year-day-month (Swedish format)
USADates written in US format (the same as MDY)
EURDates written in European format (the same as DMY)
Service-level keywords
The following table describes the valid keywords for the
dataprepSame as search-index-optimize-assist-housekeep
indexSame as insert-delete
Getting started with the Verity mkvdk utility95
-servlev keyword:
Message options
The mkvdk utility provides a variety of messaging options, as described in the following table:
OptionDescription
-quiet
Displays only fatal and error messages to the console. It overrides the
-outlevel setting. For a list of message types, see the table in “The mkvdk
utility syntax” on page 89.
-outlevel (num)
Indicates which message types to display to the console. Valid values are
determined by adding together the numbers that correspond to the desired
message types. The default value is 15. For more information, see the table
in “The mkvdk utility syntax” on page 89.
-logfile filename
-loglevel (num)
Saves messages in the specified file.
Indicates which message types to route to the optional log file. Valid values
are determined by adding numbers together that correspond to the desired
message types. The default value is 15. For more information, see the table
in “The mkvdk utility syntax” on page 89.
Document processing options
The mkvdk utility provides a variety of document processing options, as the following table
describes:
OptionDescription
-extract
-insert
-update
-delete
-nosave
-nosubmit
Extracts field values from documents, using the field extraction rules specified in the
style.tde file.
Adds documents to the collection. This is the default option for the mkvdk command.
Adds documents to the collection by replacing all previous information about the
specified documents.
Marks the specified documents as deleted, and makes them unavailable for searches.
To actually remove deleted documents from the collection’s internal documents table
and word indexes, use the squeeze keyword (see “About squeezing deleted
documents” on page 99).
Specifies that a work list, which is generated by the mkvdk utility automatically when
you use the
-extract option, will not be saved in the collection directory in a file called
worklist (in the Verity bulk submit file format). By default, the mkvdk utility saves the
worklist in the worklist file.
Specifies that a work list, which is generated by the mkvdk utility automatically when
you use the
-extract option, will not be submitted to the indexing engine and will be
saved in the collection directory in a file called worklist (in the Verity bulk submit file
format). This option allows the mkvdk utility to process field extraction separately from
other indexing tasks.
96Chapter 8: Managing Collections with the mkvdk Utility
Bulk submit options
The mkvdk utility provides a variety of bulk submit options, as described in the following table:
OptionDescription
-bulk
-offset num
-numdocs num
-autodel
Interprets filespec as a bulk submit file. You can use this option with the -insert,
-update, and -delete options.
Specifies the offset into a bulk submit file or files. If you specify multiple bulk
submit files and use the
submit files.
Specifies the number of documents to insert or delete from the bulk insert file or
files. If you specify multiple bulk insert or delete files and use the
the
-numdocs setting is applied to all of the bulk insert or delete files.
Deletes the bulk submit file or files when the bulk submission work is finished.
-offset option, the offset is applied to all of the bulk
-numdocs option,
Using bulk insert and delete options
The bulk submit feature supports the insertion of documents and related field values into
collections.
To use the bulk submit feature to populate fields:
1 Define the fields in the style.sfl and style.ufl file, as appropriate.
2 Create a bulk submit file that specifies the documents to insert and the field values for each
document.
3 Run the mkvdk utility using the -bulk option and specifying the bulk submit file or files.
Collection maintenance options
The mkvdk utility provides a variety of collection maintenance options, as described in the
following table:
OptionDescription
-backup dir
-repair
-purge
-purgeback
-purgewait sec
-noservice
Backs up the collection into the specified directory. The backup does not include
the tde subdirectory. The tde subdirectory is created by and for Topic Document
Entry if Topic Document Entry is used to create or maintain the collection.
Repairs the collection, performed by an API call.
Waits the amount of time specified by the -purgewait option and then deletes all
documents in the collection, but not the collection itself. It leaves the collection
directory structure intact.
To specify a different wait period, use the
-purge option. If you do not use the -purgewait option, the default is 600
seconds.
Used with the -purge option, performs a purge in the background.
Specifies to the -purge option how many seconds to wait. If you do not specify
sec, the default is 600.
Prevents collection servicing, which includes indexing, by this instance of the
mkvdk command, performed by an API call.
-purgewait option instead of the
Getting started with the Verity mkvdk utility97
OptionDescription
-persist
-sleeptime sec
-optimize spec
-noexit
Services the collection repeatedly, at default intervals of 30 seconds. Use the
-sleeptime option to set a different interval.
Specifies the interval between service calls when the mkvdk utility is run with the
-persist option.
Performs various optimizations on the collection, depending on the value of
spec. The specifier, spec, is a string consisting of keywords separated by
hyphens, such as maxmerge-squeeze-readonly. For valid keywords, see
“Optimization keywords” on page 99.
Windows only. Causes the I/O window to remain after the program is finished. By
default, the window closes and the program exits, so that scripts calling the
mkvdk utility do not hang.
Examples: maintaining collections
The following examples show the commands for maintaining a collection.
Repairing a collection
The following command automatically repairs a collection, or enables it after manual repairs:
mkvdk -repair -collection path
Backing up a collection
The following command backs up a collection to the specified directory:
mkvdk -backup path_1 -collection path_2
Deleting a collection
To delete a collection, use the appropriate command for your operating system. For example, to
remove the collection directory structure and control files on a UNIX system, use the following
command:
rm -r -collection_path
Purging a collection
The following command deletes all documents from a collection, but does not delete the
collection itself:
mkvdk -purge -collection path
Purging a collection in the background
The following command purges the specified collection in the background:
mkvdk -purge -purgeback -collection path
Specifying persistent service
The following command runs the mkvdk command as a persistent process, so that servicing is
performed repeatedly after num idle seconds:
mkvdk -persist -sleeptime num -collection path
98Chapter 8: Managing Collections with the mkvdk Utility
Deleting a collection
The
-purge option deletes all documents in a collection, but does not delete the collection itself.
To delete a collection, use operating system commands, such as the rm command on UNIX, to
remove the collection directory structure and control files.
Optimization keywords
The following table describes the optimization keywords for the
KeywordDescription
maxcleanPerforms the most comprehensive housekeeping possible, and removes out-of-date
collection files. Macromedia recommends this optimization only when you are
preparing an isolated collection for publication. When using this type, if the collection
is being searched, files sometimes get deleted too early, which can affect search
results.
maxmergePerforms maximal merging on the partitions to create partitions that are as large as
possible. This creates partitions that can have up to 64000 documents in them.
readonlyMarks the collection as read-only and unchanged after the function call is done. This
is appropriate for CD-ROM collections.
spanwordCreates a spanning word list across all the collection’s partitions. A collection consists
of numerous smaller units, called partitions, each of which includes a word list.
Optionally, a spanning word list can be built with an ngram index.
ngramindex Builds an ngram index for the collection. An ngram index is designed to improve the
search performance for queries with the <TYPO> and <WILDCARD> operators. An
ngram index cannot be built without a spanning word list. You can build a spanning
word list and ngram index in the same command, for example:
squeezeSqueezes deleted documents from the collection. Squeezing deleted documents
recovers space in a collection, and improves search performance. (For more
information about squeeze, see “About squeezing deleted documents” on page 99.)
Using this option invalidates the search results.
vdboptConfigures the collection’s Verity databases (VDBs). Each collection consists of
smaller units called VDBs. This keyword has the effect of linearizing the data in a
VDB, and making the collection metadata contained in the VDB more streamlined. It
also lets the VDB grow to a much larger size.
tuneupPerforms the same as combining the maxmerge, vdbopt, and spanword keywords.
publishPerforms the same as all of the optimization types combined. Use this keyword to
optimize the collection for the best possible retrieval performance, such as for
publication to a network on a server or on a CD-ROM.
-optimize option:
About squeezing deleted documents
When a document is deleted from a collection, its space is not recovered. It is merely marked as
deleted and not available for subsequent searches. Squeezing actually removes deleted documents
from the collection’s internal documents table and word indexes, thus creating a smaller collection
and reducing the collection’s disk space. A smaller collection has a more efficient structure that
makes searching slightly faster and uses slightly less memory.
Getting started with the Verity mkvdk utility99
You can safely squeeze deleted documents for a collection at anytime, because the mkvdk utility
ensures that the collection is available for searching and servicing through its self-administration
features. The application does not need to temporarily disable a collection to squeeze deleted
documents, because when a squeeze request is made, the mkvdk utility assigns a new revision
code to the collection. After a squeeze has occurred, the next time the application accesses the
collection, the Verity engine notifies the application that dramatic changes have been made, and
points the application to the new collection data.
Squeezing deleted documents out of a collection is a significant update to the collection. If users
are reviewing search results at the time when squeezing occurs, the search results might be
invalidated after the squeeze operation.
About optimized Verity databases
The Verity database (VDB) is the fundamental storage mechanism responsible for supporting
dynamic access to documents in collections. A VDB consists of simple tables with rows and
columns that relate to each other by row position. VDB tables are not relational, and their
architecture supports quick and efficient searching over textual data. A VDB consists of segments
that are packed into a single file. One of the advantages of having one packed VDB file is
optimized search performance. The fewer files that need to be opened during search processing,
the faster the search performance.
The VDB optimization option optimizes the packing of a collection’s VDBs. When VDBs are
built during normal indexing operations, the segments are not stored sequentially in the one-file
VDB file system. As a result of VDB optimization, performance can be improved by reserializing
the packed segments in the VDBs so that all segments are contiguous, and VDBs can grow in size.
Optimized VDBs can grow up to 2 gigabytes in size, as opposed to the maximum 64 megabytes
for an unoptimized one.
Using this option might degrade your indexing performance when certain indexing modes are set
for the collection.
Performance tuning options
The mkvdk utility provides performance tuning options, as the following table describes:
OptionDescription
-maxfiles num
-diskcache num
100Chapter 8: Managing Collections with the mkvdk Utility
Sets the maximum number of files that the mkvdk utility can have open at once.
The default is 50.
Sets the size of the mkvdk disk cache in kilobytes. The default is 128.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.