HOW TO SETUP AN APACHE WEB SERVER AND INTEGRATE COLDFUSION
Draft version 1.0
July 15th 2010
Software
XAMPP is an open source package designed to take almost all the work out of setting up and integrating an Apache
Web server, MySQL, PHP, PERL, etc. Once installed, all web pages that will be served will be located in
“C:\xampp\htdocs\” folder.
Download from: http://www.apachefriends.org/en/xampp.html
Current version (07/14/10): 1.7.3
ColdFusion 9 is an application server. You can freely download the demo and install a developer version which has
the full functionality of a real ColdFusion server with the only limit being 1 active connection at a time.
Download from (click on the “get trial” link, you must create an account but you can enter fake information as
the account isn’t validated and goes to the download screen immediately after):
http://www.adobe.com/products/coldfusion/
*note: For all passwords that must be set, I just use “password” since this a local development installation.
Verify Port 80 is Free On Your Computer
The Apache Web server defaults to using network port of 80. Normally that is left open but can be taken up
by a system resource or another program. Before installing XAMPP, check to see if port 80 is open. If port 80 is
taken up by something already, you will need to choose between freeing port 80 for Apache, or changing the port the
Apache web server will use. A clean install of Windows 7 or Vista should not have port 80 used.
Port 80 is the default local host port. If you simply enter the URL http://localhost/ , port 80 will be implied.
The long hand URL for port 80 on the localhost is http://localhost:80/ . If you use any other port, you must always
use the long hand method (ex. If you use port 8080 for Apache, you will always have to type in the longhand URL
http://localhost:8080/ ).
To see if Port 80 is free on your system, click on the Start button and start typing “command”. Click on the
“Command Prompt” program when it appears.
1) Navigate to your windows folder (type “cd c:\windows”)
2) Type the following: “netstat –nao | find “:80”” (copy and paste never seems to work, type it out)
(the ‘|’ character is the pipe symbol located above the backward slash key, SHIFT+”\”)
Below you can see that this system has a listening service running on port 80 (you only need to see if address
“0.0.0.0:80” is in use). Since XAMPP installs using port 80 for Apache by default, XAMPP would fail to start on
this system without changing its default port number or freeing this port. The “4” in the last column
represents process id (PID) of the process using port 80.
* (Note – to see PID’s on the task manager, select to view the PID column from the “view” menu of the Task
Manager)
Port 80 -Two Choices
1) After the installation of XAMPP is completed, change the Apache port to something else. At the end of the
XAMPP install section there will be instructions for this.
2) Disable or move whatever process is using port 80. This may require research but a common Windows 7 and
Vista Port 80 problem is listed below as an example.
Window 7 and Vista Common Port 80 problem Fix
On the screenshot above (page 2) the previous page you can see that Process ID (PID) 4 is using port 80
which is only described as an NT Kernel & System process.
On Windows 7 and Vista this can be an IIS service for “World Wide Web Publishing Service”, which is very
common and takes up port 80.
1. Go to device manager (click on the start button and start typing “Device Manager” until you see it)
2. Select “show hidden devices” from view menu
3. Expand the “Non-Plug and Play Driver” to show “HTTP” double click it to disable it (and disable or manual
some services depended on it).
4. Reboot and use “netstat -nao | find “:80″” at the command prompt again to check if port 80 is now free.
Below (only looking for 0.0.0:80) port 80 is now free and available for use by Apache.
This article explains how to change IIS port bindings as an alternative:
http://support.microsoft.com/kb/149605
Installing XAMPP
1) Run the XAMPP setup program, “xampp-win32-1.7.3.exe”
2) Leave the default destination folder set to root of your C drive (“C:\”) and click on the Install button.
3) (A DOS window will appear) The first option to install shortcuts defaults to “y”. Press return (use “Y”)
4) Hit return on the next “Should I proceed? ” option (about paths)
5) The next option is for a portable install and defaulted to “N” which you want – press return with the “N” there
(you do not want to install as a portable installation)
6) When the installation finishes you’ll see “XAMPP is ready to use” – press return
7) A time zone notice will appear – press return
8) A menu will appear – type an “x” and press return to exit
Chainging Ports If Port 80 is in Use
If port 80 is in use and you did not change it, you will need to edit an Apache configuration file before starting the
Apache web server.
1) Navigate to this folder “C:\xampp\apache\conf”, and open the file “httpd.conf” with notepad.
2) Find the line “Listen 80” and change it to a different port. Port “8080” is the most common used alternative
but you can use any port number you’d like
3) Save and Close the file.
If the Apache web server was started, you must stop and restart it for the new port # to take effect.
The downside to using this method is that you must always use the port number in URL’s now. With a default
port of 80, you never have to refer to the port number (http://localhost/xampp/ ). You will now always have
to use the new port number you’ve set (if 8080 was used you must type the long URL):
http://localhost:8080/xampp
.
Verify the Installation
1) Double click on the XAMPP Control Panel shortcut icon on your desktop
2) If already running, the XAMPP control panel will appear in your system tray.
If closed (with the “x” on it’s window) it will still be running and the icon will remain in the tray (so you can
close the control panel window without closing the program, simply double click on it in the system tray to re-
open it).
3) Click on the start button next to the Apache module (will take a few seconds to start up). If a green
highlighted “Running” does not appear next to “Apache” the server has failed to start. The most likely cause is
that the port Apache is trying to use is already in use by something else.
4) For the Apache Module, click on the “Admin” button
5) You should see the main XAMPP menu (meaning the Apache web server is running)
Install ColdFusion 9 and Integrating it into the XAMPP Apache Server
1) Run the ColdFusion 9 installation program (ColdFusion_9_WWE_win.exe)
2) Introduction: Click the NEXT button
3) License Agreement: Click the “I accept” radio button and click the “NEXT” button
4) Configure Installer: check the “developer edition” check box. The developer edition is free with the only
limit being there can only be 1 active connection at a time to the server. Then click the “next” button
5) Installer Configuration: Leave the default “Server configuration” selection selected and click “NEXT”
6) Subcomponents Installation: Leave all selected and press “NEXT”
7) Select Installation Directory: Leave the default (“C:\ColdFusion9”) and click “NEXT”
8) Configure Web Server: On a 32-bit install, click the “ADD” button. On a 64-bit install, you must select the
“Configure specific IIS website or another web server” radio button, and then click the “ADD” button.
9) On the “Add Web Server” dialog, browse to or type in the following:
a. Web Server: Select “Apache”
b. Configuration directory: C:\xampp\apache\conf
c. Directory and file name of server binary: C:\xampp\apache\bin\httpd.exe
d. Click the “OK”
e. (back on the “Configure Web Server” page) Click the “NEXT” button
10) “Choose Adobe ColdFusion 9 Administrator Location” (really means the web root directory)
a. This should be auto filled with “C:\xampp\apache\htdocs”. This entry will be wrong and should be
changed to “C:\xampp\htdocs” (ColdFusion by default expects a standalone Apache installation with
“htdocs” located inside the Apache folder. With XAMPP the “htdocs” folder is located outside the
Apache folder in the XAMPP directory.
b. Click the “NEXT” button at the bottom.
11) Type in an Administrator password. You must enter a password for everything to work correctly. Then click
on the “NEXT” button at the bottom.
12) Remote Development Server (RDS). This allows you to work with files on a server as if they are on your local
system as well as enabling other advanced ColdFusion and ColdFusion Builder features.
a. Check the “Enable RDS” box
b. Enter a password
c. Click the “NEXT” button
13) Pre-installation Summary: Click the “install” button
14) Installation complete – uncheck the “Launch the Configuration Wizard” and click the “Done” button (you can’t
enter the ColdFusion Admin page just yet).
Post Installation Instructions
1) Open the XAMPP control panel. Stop the Apache server if it’s running. Start the MySQL server if it’s not
running (you want: Apache=stopped, MySQL=running)
2) The Apache configuration file must be modified so that ColdFusion index pages will load
a. Browse to this file: “c:\xampp\apache\conf\ httpd.conf”
b. Right-click on it and choose to open it with Notepad.exe
c. Find the <IfModule dir_module> section (example below, should be in the middle of the file)
d. Add “index.cfm” to the end of the list as show below. SAVE and CLOSE the file
<IfModule dir_module>
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
home.php home.pl home.cgi home.asp home.shtml home.html home.htm index.cfm
</IfModule>
3) Set a MySQL root password
a. Open a command prompt (click on the start button, and type “CMD” into the run box).
b. Navigate to the MySQL folder (type: “cd c:\xampp\mysql”)
c. Start the MySQL command prompt by typing in: mysql -u root mysql
d. Enter the following at the MySQL command promt (using whatever password you want) and press
return:
SET PASSWORD FOR root@localhost=PASSWORD(‘password’);
4) Use the XAMPP control panel to restart the Apache and MySQL servers. Start the Apache server, then stop
and restart the MySQL server
5) In a web browser, enter this address to go to the ColdFusion Admin page. There is also a link to this page in
the ColdFusion folder of the start menu:
http://localhost/CFIDE/administrator/index.cfm
If you used another port (say “8080”) you will need to enter this address:
http://localhost:8080/CFIDE/administrator/index.cfm
If you make it to the page below, ColdFusion is running and integrated with Apache (the ColdFusion Admin
web pages are ColdFusion webpages).
6) When you enter your ColdFusion Admin password, the ColdFusion server will take a few moments to finish
setting itself up. When it finishes, there will be an “OK” button to click on the bottom right hand corner
7) You can now place ColdFusion pages in the “htdocs” folder of your XAMPP install (the place where all web
pages must go).