550 New BlogCFC Installs

Forgive me for tooting my own horn (and there is a practical side to this entry as well), but HelloMetro.com went live with 550 new installs of BlogCFC. The installs are all virtual for their 550 city sites. More info at the press release.

So how was this done? Most people don't know (maybe because I never documented it) that BlogCFC supports dynamic configuration as well as the more normal blog.ini.cfm file. So for example, to make one install of BlogCFC work for all 550 blogs, I simply added code like so to the Application.cfm file:

<cfset blogName = getCities.cityName>

<!--- custom ---> <cfset instance = structNew()> <cfset instance.dsn = "Blog"> <cfset instance.owneremail="blog@hellometro.com"> <cfset instance.blogurl = "http://#cgi.server_name#/blog/index.cfm"> <cfset instance.blogtitle = "#blogName# Blog"> <cfset instance.blogdescription = "#blogname# Blog"> <cfset instance.blogDBType="MSSQL"> <cfset instance.locale="en_US"> <cfset instance.users = ""> <cfset instance.commentsFrom = ""> <cfset instance.mailServer = ""> <cfset instance.mailUsername = ""> <cfset instance.mailPassword = ""> <cfset instance.pingurls = ""> <cfset instance.offset = "0"> <cfset instance.allowtrackbacks = false> <cfset instance.trackbackspamlist="phentermine,MORE STUFF DELETED"> <cfset instance.blogkeywords = ""> <cfset instance.ipblocklist = "67.180.242.3"> <cfset instance.maxentries = "10"> <cfset instance.usecaptcha = false>

The value, getCities, is a query containing the current city based on the host name. I got this from cfincluding custom code, but you could replace this with any other code as well.

I then changed the component creation to this:

<cfset application.blog = createObject("component","org.camden.blog.blog").init(blogName, instance)>

Notice how I pass the instance struct to the init method. Anyway, that was it. I did do other mods to support their "Anyone can blog" functionality, and yes, I know the layout is broken in Firefox (they are working on that).

Archived Comments

Comment 1 by Neil Bailey posted on 5/24/2006 at 5:37 PM

Ray,

This is VERY interesting... how scalable do you think it could actually be? If we wanted, say 10,000 instances, do you think the app would handle it? We are actually actively looking for something that does EXACTLY this.

Comment 2 by Raymond Camden posted on 5/24/2006 at 5:40 PM

I haven't done testing at that level, but my gut is that it should be doable. I can't promise it though. I can say if you want to do some testing, I'd be willing to help out.

Comment 3 by tony weeg posted on 5/24/2006 at 6:12 PM

someone needs to work on their layout holmes, there is a major problem, at least in firefox, with the content spanning too much left to right, and the right side gutter is being forced down.

anyway, congrats on the big install!!!

tw

Comment 4 by Raymond Camden posted on 5/24/2006 at 6:30 PM

Tony, yep, they are aware of the FF issues. Hopefully it will be corrected soon since I try to avoid the Devil's Browser.

Comment 5 by tony weeg posted on 5/24/2006 at 6:39 PM

cool, jussa makin' sho'

Comment 6 by Bob posted on 5/24/2006 at 6:40 PM

I really like the "anyone can blog" feature. any chance this will make it in a future update.

Comment 7 by Raymond Camden posted on 5/24/2006 at 6:45 PM

Not too sure. It required a few changes at a low level. I don't think I'd like it to be in core.

Comment 8 by Andrea posted on 5/24/2006 at 7:06 PM

Now that is good to know - I've been fiddling around with the blog.ini.cfm and symbolic links to the same client folder, using the link name as the way to distinguish between blog instances in Application.cfm, as I did not want to touch too much of your code, or more than necessary.

Comment 9 by db posted on 5/25/2006 at 6:01 PM

i'm not sure if this is your problem or not, but...
the getCities query may not be handling which state the city is in. e.g. http://helloportland.com/Blog shows the same blog as http://helloportlandmaine.c...

Comment 10 by Raymond Camden posted on 5/25/2006 at 6:04 PM

Thanks. They reported it to me this morning. Working on it now.

Comment 11 by Michael White posted on 5/26/2006 at 6:13 PM

I love those situations when your code is live with 500 customers and only then do you find a major bug... no pressure there, right Ray?

Comment 12 by Heshan posted on 6/2/2006 at 7:47 AM

Ray, this is seems to be a really great application. Unfortunately, when I actually go to localize this on my site, this very function seems to porovoke some trouble. The ominous message "Could not find the ColdFusion Component org.camden.blog.blog" pops up and then cites line 35 of the client/application.cfm. The blog.cfc file is there but not according to CF. Any ideas?

Comment 13 by rastafari posted on 6/2/2006 at 7:56 AM

how are your webroots setup, and do you have a mapping setup.
im SURE we can get this puppy runnin quickly... there are many of us who have done this many times... with some info, we can probably diagnose the problem.

tony

Comment 14 by Raymond Camden posted on 6/2/2006 at 5:45 PM

As rstafri says, you may want to add a mapping that points to where you put the org folder. OR, simply copy the org folder so that it is under your client folder.

Comment 15 by Heshan posted on 6/2/2006 at 5:50 PM

sorry folks! I was really tired and a little cranky last night. I think I missed that sentence in the installation notes. Thanks Ray, this is amazing!

Comment 16 by Raymond Camden posted on 6/2/2006 at 5:56 PM

Glad you got it!

Comment 17 by Phillip Senn posted on 6/16/2006 at 4:52 AM

Ray!
BlogCFC uses an Application.cfm file????
I can't argue with success (500 installs), but the fact that you named it BlogCFC tells me that this was also an exercise in using components!

Come on. How tough would it be to make it use an Application.cfc instead?

Comment 18 by Raymond Camden posted on 6/16/2006 at 5:05 AM

Very simple. CFMX 6 support. BlueDragon support.

Comment 19 by Phillip Senn posted on 6/16/2006 at 5:36 AM

Hmmmm...
Much to learn I still have...

Comment 20 by Peter Boughton posted on 7/3/2006 at 9:00 PM

Presumably this is being initialised at application startup?

Is it possible to add new instances to an already running set of instances, or does it require that the blog application is restarted every time a new blog instance is added?

Comment 21 by Raymond Camden posted on 7/3/2006 at 9:58 PM

Peter, you only need to restart the blog if the current blog has had it's own instance data changed, like "Allow TB" from false to true. Basically it's the application scope that needs to reinit it's variables. If you added a new instance, and used a new application name, it wouldn't be cached, so it would load fresh.

Comment 22 by Peter Boughton posted on 7/4/2006 at 1:17 PM

Ah, thanks, I think I get it now.

Comment 23 by Matthew posted on 4/17/2007 at 8:14 PM

I am in the process of doing this and found that i get the following error:

Imageroot is not a valid property

Any help on why im getting this error would be appreciated

Matt

Comment 24 by Raymond Camden posted on 4/17/2007 at 8:37 PM

This error will occur if blog.cfc doesn't recognize the imageroot value. Ensure you have the latest from http://blogcfc.riaforge.org