Download and install java sdk ( I used 1.6.17 ) ( note you need the JDK not JRE )
Download glassFish
Download ColdFusion 8 or 9
Download Apache

I used Windows Server 2008 64bit but the process is the same for 32bit or Win 2k3.  It's also ( obviously ) different on linux or unix but not majorly.

When installing glassFish did not detect java home correctly so I provided the location via the cmd line.



The install is very straight forward I did not select anything unusual and just clicked through:


Once glassFish was installed I started the server:




Then browse to:  http://127.0.0.1:4848 to get to the admin console.



I choose to leave the admin with no authentication so it will just load to the console.

Before you look at the console we will need to create a ColdFusion war.  Run the ColdFusion installer and select "JEE Configuration"


This will produce the war file ready for deployment.  For me the output was c:\coldFusion9\cfusion.war

Now go back to the control panel.  Select "Applications" from the menu.  Then select "Deploy".  Choose a file from the local file system and leave the name as cfusion.



Once the application is deployed we can launch it by clicking launch button and you will see:


404 error's.  This is because there are no .cfm files if you went to /CFID/administrator you would would be at the CFADMIN.

I'll skip the CFADMIN and make a index.cfm:

Contaning:






Reload the Original page that was launched by clicking "Launch"


And ColdFusion 9 is running on GlassFish.

This is on port 8080 but I want it to run behind apache on port 80 without the /cfusion

Make sure IIS is not running. Install Apache.  Apache for windows come with all the modules you're likely to need but most are commented out.  Test to make sure Apache is runnign and http://127.0.0.1 should the standard message "It works".

Now we will setup the proxy.

Around line 110 of httpd.conf uncomment 2 modules mod_proxy.so and mod_proxy_connect.so



Also un-comment


Open {apacheInstallDir}\conf\extrahttpd-vhosts.conf

create a new vhostBlock


I created a dummy entry in the Windows host file so http://cf9gf resolves locally. I'll be using this as the test domain.

Restart apache and look for errors.



If there are no errors you should now be ready to proxy from apache to glassFish on port 80.



Done.

Now GlashFish is no longer listed here: http://www.adobe.com/products/coldfusion/systemreqs/ but it still works fine.

Also note the /flex2gateway works fine aswell.

5 comments:

Rahul said...

good one !

as always very clear and simple to follow.

Rahul.

Chris said...

I'm getting a 404 error with the /flex2gateway. Any ideas on that?

Chris said...

Nevermind, stupid error on my end.

Franklin May said...

This config coud be used with CF8 and Glasfish 2.x?

Paul Kukiel said...

Yes it would work the same way with GF 2.

Post a Comment