On my development machine, I run ColdFusion 7 in 'multi-server' mode. This comes in handy if you need to create a separate instance of ColdFusion because of needs of a project or client. I also run Apache as my web server. While I am not a big fan of the httpd.conf file (mostly out of lack of familiarity), it makes it a lot easier to run multiple web sites on Windows XP. (Yes, I know there are tools that allow you to do this with IIS, but all the ones I have tried have been buggy and made messing with httpd.conf a pleasant experience). I also add sites to my HOSTS file and give them a 'domain' of 'dev' (boyzoid.dev, for example). This makes it easier for me to keep track of which environment I am in, and in a lot of cases, save some typing as I usually abbreviate the project (mic.dev, for example).
Like most ColdFusion developers, I wanted to play with ColdFusion 8 when it went into public beta. I wanted to be able to use ColdFusion 8 and not have to deviate much from my development practices. I wound up installing ColdFusion 8 as a .ear file and deploying it to the same instance of JRun on which ColdFusion 7 is running. This way I could manage all my ColdFusion instances in one place. I ran into one small problem though, how do I get a site configured in Apache to use the ColdFusion 8 server rather than the ColdFusion 7 server? For those who may not know, when you are using IIS and multiserver install of ColdFusion, when you add news 'sites' to IIS, you ccan specify what instance of ColdFusion to use for the site. The answer was surprisingly simple.
First, keep in mind these instructions pick up AFTER ColdFusion 8 has been installed and deployed to your JRun server and the server is running. It also assumes that Apache has already been configured to work with ColdFusion
1. Go into your JRun Admin and find the 'server' you specified when you deployed ColdFusion 8, and click the link. In my case, its named 'cf8'.
2. In the resulting screen, click the 'Services' link in the navigation bar.
3. In the next screen, click the 'Start'button next to the 'Proxy Service'. Take note of the 'proxy port', we will need that in a bit.
4. Create a directory, with whatever name you woud like) under {Jrun}/lib/wsconfig (In my case, I named it 'cf8'...original, I know)
5. Open up httpd.conf and create a <virtualHost> to use, or you can use an existing one.
6. In httpd.conf and look for a block of code that looks like:
# JRun Settings
LoadModule jrun_module "C:/JRun4/lib/wsconfig/1/mod_jrun20.so"
<IfModule mod_jrun20.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ssl false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore "C:/JRun4/lib/wsconfig/1/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51020
#JRunConfig Errorurl <optionally redirect to this URL on errors>
#JRunConfig ProxyRetryInterval 600
#JRunConfig ConnectTimeout 15
#JRunConfig RecvTimeout 300
#JRunConfig SendTimeout 15
AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
</IfModule>
This information is what Apache uses to pass off requests to ColdFusion.
7. Copy the following lines:
JRunConfig Apialloc false
JRunConfig Serverstore "C:/JRun4/lib/wsconfig/1/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51020
8. Paste the above lines inside the <virtualHost> block you created, or chose, in step 6.
9. In the line: JRunConfig Serverstore "C:/JRun4/lib/wsconfig/1/jrunserver.store", change the path so it matches the path of the directory you created in step 4. Make sure you keep the '/jrunserver.store' on the end. Don;t worry about the file not being there, it will get added auto-magiaclly.
10. In the line JRunConfig Bootstrap 127.0.0.1:51020, replace the port number (the number after the colon) with the 'proxy port' number we noted in step 3.
11. Restart Apache.
The <virtualHost> you created will now use ColdFusion 8 instead of the default server (which in my case was ColdFusion 7).
How do we know its using ColdFusion 8? Easy, just create a test page with <cfdump var="#server#" />, you'll see a version number that begins with '8'.
You can also use this method for pointing Apache to different instances of the same version of ColdFusion, since, as far as JRun cares, they are all just servers.




10 comments
I have just wondered JVM compatibility when you deploy CF8 on CF7 JRun server. Are there any problem? Or do you install new JVM and point it to the new one in CF admin?
The other point is also deploying CF7 on a multi server CF8 installation. Do you think this is possible?
I also would suggest a solution which contains not only Apache, also PHP and MySQL etc. XAMPP - http://www.apachefriends.org/en/xampp.html
As long as there were no issues with the JVM, I think you would be able to deploy CF7 to a server already running CF8 if you deploy it as a .ear file like I did with CF8.
I do know that the way you get the server to use the different JVM is in a switch used when the server is started.
JRun will not accept request. Check JRun web server configuration and JRun mappings on JRun server.
Do you have any ideas on what could be causing it or how I could fix it, this seems like a simple process.
This is what I have in the httpd.conf file:
<VirtualHost *:80>
DocumentRoot c:\inetpub\wwwroot\fun
ServerName fun
JRunConfig Apialloc false
JRunConfig Serverstore "C:/JRun4/lib/wsconfig/cfusion8/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51040
</VirtualHost>
If I remove the JrunConfig lines, the site runs fine.
Not sure if you have moved onto the FULL CF8 rather than the beta. I just upgraded from the beta and CF8 would only work when I went directly to the port, previously I had the beta CF8 and CF7 playing happily on port 80 with apache.
The solution was to edit the jrun.xml file for the CF8 server. Mine was located at <JRun>\servers\cf8\server-inf\jrun.xml
For some reason the deactivated setting for the JRunProxyService settings is set to true by default, search for JRunProxyService to find the deactivated setting and set it to false. Restart everything and try again.
I think the beta had "deactivated" set to false by default. This certainly fixed it for me. Good luck.
I specify the directory name in the path to the serverstore, however the serverstore directory does not exist on my machine and everything works just dandy.
i.e.JRunConfig Serverstore "c:/JRUN4/lib/wsconfig/jobs2web/jrunserver.store"
There is no 'jobs2web' directory.
I'm running CF 8.0.1 and had the same problem as the other Eric (I'm a different Eric).
I noticed that my original server instance had the 'deactivated' value correctly set to 'false'. I wonder why it sets it to 'true' on the newly created instances. Oh well, you saved me a bit of headache (I think the new gray hairs will probably stay though ;)
Thanks again,
Eric P