After installing ColdFusion 8 and Apache successfully you may still see an “HTTP 500 Internal Server Error” when navigating to a ColdFusion page. All is not lost, you simply need to configure, or check the configuration of Apache.

Apache requires very little post installation modification, but it is always good practice to check the httpd.conf file to ensure that the ColdFusion “install” scripts did what they were supposed to do.

If you haven’t confirmed that Apache is running, open your browser and point it to http://localhost/ (unless you specified a real URL during installation). You should see the Apache test page. If you see an error, review the Apache installation steps to make sure you followed all the steps correctly, and/or check your log files for more detailed errors.

Now we know Apache is running, but how about ColdFusion? Point your browser to the ColdFusion Administrator found commonly at http://localhost/CFIDE/administrator/index.cfm and see what happens. One of three possible failures could occur:

  1. Your browser prompts you to save the .cfm file to your computer. There a couple of possible resolutions to this. Firstly restart the Apache service. If this does not resolve the issue you will need to check the httpd.conf file to ensure that the ColdFusion module is being loaded. The file can typically be found in the C:\Program Files\Apache Software Foundation\Apache2.2\conf\ directory.
    Make sure that the DirectoryIndex has a reference to the index.cfm file (i.e. the default file):Apache dir_module DeclarationEnsure that the LoadModule jrun_module "C:/ColdFusion8/runtime/lib/wsconfig/1/mod_jrun22.so" is also present:

    Apache JRun Settings

    If you need to edit this file, restart the Apache service after you have saved the changes.

  2. You get a message that the CFIDE folder cannot be found. This is more likely to be a problem with where you placed the ColdFusion application during install. The default location is in the Apache directory (C:\Program Files\Apache Software Foundation\Apache2.2\htdocs), so check in the http.conf file to ensure the DocumentRoot is pointing correctly. Alternatively, copy this folder to your localhost webroot (e.g. C:\WebRoot) ensuring that the DocumentRoot points to your webroot (see the yellow box in the second screen-shot).
  3. You get another message which probably means that you need to reinstall ColdFusion, and/or Apache!

And that is it, you can start using ColdFusion and developing applications.

Apache is controlled by a series of configuration files but the one we will be dealing with here is httpd.conf. This file contains instructions on how Apache should run. Several companies offer GUI-based Apache front-ends, but it’s easier to edit the configuration files by hand.

Remember to make back-up copies of all your Apache configuration files, in case one of the changes you make while experimenting renders the Web server inoperable.

Also, remember that configuration changes you make don’t take effect until you restart Apache.

Configure the httpd.conf File:

The httpd.conf file can be found in the conf directory in your Apache installation. In my case, this is the following location:

C:\Program Files\Apache Software Foundation\Apache2.2\conf

1. To include the correct default or index file, you need to find the following code and make sure that your default file name is included (see screenshot).

<IfModule>
DirectoryIndex index.htm index.html
</IfModule>

Apache httpd.conf DirectoryIndex Configuration

For ColdFusion and PHP you would also need to include their equivalents, i.e. index.cfm and index.php.

2. Set up a virtual host definition:

<virtualhost>
DocumentRoot c:\WebRoot
ServerName localhost
<directory>
Order allow,deny
Allow from all
</directory>
</virtualhost>

Make sure that the directory permissions are set otherwise a directory forbidden message (such as below) will be displayed.

Unsuccessful Apache Configuration

3. Restart the Apache service. You should then be able to browse to your local website.

Successful Apache Configuration

4. If you’re doing something cunning like setting up an alias for the local site, e.g. http://whatley.local/ rather than the usual http://localhost/whatley/ then you may need to edit your hosts file e.g.:

Hosts File Configuration

In my case, the hosts file is found in the following location: C:\Windows\System32\drivers\etc. You can simply edit this file in notepad, much like with httpd.conf.

And that is all there is to it.