ColdFusion MX Bible phần 9 doc

124 924 0
ColdFusion MX Bible phần 9 doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

952 Part VIII ✦ ColdFusion MX Administration 2. For this example, we previously created a database named CFMXDatabase in SQL Server Enterprise Manager, as shown in Figure 43-13. (Note that you would replace CFMXDatabase with your own SQL Server database. Setting up this database is beyond the scope of this book, as it has more to do with SQL Server administration than ColdFusion.) Figure 43-13: The database in SQL Server Enterprise Manager. 3. In ColdFusion Administrator, enter CFMXDatabase (or the name of your own SQL Server database) in the Database field and 127.0.0.1 in the Server field. For the username and password, of course, use whatever you set up for this purpose. (In this example, we enter CFMXUser and the CFMXUser’s password.) Keep the default port of 1443 and enter a brief description. After you finish, the form looks as shown in Figure 43-14 (with your own database name, username and password, of course). Figure 43-14: The datasource settings form. 4. Click Submit, and you’re taken back to the list of datasources, where the new data- source now appears with an “ok” beside it. And that’s it. Now, simply referring to CFMXBibleExample in your CFQUERY and CFSTOREDPROC tags gives you access to the CFMXDatabase database. Most datasource setups are about the same, although some target databases that require a different set of parameters from those shown for SQL Server. The Oracle driver, for example, communicates with an Oracle database by using a different set of parameters, as you see in the following section. 51546228 ch43.F 1/30/03 12:29 PM Page 952 953 Chapter 43 ✦ An Overview of ColdFusion MX Administrator Defining a new Oracle datasource The process of setting up an Oracle datasource is similar to the one that we describe in the preceding section for SQL Server, but Oracle requires different connection parameters. Just as you do with SQL Server, you start by clicking the Data Sources link under Data & Services on the left-hand panel of Administrator. (Note: The Oracle driver is available only with ColdFusion MX Enterprise.) Then just follow these steps: 1. In the Add New Data Source section, enter the name of the new datasource (in this example, we’re calling it CFMXBibleOracle) and choose Oracle as the driver type; then click Add. Our Oracle installation in this example has a SID (Service ID) named CFMXServer and a user named CFMXUser. Note that administering Oracle is beyond the scope of this book; the database, username, and password used in this example should be replaced with your own values. 2. In ColdFusion Administrator, enter CFMXServer in the SID Name field and CFMXUser in the Username field. Then enter the password, leave the default port of 1521, enter a brief description, and click Submit. The built-in Type 4 Oracle driver supports multiple result sets returned from Oracle pack- ages. See Listing 10-24 in Chapter 10 for a very scalable way to accomplish this task. Verity Collections The Verity Collections page of ColdFusion Administrator (shown in Figure 43-15) enables you to manage your Verity collections. Here you can create new collections, or you can index, repair, optimize, purge, or delete an existing collection without resorting to writing code. This section assumes that you are familiar with Verity and its terminology. If you are not, please read the Verity section of Chapter 32. To create a new collection, just enter the name of the collection, the collection’s language, and the name of the directory where you want the collection to be created. The default is cf_root\verity\collections. To index a collection, click the Index Collection icon next to the name of the collection that you want to index. (This icon is the farthest left.) The indexing utility in Administrator gives you the capability to do only a path index; if you want to use file or custom indexing you must use a manually coded call to CFINDEX. Occasionally, a collection may become unstable and start producing incorrect results. If this happens, try repairing the collection. (The icon that you click to start this task is the second from the left.) Repairing the collection may take a long time, so don’t rush it, and especially don’t try to do anything else with the collection until Administrator is finished. Optimizing a collection makes it run faster. To optimize a collection, click the middle icon next to the name of the collection. Optimizing the collection may take a few minutes. The fourth icon from the left purges the collection, removing all entries from the collection but leaving the empty collection intact. The last icon, next to the collection name, deletes the collection entirely. The bottom section of this Administrator page shows all collections currently available from an attached Verity K2 Server. No actions may be performed in this section, because K2 Collections are managed through an INI file as part of the setup process for Verity K2 Server. Note 51546228 ch43.F 1/30/03 12:29 PM Page 953 954 Part VIII ✦ ColdFusion MX Administration Figure 43-15: The Verity Collections page. Verity K2 Server The Verity K2 Server page of ColdFusion Administrator manages ColdFusion’s connection to Verity K2 Server, the standalone server software that ships with ColdFusion as a high- performance alternative to ColdFusion Server’s built-in Verity routines. This page is shown in Figure 43-16: Figure 43-16: The Verity K2 Server page. The Add Verity K2 Server section of the page is where you tell ColdFusion which K2 Server to connect to. You just need to specify the name (or IP address) and port number of the server where Verity K2 is running in the appropriate fields. Connected Verity Collections is a misnomer; it should be called Connected Verity Server. This section of the page tells you which K2 Server is currently connected to the ColdFusion Server and whether the K2 Server is online. You can disconnect from the K2 Server by clicking the red X next to the server name. 51546228 ch43.F 1/30/03 12:29 PM Page 954 955 Chapter 43 ✦ An Overview of ColdFusion MX Administrator The Connected Verity K2 Collections section tells you which collections the K2 Server exposes. You can’t do anything to maintain or modify these collections, because they are managed by K2 Server’s INI file. Web Services The Web Services page of ColdFusion Administrator (shown in Figure 43-17) is where you manage ColdFusion’s connections to Web services. This form has two sections: Add / Edit ColdFusion Web Service and Active ColdFusion Web Services. Figure 43-17: The Web Services page. The Add / Edit ColdFusion Web Service is where you set up the Web-service URLs and the usernames and passwords that they require. You can assign a name to a Web-service URL here and use the name as an alias in the Webservice attribute of your CFINVOKE tags. The username and password are passed to the Web service’s basic authentication mechanism after a request for service is made. Active ColdFusion Web Services describes the Web services to which ColdFusion is currently subscribed. Each one can be edited, refreshed, or deleted. Refreshing a Web-service connec- tion releases it from ColdFusion’s cache, reestablishes the WSDL interface to that Web ser- vice, and keeps the Web service’s name unchanged, whereas removing a Web service permanently removes its name. Debugging & Logging This section of Administrator is focused more on debugging code than on configuring ColdFusion Server. From here, you can configure debugging output, view log files, and set up system probes. This section also includes scheduled tasks and a tool to analyze existing ColdFusion code to help determine incompatibilities with ColdFusion MX. The following sections describe each of these settings. Debugging Settings The Debugging Settings page of ColdFusion Administrator is where you turn on debugging and manage other performance monitoring settings. This page is shown in Figure 43-18: 51546228 ch43.F 1/30/03 12:29 PM Page 955 956 Part VIII ✦ ColdFusion MX Administration Figure 43-18: The Debugging Settings page. 51546228 ch43.F 1/30/03 12:29 PM Page 956 957 Chapter 43 ✦ An Overview of ColdFusion MX Administrator Following are the four major settings on this page, each of which is described in the four sec- tions that follow: ✦ Enable Debugging ✦ Enable Robust Exception Information ✦ Enable Performance Monitoring ✦ Enable CFSTAT Enable Debugging This check box also controls all the options in the Custom Debugging Output section. If this check box is disabled, no debugging output is shown regardless of the settings in the Custom Debugging Output section. Enable Robust Exception Information Normally, ColdFusion’s default error message shows you only the error message and detail. If this option is selected, ColdFusion includes the following extra information along with the error message: ✦ Physical path of template ✦ URI of template ✦ Line number and line snippet ✦ SQL statement used (if any) ✦ Data source name (if any) ✦ Java stack trace Enable Performance Monitoring If this option is enabled, ColdFusion Server publishes its performance metric data so that Windows Performance Monitor can process it. Among the many metrics published are the following: ✦ Running Requests ✦ Queued Requests ✦ Page Hits/sec ✦ DB Hits/sec Always enable this option if you’re load-testing your application. If your load-testing suite is a great one, such as e-TEST Suite from Empirix, it can parallel this data with the other perfor- mance metrics from your application and its supporting database servers and Web servers. Do make sure that you keep this option off in production environments, however, because publishing these metrics causes a performance hit. Enable CFSTAT If your platform doesn’t support the Windows Performance Monitor, you can use a command- line utility named CFSTAT to get the same information exposed to the Performance Monitor. Leave this option disabled unless you need it; as happens with the Performance Monitor, enabling this option causes a performance hit. 51546228 ch43.F 1/30/03 12:29 PM Page 957 958 Part VIII ✦ ColdFusion MX Administration Debugging IP Addresses The Debugging IP Addresses page of ColdFusion Administrator tells ColdFusion what IP addresses are allowed to receive debugging information. This page is shown in Figure 43-19: Figure 43-19: The Debugging IP Addresses page. You may want to restrict debugging information to a single IP address (usually 127.0.0.1), meaning that only users accessing ColdFusion from a certain location may see debugging information. Restricting this list to only those addresses of developers’ machines is usually a good idea. Logging Settings The Logging Settings page of ColdFusion Administrator (shown in Figure 43-20) tells ColdFusion where and how log entries should be stored. Figure 43-20: The Logging Settings page. 51546228 ch43.F 1/30/03 12:29 PM Page 958 959 Chapter 43 ✦ An Overview of ColdFusion MX Administrator You’ve probably never paid much attention to this page, but it is one of the more important pages in ColdFusion Administrator. From here, you can turn on the logging of slow pages and scheduled tasks, which helps you discover performance bottlenecks and related problems. This page offers the following options: ✦ Log Directory: This directory is where ColdFusion stores its log files. to Changing this value from the default probably isn’t a good idea. Most tools assume that the ColdFusion log files are in this directory, and you shouldn’t have any reason to change its location. ✦ Maximum File Size: This size limit is specified in kilobytes. After the log reaches this size, it is automatically archived. See the next section for details on how these archives are stored. ✦ Maximum Number of Archives: After this number of archives is reached, the oldest is automatically deleted. ✦ Log Slow Pages Taking Longer than x Seconds: By default, this option is disabled. Enable this feature to discover any potential bottlenecks in your system. ✦ Log All CORBA Calls: Enabling this option is probably not a good idea if your site is very CORBA-intensive, but it can be a useful debugging tool because you can use the log files to inspect every call to a CORBA object. ✦ Enable Logging for Scheduled Tasks: If this option is on, all scheduled tasks are logged as they are executed. Log Files The Log Files page of ColdFusion Administrator lets you search, view, download, archive, or delete ColdFusion’s log files. This page is shown in Figure 43-21: Figure 43-21: The Log Files page. This page enables you to keep track of ColdFusion’s log files by using a slick graphical inter- face. This feature is enabled only for ColdFusion MX Enterprise; if you are using Professional, your only option is to open the log files and view them in a text editor or build a custom application to view them. Next to each log file are icons for the following four actions (These are listed from left to right): 51546228 ch43.F 1/30/03 12:29 PM Page 959 960 Part VIII ✦ ColdFusion MX Administration ✦ Search/View: This icon takes you to the log-file viewer, where you can search the log files or browse through them to look at all the messages. ✦ Download: This option downloads the log file to your machine for offsite analysis. ✦ Archive: This option copies the log file to an archive file and clears the original log. The archive file is named logfilename.log.x, where x is the number of the log file, with 1 the most recent. ✦ Delete: This option deletes the log file entirely. Scheduled Tasks The Scheduled Tasks page of ColdFusion Administrator tells ColdFusion when and how to execute certain ColdFusion templates on a schedule. This page is shown in Figure 43-22: Figure 43-22: The Scheduled Tasks page. Normally, a ColdFusion template executes after a user requests the template with a browser. But you can also schedule a template to execute at a specific time. That’s where the Scheduled Tasks page comes in. Setting up a scheduled task involves the following parameters: ✦ Task Name: Enter an easily identifiable name for the task in this field, as you use this name to refer to the task in your scheduled-tasks logs. ✦ Duration: This setting consists of a Start Date and an optional End Date. Some confu- sion surrounds these values, because some people think that ColdFusion begins the request on the start date and ends the request on the end date. This is not the case; the value that you enter in the Start Date field is when ColdFusion starts scheduling the task, and the value in the End Date field is when ColdFusion stops scheduling the task. 51546228 ch43.F 1/30/03 12:29 PM Page 960 961 Chapter 43 ✦ An Overview of ColdFusion MX Administrator ✦ Frequency: You can select among the following three types of scheduling frequency: • One Time: As the name indicates, this task is executed only once, at the specified time. • Recurring: You can execute the task once a day, once a week, or once a month, at the specified time. If the task recurs daily, the task is executed every day at the specified time. If the task recurs weekly, the task executes on the same day of the week as the start date, at the specified time. If the task recurs monthly, the task executes on the same day of the month as the start date, at the specified time. • Daily every: This option may seem confusing because you have a Daily option for Recurring, but they do two different things. This Daily executes the task over a repeating interval; you could, for example, execute a task every hour from 12 a.m. to 12 p.m. The Start Time and End Time in this section indicate the time of the first execution and the time when execution stops for the given day, respectively. ✦ URL: As you’ve probably guessed, this field is where you enter the URL of the template that’s to execute. This value cannot be an https:// URL, as CFSCHEDULE currently does not support SSL. ✦ Username and Password: Use these parameters if the page requires basic authentication. ✦ Timeout (sec): Enter here the number of seconds to wait for a response from the server before considering the task “failed” and throwing an error. ✦ Proxy Server: If a proxy server is used, specify its address and port number here. ✦ Publish: If this option is enabled, the output from the scheduled task is saved to the file named in the File field. ✦ File: See the previous option for information. ✦ Resolve URL: If Publish is enabled, all links in the scheduled task’s output are resolved into a fully qualified URL before the content is written to the file. System Probes The System Probes page of ColdFusion Administrator (shown in Figure 43-23) tells ColdFusion when and how to execute system probes to diagnose the health of your ColdFusion Server. System probes check the “heartbeat” of your ColdFusion server and report back to you if the heartbeat cannot be detected. A system probe is a template that ColdFusion executes at a reg- ular interval, much as it does a scheduled task. The difference is that, every time that ColdFusion executes a probe, it does the following two things: ✦ ColdFusion marks the probe as either successful or failed depending on the result of executing the probe — more on this later in this section. ✦ If the probe fails, ColdFusion sends an e-mail to the site administrator telling him that the probe failed and exactly how it failed. The following three things cause a probe to fail: ✦ ColdFusion cannot connect to the probe template to execute it, either because the page does not exist or the Web server is down 51546228 ch43.F 1/30/03 12:29 PM Page 961 [...]... cf_root with the root of your ColdFusion installation) 5 Click Submit 6 Open vbjorb.properties inside of C:\CFusionMX\lib and edit the SVCnameroot property so that ColdFusion can find the root (This assumes that you are familiar with CORBA.) Restart ColdFusion Server after adding the CORBA connection 96 7 51546228 ch43.F 96 8 1/30/03 12: 29 PM Page 96 8 Part VIII ✦ ColdFusion MX Administration Security Three... consider enabling this option 97 1 52546228 ch44.F 97 2 1/30/03 12: 29 PM Page 97 2 Part VIII ✦ ColdFusion MX Administration Using J2EE Session Variables By default, ColdFusion MX doesn’t use J2EE session management and opts instead to identify a user’s Session variables through the combination of CFID and CFTOKEN sent by each of his browser requests Enabling J2EE Session variables makes ColdFusion forego CFID... never good enough After you have everything tuned to perfection, you can use ColdFusion s Archive and Deploy feature to ensure that your settings are deployed along with your application (Note that Archive and Deploy is only available in ColdFusion MX Enterprise.) ✦ ✦ ✦ 546228 PP 09. F 1/31/03 3: 09 PM Page 97 9 P ColdFusion MX Language Reference ✦ A R IX ✦ ✦ T ✦ In This Part Chapter 45 Introduction to... the first time so that ColdFusion doesn’t need to allocate memory for the tag more than once This has the side effect of locking the DLL until the ColdFusion Server service is cycled, so disable this option during development but enable it during production ✦ Description: A short description of the tag 96 5 51546228 ch43.F 96 6 1/30/03 12: 29 PM Page 96 6 Part VIII ✦ ColdFusion MX Administration Java CFX... section of Administrator tells ColdFusion how to use the Java Virtual Machine (JVM) Naturally, these settings are rather sensitive and the defaults should be acceptable for most users Modify these settings only if you have a compelling reason to do so 97 3 52546228 ch44.F 97 4 1/30/03 12: 29 PM Page 97 4 Part VIII ✦ ColdFusion MX Administration The Java Virtual Machine path tells ColdFusion where to find the... is running on an MX staging server 51546228 ch43.F 1/30/03 12: 29 PM Page 96 3 Chapter 43 ✦ An Overview of ColdFusion MX Administrator Figure 43-24: The Code Analyzer page Extensions The links in the Extensions section of ColdFusion Administrator enable you to extend ColdFusion s capabilities through other technologies, such as Java, C++, and CORBA Java Applets The Java Applets page of ColdFusion Administrator... Cache size in ColdFusion MX is a different unit of measure from earlier versions of ColdFusion Server, which measured cache size in kilobytes ColdFusion MX measures the cache size in the number of templates instead You can also speed up the cache even more by turning on the Trusted Cache feature (Trusted Cache is available in the Caching page of ColdFusion Administrator.) This option tells ColdFusion. .. to enable CFOBJECT CrossReference Part IV of this book describes CFCs, or ColdFusion Components, in detail CF Functions The CF Functions page is similar to the CF Tags page, but it enables you to disable functions rather than tags, as shown in Figure 44-3 97 5 52546228 ch44.F 97 6 1/30/03 12: 29 PM Page 97 6 Part VIII ✦ ColdFusion MX Administration Figure 44-3: The CF Functions page of the Sandbox Security... want to restrict by port) and then click Add IP Address again 97 7 52546228 ch44.F 97 8 1/30/03 12: 29 PM Page 97 8 Part VIII ✦ ColdFusion MX Administration 3 Put ftp.somewhere.com in the Server/IP Address field In the Port field, enter 15-21 and, before clicking Add IP Address, select the Port Range radio button next to the Port field to tell ColdFusion that you are entering a range rather than a single... ch43.F 1/30/03 12: 29 PM Page 96 7 Chapter 43 ✦ An Overview of ColdFusion MX Administrator Figure 43-28: The Custom Tag Paths page CORBA Connectors In this section, we’ll discuss CORBA Connectors Figure 43- 29 shows the CORBA Connectors Page Figure 43- 29: The CORBA Connectors page This page is where you set up CORBA connectors for use with Borland’s VisiBroker To get to this page in ColdFusion Administrator, . 12: 29 PM Page 95 5 95 6 Part VIII ✦ ColdFusion MX Administration Figure 43-18: The Debugging Settings page. 51546228 ch43.F 1/30/03 12: 29 PM Page 95 6 95 7 Chapter 43 ✦ An Overview of ColdFusion MX. 1/30/03 12: 29 PM Page 95 3 95 4 Part VIII ✦ ColdFusion MX Administration Figure 43-15: The Verity Collections page. Verity K2 Server The Verity K2 Server page of ColdFusion Administrator manages ColdFusion s. hit. 51546228 ch43.F 1/30/03 12: 29 PM Page 95 7 95 8 Part VIII ✦ ColdFusion MX Administration Debugging IP Addresses The Debugging IP Addresses page of ColdFusion Administrator tells ColdFusion what IP addresses

Ngày đăng: 14/08/2014, 01:21

Mục lục

    Part VIII: ColdFusion MX Administration

    Chapter 43: An Overview of ColdFusion MX Administrator

    Chapter 44: Configuration Tips and Tricks

    Choosing the Number of Simultaneous Request Threads

    Using a UUID For CFTOKEN

    Using J2EE Session Variables

    Java and JVM Settings

    Sandbox and Resource Security

    Part IX: ColdFusion MX Language Reference

    Chapter 45: Introduction to the Language Reference

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan