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:
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.
good one !
ReplyDeleteas always very clear and simple to follow.
Rahul.
I'm getting a 404 error with the /flex2gateway. Any ideas on that?
ReplyDeleteNevermind, stupid error on my end.
ReplyDeleteThis config coud be used with CF8 and Glasfish 2.x?
ReplyDeleteYes it would work the same way with GF 2.
ReplyDeleteHmm, the apache part does not work, i get an 500 error the moment i un-comment
ReplyDelete"Include conf/extra/httpd-vhosts.conf"
Perhaps you made a typo in the httpd-vhosts.con file. Can you paste the code?
ReplyDeletethis is what i have added to my http-vhosts.conf removed the tag smybols <>:
ReplyDeletevirtualhost *:80
DocumentRoot "C:\dev\cfusion"
ServerName cfusion
ProxyRequests Off
proxy *
Order deny,allow
Allow from all
/Proxy
ProxyPass / http://127.0.0.1:8080/cfusion/
ProxyPassReverse / http://127.0.0.1:8080/cfusion/
ErrorLog "logs/cfusion.local-error.log"
CustomLog "logs/cfusion.local-access.log" common
/VirtualHost
virtualhost *:80
DocumentRoot "C:\dev\cfusion"
ServerName railo
ProxyRequests Off
proxy *
Order deny,allow
Allow from all
/Proxy
ProxyPass / http://127.0.0.1:8080/railo/
ProxyPassReverse / http://127.0.0.1:8080/railo/
ErrorLog "logs/railo.local-error.log"
CustomLog "logs/railo.local-access.log" common
/VirtualHost
That looks fine. Does http://127.0.0.1:8080/cfusion/ work?
ReplyDeleteYes http://127.0.0.1:8080/cfusion and http://127.0.0.1:8080/railo/index.cfm work without any problem
ReplyDeleteThis line causes the 500 error:
ReplyDeleteProxyPass / http://127.0.0.1:8080/cfusion/
Without it the default Apache site will be displayed but the url rewrite does not work
mod proxy must not be available. In httpd.conf un comment these lines:
ReplyDeleteLoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
They are un-commented. I use Apache 2.2.14...
ReplyDeleteTried re-starting Apache?
ReplyDeletesure
ReplyDeleteStupid me. I had to un-comment the mod_proxy submodule for http.
ReplyDeleteLoadModule proxy_http_module modules/mod_proxy_http.so
ReplyDeleteOh yeah this is needed aswell. I forgot to include that in the post.
have you tried to access the coldfusion adminstrator interface?
ReplyDeleteI have followed your guide and see the server dump when i enter this into the browser:
http://adobe/index.cfm
But when i try to get into the CF9 Admin Interface:
http://adobe/CFIDE/administrator/index.cfm
I see the login page without images and when i enter my password i am redirected to:
http://adobe/cfusion/CFIDE/administrator/enter.cfm
The only difference to your setup is the ServerName adobe instead of cf9gf. What's going on?
Railo works without any problem!
Yep that happened to me aswell. I just used 127.0.0.1:8080/cfusion/cfide/administrator to get the un-broken admin.
ReplyDeleteHey, i use this now in my httpd-vhosts.conf.
ReplyDeleteServerName adobe
RewriteEngine On
RewriteOptions Inherit
RewriteRule ^/(.*) http://127.0.0.1:8080/$1 [P,L]
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
Now i can reach the CF9 Admin through http://adobe/cfusion//cfide/administrator/index.cfm and it works.
Any idea how to tell railo and adobe to share the same contex root on a windows platform?
You can't I wanted to ideally do the same thing so I could use the exact same code for both CF9 and Railo but I wasn't able to do it.
ReplyDeleteI have added this mapping to both:
ReplyDelete/dev c:/dev/cfusion/
Railo understands this but Adobe does not resolve the mapping!?
@Paul - great write up, got this working in about 1/3 the time I expected.
ReplyDeleteOne question, though. I like to set up my dev sites as their own 'domain' in Apache - like myproject.dev and point the vhost to the dir where the files for that project are kept. it seems that setting up Glassfish with Apache the way to outlined that is not possible (or at least, not obvious). Can you shed some light on how to do this...if its even possible?
@Scott I would deploy a 2nd instance of ColdFusion war and set the virtual host to that. Although this is going to chew up RAM. There are ways to make Tomcat server wide but I'm not sure how to with Glassfish. If I come up with something I'll follow up.
ReplyDeleteHello,
ReplyDeletethanks for explanations!
Did you find way to move wwwroots for CF9 and Railo out of glassfish installation directory ? Like having Apache's /htdocs folder common storate for Apache, CF and Railo ? In Resin or Tomcat I'd fix clause for Railo... Don't want to have 3 different folders for development code :-)
@Rodion No I haven't. I'm not sure its possible to do that perhaps on linux with symlinks
ReplyDelete@Paul, there's solution for document root problem: http://www.marceble.com/2009/07/virtual-directories-in-glassfish/
ReplyDelete@Rodion Wow thanks. That's a great solution.
ReplyDeleteHow about cf9, glashfish and iis7?
ReplyDeleteI need iis for more reason.
ReplyDelete@Anonymous You can use a re-write rule for IIS7 or see if sun have connectors ( like tomcat ) for IIS. I havn't had to do this so I'm not sure but my first thought woudl be to simple re-wriet all .cfm/cfc requets to glassfish.
ReplyDeleteHi Paul,
ReplyDeleteI've been trying to get ColdFusion Developer 9 deployed onto GlassFish 3.1.1 (on Windows 2003 64-bit), and found your post above. I've tried deploying CF9 both as a WAR and as an EAR, and can't get either to deploy on GF 3.1.1. I get errors during the deployment, with a NoClassDefFoundError on flex.server. Did you run across that? Is there something besides ColdFusion WAR itself that needs to be installed before trying to deploy the WAR?
Thanks,
Jim
@Jim. No I never ran into the error. I haven't used GlassFish for at least 12 months now. I didn't need to do anything else other then what was described in this post. Sorry I can't be of any more help/
ReplyDelete@Paul,
DeleteFYI, I was able to deploy CF8.01 as as WAR on GF 3.1.1. That went smoothly, unlike trying both the WAR and EAR for CF9 :(...
Thanks,
Jim
Subsidiary showcasing happens to be a standout amongst the most advantageous, compelling and furthermore profoundly lucrative internet promoting technique, and offers site proprietors an exceptional savvy methods for acquiring additional cash. These projects are fundamentally gone for driving more activity to online vendors that take an interest in a given offshoot advertising program, which can normally prompt more income age for them. More Information
ReplyDeletepackers and movers allahabad
ReplyDeletePackers And Movers in gurgaon
Packers And Movers in agra
Packers and Movers Gurgaon - Best Movers and Packers in Gurgaon offers home, office and local shifting services at affordable price. Call 07835880002, Visit @
ReplyDeletePackers and Movers Gurgaon
bilecik
ReplyDeletevan
elazığ
tokat
uĹźak
O0L
5A270
ReplyDeleteKastamonu Evden Eve Nakliyat
turinabol
Kripto Para Borsaları
Tekirdağ Boya Ustası
https://steroidsbuy.net/
buy primobolan
Ankara Asansör Tamiri
Kripto Para Nedir
order testosterone enanthate
2B6F9
ReplyDeletehalotestin for sale
Urfa Evden Eve Nakliyat
clenbuterol
buy masteron
order masteron
Aksaray Evden Eve Nakliyat
KarabĂĽk Evden Eve Nakliyat
Elazığ Evden Eve Nakliyat
winstrol stanozolol for sale
EA731
ReplyDeletebinance indirim kodu %20
E84D2
ReplyDeleteeigenlayer
yearn finance
quickswap
pudgy penguins
layerzero
dappradar
uniswap
satoshivm
thorchain
0FCE2
ReplyDeletegate io
mobil 4g proxy
ilk kripto borsası
bitexen
toptan sabun
huobi
kucoin
bitrue
bitcoin ne zaman çıktı
2EBBF
ReplyDeleteprobit
binance ne demek
kaldıraç ne demek
binance referans kodu
huobi
bitexen
bingx
telegram kripto para grupları
probit
AB2BA
ReplyDeletewhatsapp canlı show
4F1A6
ReplyDeleteücretli canlı şov
DB248
ReplyDeletegörüntülü show
682F8
ReplyDeletegörüntülü şov
1AE5B
ReplyDeletewhatsapp görüntülü show