Posted in ColdFusion | Posted on 05-24-2006 | 4,073 views
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:
2
3<!--- custom --->
4<cfset instance = structNew()>
5<cfset instance.dsn = "Blog">
6<cfset instance.owneremail="blog@hellometro.com">
7<cfset instance.blogurl = "http://#cgi.server_name#/blog/index.cfm">
8<cfset instance.blogtitle = "#blogName# Blog">
9<cfset instance.blogdescription = "#blogname# Blog">
10<cfset instance.blogDBType="MSSQL">
11<cfset instance.locale="en_US">
12<cfset instance.users = "">
13<cfset instance.commentsFrom = "">
14<cfset instance.mailServer = "">
15<cfset instance.mailUsername = "">
16<cfset instance.mailPassword = "">
17<cfset instance.pingurls = "">
18<cfset instance.offset = "0">
19<cfset instance.allowtrackbacks = false>
20<cfset instance.trackbackspamlist="phentermine,MORE STUFF DELETED">
21<cfset instance.blogkeywords = "">
22<cfset instance.ipblocklist = "67.180.242.3">
23<cfset instance.maxentries = "10">
24<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:
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).


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.
anyway, congrats on the big install!!!
tw
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.com/Blog
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
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?
Much to learn I still have...
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?
Imageroot is not a valid property
Any help on why im getting this error would be appreciated
Matt
[Add Comment] [Subscribe to Comments]