House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Search cf-talk

July 04, 2009

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Home /  Groups /  ColdFusion Talk (CF-Talk)

coldfusion and jboss/tomcat

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dinner
03/11/2007 07:53 PM

Hi!     I'm enjoying running CF on jboss/tomcat, with the sole exception being- JBoss wants everything under the root context (say, /cfusion) It wouldn't be a problem if all my projects were set up to not care, but sadly, some of them expect to be @ "/" vs "/cfusion/cfapp/". I could set up a context for each CF app, but I've got like >20 of them, and I don't really want to put a WEB-INF folder in each. Or add 20 tomcat virtual hosts to match my apache virtual hosts. I've got apache set up to use mod_proxy_ajp, and my projects are all hosted at 127.0.0.1, with different host names, using apache NamedVirtualHosts. (http://proj1/, http://proj2/, etc.) Any suggestions on how to use a single CF instance to serve multiple websites when running on top of tomcat/jboss? I like separate instances for production, but I've only got soooo much RAM locally. -- All truth is simple... is that not doubly a lie? -Friedrich Nietzsche

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Steve Brownlee
03/12/2007 11:37 AM

It's actually quite simple to do. Just takes some tinkering with your web.xml file. http://www.fusioncube.net/index.php/coldfusion-from-anywhere.html Steve Brownlee http://www.fusioncube.net/ Hi!     I'm enjoying running CF on jboss/tomcat, with the sole exception being- JBoss wants everything under the root context (say, /cfusion) It wouldn't be a problem if all my projects were set up to not care, but sadly, some of them expect to be @ "/" vs "/cfusion/cfapp/". I could set up a context for each CF app, but I've got like >20 of them, and I don't really want to put a WEB-INF folder in each. Or add 20 tomcat virtual hosts to match my apache virtual hosts. I've got apache set up to use mod_proxy_ajp, and my projects are all hosted at 127.0.0.1, with different host names, using apache NamedVirtualHosts. (http://proj1/, http://proj2/, etc.) Any suggestions on how to use a single CF instance to serve multiple websites when running on top of tomcat/jboss? I like separate instances for production, but I've only got soooo much RAM locally.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dinner
03/13/2007 01:43 AM

First off, Steve, thank you for the jboss + cf blog entries! Had me up and running in minutes. Second off, I am probably staring at the forest and wondering where the trees are (I've already done that once with your jboss entries;), but I don't see how this would allow me a set up like so: /srv/www/htdocs/funzone  == http://funzone.localhost/ /srv/www/htdocs/interflow  == http://interflow.localhost/ where the .cfm files in those directories are both served by a single CF instance, and code running in both funzone and interflow think they're housed at "/". Basically, I want to achieve the same thing the JRun connector does.  Seems as if the page gets processed in the context of the apache virtual host, so to speak.     Whereas Apache2.2 with the mod_proxy_ajp module seems to proxy (well, it's in the name) the requests, so funzone.localhost/cool.cfm has to be at the "/" of the war (tomcat context), or interflow.localhost/cool.cfm has to be at "/" of the context, but both can't be at "/" of the context. My new projects can happily play at /funzone/ or what have you, but it's a problem for my older ones, or 3rd party type deals. If I'm missing how I can modify the web.xml to have both funzone.localhost/cool.cfm and interflow.localhost/cool.cfm live at "/" but be different files, I'm not seeing it. Again, wouldn't be the first or last time, so I'm sorry if it's staring me in the face (or if I've explained things "funkily" =). And double again, thanks Steve for the best CF + JBoss resource on the web.  Shweeet! ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Steve Brownlee
03/13/2007 12:00 PM

Ok, let's start with some basics. 1. You can't have more than one application set as the Tomcat context root application. 2. If you want to have more than one web site running, you have to set up JBoss virtual hosts.    http://www.fusioncube.net/index.php/hosting-multiple-domains-with-jboss. html 3. If you're running Apache as the proxy to Jboss, go to this article and read the Apache Configuration section.    http://www.fusioncube.net/index.php/apache-proxy-to-jboss-and-iis.html Steve Brownlee http://www.fusioncube.net/    First off, Steve, thank you for the jboss + cf blog entries! Had me up and running in minutes. Second off, I am probably staring at the forest and wondering where the trees are (I've already done that once with your jboss entries;), but I don't see how this would allow me a set up like so: /srv/www/htdocs/funzone  == http://funzone.localhost/ /srv/www/htdocs/interflow  == http://interflow.localhost/ where the .cfm files in those directories are both served by a single CF instance, and code running in both funzone and interflow think they're housed at "/". Basically, I want to achieve the same thing the JRun connector does. Seems as if the page gets processed in the context of the apache virtual host, so to speak.     Whereas Apache2.2 with the mod_proxy_ajp module seems to proxy (well, it's in the name) the requests, so funzone.localhost/cool.cfm has to be at the "/" of the war (tomcat context), or interflow.localhost/cool.cfm has to be at "/" of the context, but both can't be at "/" of the context. My new projects can happily play at /funzone/ or what have you, but it's a problem for my older ones, or 3rd party type deals. If I'm missing how I can modify the web.xml to have both funzone.localhost/cool.cfm and interflow.localhost/cool.cfm live at "/" but be different files, I'm not seeing it. Again, wouldn't be the first or last time, so I'm sorry if it's staring me in the face (or if I've explained things "funkily" =). And double again, thanks Steve for the best CF + JBoss resource on the web.   Shweeet!

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dinner
03/13/2007 07:27 PM

> Ok, let's start with some basics. > > 1. You can't have more than one application set as the Tomcat context > root application. Indeed.  What I'm trying to achieve, is the way JRun manages to serve many CF applications from the (default) one CF context.  Somehow it's possible, cuz JRun is doing it.  :-/ Image this setup: Two website's disk path:  "/srv/www/htdocs/funzone" for the first one and "/srv/www/htdocs/interflow" for the second one What I'm seeing is, with JRun, if I go to http://funzone/cool.cfm, the file can live at "htdocs/funzone/cool.cfm", and be served fine. A different file can be at "htdocs/interflow/cool.cfm", and when one goes to http://interflow/cool.cfm, it is served fine (using only the jrun connector and two apache virtual hosts).  One instance of CF is running both "cool.cfm" files from "/"!  And it can keep them apart. Now with JBoss: JBoss CF disk path:  "deploy/cfusion.war/" If I want to serve content from http://funzone, that content has to "live" under "deploy/cfusion.war/".  So I can't have both funzone AND interflow in "deploy/cfusion.war/".  At least not at the root, obviously.  I could do "cfusion.war/funzone/" and "cfusion.war/interflow/", but the problem is, both expect to be at "/", vs. "/funzone" or "/interflow". > 2. If you want to have more than one web site running, you have to set > up JBoss virtual hosts. > > http://www.fusioncube.net/index.php/hosting-multiple-domains-with-jboss. > html Thanks to your blog entry, I didn't have any troubles with setting up hosting, but unfortunately, that route needs a context for each host, so I'm back at the beginning as far as "sharing" a context (the way CF works if you're using JRun). But for production, the tomcat virtual host stuff will work fine, as many of these apps will have a CF instance all to themselves, so mapping a root context to "/" will work fine. It's only for me, the lone dev, who has to have copies of all these apps locally, where there's a problem.  In "real life" they've got their own servers, instances, etc.., but in my world, they all gotta share about a gig of memory.  And I jump from one to the next, cat-like, so I was trying to avoid having to fire up each one separately, or what have you. > 3. If you're running Apache as the proxy to Jboss, go to this article > and read the Apache Configuration section. > > http://www.fusioncube.net/index.php/apache-proxy-to-jboss-and-iis.html Dude, you've got THE resource for CF + JBoss/Tomcat!  I'm actually running apache2.2 (which everyone should, if they can, according to apache), and it has a module just for AJP (tomcat/jboss) now, called mod_proxy_ajp. I was actually going to blog about it a bit, but I broke my blog, or else I'd've pointed this convo over there.  :-/  It's really easy to set up tho, and have it just serve .cfm pages (versus the full proxy, where images and whatnot are being served via Tomcat/JBoss, instead of by apache, which we really want serving everything that's static).     I've got mine set up to use a rewrite rule, but only if it's a .cfm or .cfc file-- which you could actually use with the older, plain old proxy stuff too. Now that's a cool module, rewrite!  Feel the POWER! W00t! Hey Steve, thanks alot for taking the time, and especially for putting what you went thru to get CF running on JBoss/Tomcat out there. Seriously, your blog came up with almost every google search! And Dave, thanks for the bump/guess- you da man, as per yer MO. =]

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Steve Brownlee
03/14/2007 02:11 PM

> Indeed.  What I'm trying to achieve, is the way JRun manages > to serve many CF applications from the (default) one CF > context.  Somehow it's possible, cuz JRun is doing it.  :-/ Yes it's possible and my first response shows you how to do it    http://www.fusioncube.net/index.php/coldfusion-from-anywhere.html This is also covered in the following article    http://www.fusioncube.net/index.php/coldfusion-on-jboss-standalone-prime r.html > If I want to serve content from http://funzone, that content > has to "live" under "deploy/cfusion.war/".  So I can't have > both funzone AND interflow in "deploy/cfusion.war/".  At > least not at the root, obviously.  I could do > "cfusion.war/funzone/" and "cfusion.war/interflow/", but the > problem is, both expect to be at "/", vs. "/funzone" or "/interflow". If you want to do what you're explaining in JBoss then you'll have to abandon that architecture of having everything beneath cfusion.war. If you want to follow the directions in my article you will end up with two WARs   - funzone.war   - interflow.war Then you look in the \deploy\jbossweb-tomcat50.sar\server.xml file and add Host and Alias entries for each application.  For example: <Host name="funzone" autoDeploy="false" deployOnStartup="false" deployXML="false">   <Alias>funzone</Alias>   <DefaultContext cookies="true" crossContext="true" override="true"/> </Host> <Host name="interflow" autoDeploy="false" deployOnStartup="false" deployXML="false">   <Alias>interflow</Alias>   <DefaultContext cookies="true" crossContext="true" override="true"/> </Host> Then in the \deploy\funzone.war\WEB-INF\jboss-web.xml file, you would have the following: <jboss-web>   <context-root>/</context-root>   <virtual-host>funzone</virtual-host> </jboss-web> Hope that helps more. Steve Brownlee http://www.fusioncube.net/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Steve Brownlee
03/14/2007 02:21 PM

I just thought of something.  Perhaps adding in the Alias and Host entries is all you need to do.  To be honest, I've never run Jboss apps all under cfusion.war like you have it, so I shouldn't say for certain that you'll need to abandon it.  I've just never done it that way. Try adding the Host and Alias entries, as well as the changes to the jboss-web.xml files, and see if that does it for you. Steve Brownlee http://www.fusioncube.net/ ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dinner
03/15/2007 08:22 PM

> I just thought of something.  Perhaps adding in the Alias and Host > entries is all you need to do.  To be honest, I've never run Jboss apps > all under cfusion.war like you have it, so I shouldn't say for certain > that you'll need to abandon it.  I've just never done it that way. I don't understand how Apache and Tomcat communicate well enough to know for sure if it's possible or not-- perhaps with a different connector, things are handled differently.  So far, all I've seen are proxy deals, unlike the good old Apache "AddHandler jrun-handler .cfm .cfc .jsp" deal. Thus, you gotta have stuff off the root(/), if you want to have more than one project/app per CF context.  They can't share "/" (as far as I know, at this point ;) like they can with the JRun connector .  Maybe a special servlet would do it... :-/ To be clear, before I posted the first question, I had set up a couple of sites using your blog entries (Which were clean and easy-- what I've been asking about just sounds similar, as I'm poor at express'n what I'm after at times =]). I have hosts, multiple instances, etc.. I'm sorta oblivious, so I kept thinking I was missing something, but I'm really talking about some info that I haven't found on your blog, or anywhere, actually.  It's probably staring me in the face tho. bah! Try adding the Host and Alias entries, as well as the changes to the > jboss-web.xml files, and see if that does it for you. Thanks Steve, that's what I did for a couple of sites, and they're the only ones so far that need to run with JBoss anyways, so I'm just gonna use JRun for the rest. I've actually ended up doing a few instances of jboss (starting it with: run -c laszlo -b laszlo.localhost ) by following the instructions on teh wiki ( http://tinyurl.com/p8tl7 ), which is slick, no port mucking abouting, and for my purposes, prolly better anyways. (starts fast!). I'm really liking JasperServer, and OpenLaszlo, and Funambol-  all are easier to set up, and keep set up, with tomcat/jboss, than with JRun.  So!  For the couple of projects that I'll be running on JBoss, I'll just do instances/contexts for, and not run 'em at the same time if I can help it. And, dude, a freaking memory monitor, just whipped up?   http://tinyurl.com/2t6ndf Another reason I was dorking with cfusion on jboss. =] Great stuff main! Thanks again for the info, here and abroad. ;-)

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
03/11/2007 11:38 PM

> JBoss wants everything under the root context (say, /cfusion) I don't use JBoss for CF, but can't you just define the context root as "/" when you build your CF WAR/EAR? That's how CF works with JRun by default. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dinner
03/12/2007 05:42 AM

> > JBoss wants everything under the root context (say, /cfusion) > > I don't use JBoss for CF, but can't you just define the context root as "/" > when you build your CF WAR/EAR? That's how CF works with JRun by default. Yessir, you can set the context to "/". But there is some black magic involved in serving .cfm pages from outside the "docroot" (think jrun4/servers/cfusion.ear/cfusion.war/). Since tomcat expects all the "dynamic" stuff (.cfm) to be under the docroot, it wants it all there, vs. /srv/www/htdocs/site1/somecool.cfm. All tomcat needs is the WEB-INF folder to create a new context, so I can put one in a project, with a context of "/" for that project, but I'd have to do that for each project that expects to live at "/" (still too many :-/). I bet there is some simple way to achieve what I'm after, perhaps a custom servlet of small stature, or something?  Some configuration option I missed? It's looking like it's deploying CF for each context too, which means I'm out of RAM pretty quick, I reckon. *sigh* My kingdom for the proper google search term, or some similar sentiment. 8D


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists