Welcome!

You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion

ColdFusion: Article

Undocumented ColdFusion MX - 2

Undocumented ColdFusion MX - 2

Several months ago I wrote a column entitled "Undocumented ColdFusion MX - 1," (CFDJ, Vol. 4, issue 9). I appended a "1" to the title in anticipation of there being a "2" at some later date. Well, that time has come. That column (which apparently was highly controversial and upset quite a few readers, but fortunately made even more happy) exposed and explained the use of the ColdFusion factory object. This time we'll look at some of the configuration files used by ColdFusion MX - files that can be tweaked as needed (and no controversy this time, I think).

Caveat emptor: Undocumented means unsupported - you may access and tweak the files discussed here, but you do so at your own risk. Undocumented features and files may be changed or removed in future versions of products. That's what distinguishes the documented from the undocumented - vendors are under no obligation to support anything undocumented. Use at your own risk.

Introduction
Unlike previous versions of ColdFusion that stored all sorts of configuration options and settings in the Windows registry (or a registry emulator on Unix machines), most ColdFusion MX configuration options are stored in XML files. There are lots of benefits to storing configuration information in XML files, but for ColdFusion developers, two benefits stand out:

  • Tweaking the registry was painful (and rather scary); XML files are easily (maybe too easily) read and accessed (by both man and machine).
  • Unlike the registry, XML files are suitable for use on all operating systems.

    But before you even touch ColdFusion's configuration files, here are a few rules to keep in mind:

  • Always make backups.
  • Some of the ColdFusion

    XML files are well documented (in embedded comments), others are not. If you can't find the documentation you need, well, you probably won't. With one exception, the files that configure the integrated JRun server (and HTTP server) are documented in the JRun documentation (but not the ColdFusion documentation).

  • If you do make changes you'll usually need to restart ColdFusion for those changes to take effect.
  • Use a real editor; XML is picky, if you drop an ending tag or mess up nesting or lose a quote, well, things will break. So, be safe, and use an editor that is XML aware.

    One final note - the files and directories referred to here apply to ColdFusion MX. If you are using ColdFusion MX for J2EE, then paths and files will likely differ.

    XML Files, Mostly
    Ready to look at XML files? Great, but first, one non-XML file that you should be aware of. The lib directory under the ColdFusion root contains a file named password.properties. This file contains the ColdFusion Administrator and RDS passwords. You can't change the passwords in this file directly, but if you do forget your ColdFusion Administrator password, you can use this file to gain entrance. Here's how:

    1.   Open the password.properties file in a text editor.
    2.   Delete the password and rdspassword values (all text after the =).
    3.   Change the value of encrypted to false.
    4.   Save the file.
    5.   Restart ColdFusion. You'll now be able to access the ColdFusion Administrator to set a new password.

    There are other .properties files in the lib directory, but you'll find them to be of little interest.

    The web.xml File
    The web.xml file is an important one. It is found in the WEB-INF directory under the Web root. The top of the file contains several application parameters in <context-param> sections. One of the parameters is named coldfusion.compiler.saveJava and, as its name suggests, if set to true, will force the ColdFusion compiler to save the generated Java source code (instead of just the compiled bytecode). You'll not want to ever edit the .java files directly, but if you are curious as to what the ColdFusion-generated Java code looks like (or if you need help proving to some naysayer that ColdFusion really is a Java compiler) then set this parameter to true.

    This file also contains a series of servlet mappings, each in a section named <servlet-mapping>. These specify the file extensions that ColdFusion should process. You'll not want to change any of the default mappings, but if you want ColdFusion to process additional file extensions then you'll want to add those mappings here. The safest way to do this is to copy an entire section (from <servlet-mapping> to </servlet-mapping>) and then just edit the <url-pattern> as needed.

    You can also use web.xml to completely disable ColdFusion RDS if needed (many administrators opt to do this on production servers as a security precaution). Prior to ColdFusion MX, RDS could be disabled by simply not running the RDS service; in ColdFusion MX it's a little trickier. To disable RDS, locate the <servlet-mapping> for the servlet named RDSServlet, and comment out the entire section using <!-- and --> (from before <servlet-mapping> until after the matching </servlet-mapping>).

    web.xml also contains a list of default files (or welcome files). These are the files that will be used if a URL contains a directory name but not an explicit file name. The default file names are index.cfm, index.html, and index.htm, and are listed in a section entitled <welcome-file-list> (each file is specified as a <welcome-file>). You may add file names to this list if needed. Just remember that files are located and used in the order defined.

    Another interesting configuration option in this file is the <error-page> section, which is used to map specific HTTP errors to CFM files that are used when the error occurs. By default, only HTTP error code 500 is mapped, but you can add your own mappings if you so wish.

    The jrun-web.xml File
    The jrun-web.xml file is in the same directory as web.xml. You'll only want to edit this file if you change the location of the ColdFusion document root after installation. jrun-web.xml contains a series of <virtual-mapping> sections, and to change the document root, edit the /* mapping as needed.

    If you do move the document root, be sure to move the CFIDE directory to the new document root or you'll not have access to the ColdFusion Administrator, the CFC viewer, <CFFORM> .js files, and more.

    The jrun.xml File
    Another extremely important file is the jrun.xml file, which is under the ColdFusion root in the \runtime\servers\default\SERVER-INF directory. As its name suggests, jrun.xml is used to configure ColdFusion's integrated JRun server. Be extremely careful in this file, you'll not want to make changes without really knowing what you're doing.

    But there is one section that you should be aware of. The file contains <service> sections used to configure the various services used by JRun (even if you are not using JRun directly). One of those services is the integrated HTTP server that's configured in the section named jrun.servlet.http.WebService. If you want to change the port that the integrated HTTP server runs on (the default is 8500) or want to disable it altogether (deactivate it), this is where you can do that.

    Another extremely important setting in jrun.xml is the cacheRealPath parameter for the proxy service. If you have multiple Web sites on a single host, you must turn this option off (or you will end up with the wrong files being served when file names conflict). Unfortunately, by default, cacheRealPath is true, so if you do have multiple Web sites (as most of us do), edit this file, locate the <service> named ProxyService, find the attribute named cacheRealPath, and set it to false.

    The default-web.xml File
    default-web.xml is in the same SERVER-INF directory as jrun.xml. This file defines servlets used by JRun, one of which is the FileServlet. This servlet has a configuration parameter named browseDirs that controls file browsing (the behavior whereby if a URL is requested without an explicit file name specified, then a directory of files can be displayed for selection). The default is true (display file list for browsing and selection); set it to false to prevent file browsing.

    What Next
    As you can see, ColdFusion's configuration files are extremely important, and whether you need to tweak them or not, you should be aware of what they are and what they do. Of course, most of what they do is not for us mere mortals to know, but here's a hint - scan the Macromedia Support TechNotes for articles on JRun's configuration files. Much of what you'll find there applies to ColdFusion MX as well.

    Summary
    ColdFusion MX made the move from proprietary to standards based, and with that move came XML configuration files that control just about every aspect of ColdFusion (and its underlying JRun server). As long as you proceed with caution, being able to tweak these files can be a lifesaver.

  • More Stories By Ben Forta

    Ben Forta is Adobe's Senior Technical Evangelist. In that capacity he spends a considerable amount of time talking and writing about Adobe products (with an emphasis on ColdFusion and Flex), and providing feedback to help shape the future direction of the products. By the way, if you are not yet a ColdFusion user, you should be. It is an incredible product, and is truly deserving of all the praise it has been receiving. In a prior life he was a ColdFusion customer (he wrote one of the first large high visibility web sites using the product) and was so impressed he ended up working for the company that created it (Allaire). Ben is also the author of books on ColdFusion, SQL, Windows 2000, JSP, WAP, Regular Expressions, and more. Before joining Adobe (well, Allaire actually, and then Macromedia and Allaire merged, and then Adobe bought Macromedia) he helped found a company called Car.com which provides automotive services (buy a car, sell a car, etc) over the Web. Car.com (including Stoneage) is one of the largest automotive web sites out there, was written entirely in ColdFusion, and is now owned by Auto-By-Tel.

    Comments (3) View Comments

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    Most Recent Comments
    Fabrice Billiotel 02/10/06 03:07:38 PM EST

    Hi Ben,

    Well i've modified web.xml file to ask ColdFusion to process pdf file extensions.
    It works fine but i have a problem :
    if pdf file contains something like

    Leif 05/07/03 09:20:00 PM EDT

    Jeff,

    In order to access the file, you'd need admin rights on the server it runs on - and if you had that, you could do lots more than just change CF Admin settings. Keep the server secure and you're OK.

    Jeff 04/10/03 09:41:00 PM EDT

    Ben-
    Doesn't the info you gave on page 2, about password.properties, allow anyone to change the admin password and thus circumvent the reason there is a password in the first place?

    If I read this correctly, you just gave hackers a backdoor into the CF admin controls, which is pretty scary.

    Please tell me I misread this and that I just don't understand some part of it.

    Jeff

    @ThingsExpo Stories
    Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, will discuss some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he’ll go over some of the best practices for structured team migrat...
    SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.
    SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
    Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, will discuss how they bu...
    Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, will discuss how from store operations...
    As hybrid cloud becomes the de-facto standard mode of operation for most enterprises, new challenges arise on how to efficiently and economically share data across environments. In his session at 21st Cloud Expo, Dr. Allon Cohen, VP of Product at Elastifile, will explore new techniques and best practices that help enterprise IT benefit from the advantages of hybrid cloud environments by enabling data availability for both legacy enterprise and cloud-native mission critical applications. By rev...
    Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant tha...
    SYS-CON Events announced today that Datera will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Datera offers a radically new approach to data management, where innovative software makes data infrastructure invisible, elastic and able to perform at the highest level. It eliminates hardware lock-in and gives IT organizations the choice to source x86 server nodes, with business model option...
    With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
    Infoblox delivers Actionable Network Intelligence to enterprise, government, and service provider customers around the world. They are the industry leader in DNS, DHCP, and IP address management, the category known as DDI. We empower thousands of organizations to control and secure their networks from the core-enabling them to increase efficiency and visibility, improve customer service, and meet compliance requirements.
    Digital transformation is changing the face of business. The IDC predicts that enterprises will commit to a massive new scale of digital transformation, to stake out leadership positions in the "digital transformation economy." Accordingly, attendees at the upcoming Cloud Expo | @ThingsExpo at the Santa Clara Convention Center in Santa Clara, CA, Oct 31-Nov 2, will find fresh new content in a new track called Enterprise Cloud & Digital Transformation.
    SYS-CON Events announced today that N3N will exhibit at SYS-CON's @ThingsExpo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. N3N’s solutions increase the effectiveness of operations and control centers, increase the value of IoT investments, and facilitate real-time operational decision making. N3N enables operations teams with a four dimensional digital “big board” that consolidates real-time live video feeds alongside IoT sensor data a...
    SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp emp...
    Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
    SYS-CON Events announced today that Avere Systems, a leading provider of hybrid cloud enablement solutions, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere Systems was created by file systems experts determined to reinvent storage by changing the way enterprises thought about and bought storage resources. With decades of experience behind the company’s founders, Avere got its ...
    SYS-CON Events announced today that Avere Systems, a leading provider of enterprise storage for the hybrid cloud, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere delivers a more modern architectural approach to storage that doesn't require the overprovisioning of storage capacity to achieve performance, overspending on expensive storage media for inactive data or the overbui...
    SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
    SYS-CON Events announced today that Ryobi Systems will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ryobi Systems Co., Ltd., as an information service company, specialized in business support for local governments and medical industry. We are challenging to achive the precision farming with AI. For more information, visit http:...
    High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, will discuss how by using...
    In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...