I am building a new site on my server that will be another Mango Blog. Mango is not setup for running multiple instances like it would be nice if it did, but very easily you can at least use the same file base. While this won't save you much on anything other than disk space for the CF Files and for the file cache if your CF server has that turned on; it certainly is nice to have one install location instead of 2 or 3.
To do this you will need to edit only 2 files:
- Application.cfm
- Change the "this.name" setter on line 7ish to something that would be URL driven. In my case I used:
this.appKey = replaceNoCase(cgi.server_name, "www.", "");
this.name = "mango_#right(hash(this.appKey),50)#_v1_4";- The around line 41 you will find a reference to config.cfm. I've replaced this with: config_#this.appKey#.cfm
- admin/setup/Setup.cfm
- Using the same method as Application.cfm I created an appKey var in the function saveConfig. Around line 268/269 will be two references to config.cfm; again replace these with: config_#this.appKey#.cfm
Now Mango Blog will be using config files based on the server name of the current site. The only secondary change I made was in the config files themselves.
- Make sure the tablePrefix values are different
- I adjusted my asset directories to be unique per site: assets/content/{new site name}/
