How to Map Apache Virtual Hosts to CFIDE

There are certain features in Coldfusion, specifically but not limited to CF8, that require direct access to the CFIDE folder. Note that it is possible to run your CF8 apps with Apache HTTP Server without having direct access to CFIDE. But when you decide to try a new feature of CF8, like the AJAX functionality (CFGRID for example) it will not work and it will not error out. There could be other bizarre functionality as well, yet to be identified.

To prevent this from happening to you, here is how you map to the CFIDE folder from all of your apache-based virtual hosts. First let me point out that my webroot/documentroot is set for C:\www and I have a virtual host configured for localhost pointed to C:\www. My CFIDE folder is located in C:\www. If your CFIDE folder is located somewhere else or even outside of your webroot/documentroot, then change the mappings to the settings required for your environment.

  1. Open the httpd.conf file in Notepad. It can be found in the conf folder in the Apache folders. For a default install, it is typically
    C:\Program Files\Apache Software Foundation\Apache2.2\conf
  2. There are a number of commented lines inside the tags. Find where it says: Options, Indexes, FollowSymLinks and add a # in front of it. Then on the next line, make sure there is no # and add: Options Indexes Includes MultiViews FollowSymLinks
  3. Scroll down to find the alias_module. Inside you will see commented out this line: # Alias /webpath /full/filesystem/path. Add a new line without a # like this
    Alias /CFIDE "C:/www/CFIDE"
  4. Scroll down to the Directory tag just below the alias_module tags, and copy the following code:
    <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    </Directory>
    Paste the code, below that which you just copied, and change the first line to the correct path, and change the next line
    <Directory "C:/www/CFIDE">
    Options Indexes Includes MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>

Once completed, restart Apache. Now if you add the following in the URL, following your virtual host path

/CFIDE/Administrator/index.cfm
it should pull up the CF Administrator. Here is an example for a virtual host configured for myAppLocal

If the CF Admin login displays, you have successfully mapped your virtual hosts to the CFIDE folder.

Comments
Cutter's Gravatar @Jim - Nice post. I covered this, in a round about sort of way, within my tutorial on configuring Apach with multi-instance CF: http://blog.cutterscrossing.com/index.cfm/2007/7/2...
# Posted By Cutter | 11/6/07 1:17 AM
Justice's Gravatar From a security standpoint this is a fairly horrible recommendation. Mapping the entire CFIDE folder is not a good idea. If you need specific virtualhosts to have access to the scripts folder, it is much more responsible to map that SPECIFIC location. An example of this would be as follows for apache:

Alias /CFIDE/scripts "<true path to scripts>"
<Directory "<true path to scripts>">
Options None
AllowOverride None
</Directory>
# Posted By Justice | 11/28/07 5:03 PM
Jim Pickering's Gravatar @Justice - Why is it not a good idea? What is the security risk?

Ray Camden apparently doesn't see much a security risk with it since he emailed me the code I used to get it working. The way I see it, it is no more of a security risk than having CFIDE in the webroot. Either way, you have to have a username and password to access CF Admin.

The CFGRID tag was not working for me and this solution worked for me. I was unaware that the scripts folder inside of CFIDE is the directory that causes CF8's AJAX features to function properly. Having deduced this from your comment, I see the value in mapping to it directly now.
# Posted By Jim Pickering | 11/28/07 8:29 PM
Copyright ©2007 JimPickering.com. Some rights reserved. BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.