Setting up Apache as the server for ColdFusion really shouldn't be hard, but because there's a jrun bug in ColdFusion, I wasted several hours on set up.
I'm hoping by writing the steps down, that I can save myself some headaches when I have to set it up again on a new machine.
Here's my setup:
I am running Windows Vista Home Edition 64 bit and had two servers set up for ColdFusion 8 on port 8500 and 9 on 8501.
Here are the basic steps:
1. Uninstall any previous versions of Apache
2. Even after uninstall, folders remain so delete any remaining folders (usually located in the C:\Program Files (x86)\Apache Software Foundation\Apache2.2 folder
3. Turn off your firewall
4. Stop User Account Control. To do this, run msconfig, click on the Tools tab, scroll down and launch Disable User Account Control.
5. Reboot
6. Get the most recent version of Apache from http://httpd.apache.org and make sure you choose the right installer for your system, save it to your C:\Users\YourName folder and rename it to apache.msi (for lazy typists)
7. Navigate to Start/All Programs/Accessories/Command Prompt, right click on it to Run it as Administrator.
8. If you aren't already in the folder where your apache.msi file is located, navigate to it
9. Type msiexec /i apache.msi
10. That will open the apache installer. Navigate through and on the Server information page, put "localhost" in the text field for the Network Domain and the Server Name, choose the radio button for All users on port 80 as a service, choose "Typical" installation and let Apache install in the default location (for me that was C:\Program Files (x86)\Apache Software Foundation\Apache2.2)
11. Reboot
12. Go to http://localhost and you should see, "It works". All well and good. That means that you can now put things in your C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs folder and run them on your server. That will work fine for one site that uses html, but I want to change the server directory to c:\Users\myname and I want to run ColdFusion.
12. Right click on Notepad and choose to Run as Administrator and open the C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf
httpd.conf file
13. Find the DirectoryIndex and add index.cfm to it (right before index.html)
14. Change your DocumentRoot to C:/Users/myname (by default it will be set to C:\Program Files\Apache Software Foundation\Apache2.2\htdocs) do not use a trailing slash
15. Further down in the file you will see a <directory "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs"> reference. Change that to <directory "C:\Users\myname">
16. In that directory section change AllowOverride None to AllowOverride All
17. Put an index.html file in your c:\Users\myname folder, restart Apache, and run http://localhost again to make sure Apache is running in the new location
18. Take a deep breath, or have a glass a wine to prepare for the trouble ahead.
19. At this point you should look for this line in the httpd.conf file (LoadModule jrun_module "C:/ColdFusion8/runtime/lib/wsconfig/1/mod_jrun22.so"). In my case, it wasn't there and that was the source of the configuration nightmares, but if it is there go ahead and navigate to http://localhost/CFIDE/administrator/index.cfm and see what happens. (Do not just add that line to the file, it won't work.)
20. This next step might not work, but we need to do it to determine our next course of action. If it works, it will add the LoadModule jrun_module lines to your httpd.conf file, so save and close the httpd.conf file. Stop apache. Then go to Start/All Programs/Adobe/ColdFusion 9/ and run the Web Server Configuration Tool. Set your server to localhost, choose coldfusion, point to the directory where the httpd.conf file is and check the box to include ColdFusion 9. Save and try to restart apache.
21. For me, apache wouldn't start again. Finally after much trial and error, I found there is a hotfix for this. CVE-2009-1876 at http://www.adobe.com/support/security/bulletins/apsb09-12.html
After some trial and error, I had to download the wsconfig.jar file from there, save it to my wsconfig home folder (which was confusing because on my machine it was not c:\ColdFusion9\runtime\lib - it was c:\ColdFusion9\runtime\jre\bin)
So I save the wsconfig.jar there and then open a command prompt and type:
java -Dtrace.ci=1 -jar wsconfig.jar -upgrade -v
That added the LoadModule jrun_module to the httpd.conf file
Then I was able to restart Apache and ColdFusion was configured to work with it!
Don't forget to enable User Account Control and turn on your firewall
I still have to set up some virtual hosts, but will post on that at a later date.
Cheers!
No comments:
Post a Comment