Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
Wojciech Rebis Posted April 30, 2010 Posted April 30, 2010 Hello, I have 12 forums which look the same (only logo and domain changes) and to improve working on them I want to switch from 12 ipb installs and 12 dbs to 1 install and 12 dbs. What I'm trying to get is one source code instead of 12 (not thinking of reducing number of licences - I still have 12 licenses ;)) What I'll try to do is: 1. Change cache and upload path so that each forum has its own. 2. Modify conf_global.php to load proper settings depending on domain. Everything else will remain the same. Do you think it would work? Maybe anyone has combined many installs in this way?
Wolfie Posted April 30, 2010 Posted April 30, 2010 This belongs in the Customer Lounge. :P I see a potential problem with your idea. As you make skin changes, those changes would be saved into the public/style_images folder, causing conflicts. Your better bet would be to have 13 separate root folders (one install and 12 'site' folder), with most of the root folders linking (symbolically) to the main install. For folders/files that would require being independent of each other, those would remain in the site location, not the install location. ex: /ipb/main/(regular install of ipb files) /ipb/sites/01/(symbolic links to /ipb/main/ along with folders/files necessary for site 01 specific operation) /ipb/sites/02/(symbolic links to /ipb/main/ along with folders/files necessary for site 02 specific operation) /ipb/sites/03/(symbolic links to /ipb/main/ along with folders/files necessary for site 03 specific operation) etc The the last thing you'd need/want would be a script for making upgrades easier. It would need to copy all the files to their proper locations. ex, would copy all the files/folders to /ipb/main/ (easier to just do that) but then copy the proper folders/files to each site). Then you would perform the upgrade on each of the sites. Obviously, you'd have to take the sites down all at the same time before starting the process. I do see benefits to doing this, such as only having to edit one file if a security patch is released, then you would only need to edit a file once and it's done, instead of editing the same file multiple times or copying that file to 11 other locations. A drawback is that if you edit a file (installing a mod) then that mod affects all installs.
Mark Posted April 30, 2010 Posted April 30, 2010 I've done this myself with the same method as what you've suggested. Works fine.
Wolfie Posted April 30, 2010 Posted April 30, 2010 Wojciech Rebis's method or what I said? Either way, could you write an article giving the basics of what you did? I think it would make for an interesting read.
Mark Posted April 30, 2010 Posted April 30, 2010 Mainly what he said. Specifically, I created two files for each install: index.php and initdata.php. index.php just needs to be exactly the same content as the default index.php. initdata.php needs to be configured to point to the location of the "master" source files. Then set some conditionals in conf_global.php (I did this by defining a variable in by initdata.php and basing which database to load off that). Finally, I configured the paths in the settings to be set correctly. I recommend letting each install have it's own uploads directory. You could probably do it differently depending on how the server is set up, that's just how I did it.
Wolfie Posted April 30, 2010 Posted April 30, 2010 So folders like hooks, cache, uploads would be in the 12 other 'folders'?
Mark Posted April 30, 2010 Posted April 30, 2010 Yeah, you set the cache path setting in the Admin CP.
Wojciech Rebis Posted April 30, 2010 Author Posted April 30, 2010 @Mark I assume you have a folder for each IPB install with 2 files in it (index.php and initdata.php), and a main folder with IPB source code. Am I right? I am going to point all domains to one folder, so I'll have only one index.php and initdata.php, modifying only conf_global.php to switch between databases. @Wolfie All installs have the same skin, so hope there will be no skin conflicts.
Wolfie Posted April 30, 2010 Posted April 30, 2010 @Wolfie All installs have the same skin, so hope there will be no skin conflicts.The logo images come to mind.
Wojciech Rebis Posted April 30, 2010 Author Posted April 30, 2010 The logo images come to mind. Think I'll upload them with different names like logo1.png, logo2.png, etc. and then set proper logo in ACP > Easy Logo Changer for each board.
Wolfie Posted May 1, 2010 Posted May 1, 2010 Think I'll upload them with different names like logo1.png, logo2.png, etc. and then set proper logo in ACP > Easy Logo Changer for each board. Okay I've tried doing this and created a new PHP file to figure out which conf_global file to load. Three different conf files (one is the default which loads the new PHP file, that in turn determines which of the two boards is being accessed and loads the corresponding conf file for that board). Tried using the custom conf file to change the hooks folder but that failed. However, since the hooks get unique names anyway, it shouldn't really matter. Via ACP, changed where each board looks for the uploads folder (doesn't really have to be in a subfolder of the board, can be anywhere) and added a path for the cache. Seems to be working. As far as logo files are concerned, I looked and they use the name you upload with, so if you upload a file named "domain.com_logo.png" then it'll put the skin number on it and use the name you used (resulting in 1_domain.com_log.png) so that's a pre-resolved issue already. Still trying to think of ways to make the multi-site script I made a bit more intelligent and less prone to possible errors. Just need to figure out a way to handle the favicons easily.. I'm thinking .htaccess to load the favicon file from another folder, where the icon file would have the name of the host/url in it.
Mat Barrie Posted May 1, 2010 Posted May 1, 2010 Just need to figure out a way to handle the favicons easily.. I'm thinking .htaccess to load the favicon file from another folder, where the icon file would have the name of the host/url in it.<link rel="icon" type="image/png" href="http://example.com/myicon.png">
Wolfie Posted May 1, 2010 Posted May 1, 2010 <link rel="icon" type="image/png" href="http://example.com/myicon.png">Trying to do it in a way that avoids skin edits so that things are kept simple.
Mark Posted May 1, 2010 Posted May 1, 2010 @Mark I assume you have a folder for each IPB install with 2 files in it (index.php and initdata.php), and a main folder with IPB source code. Am I right? I am going to point all domains to one folder, so I'll have only one index.php and initdata.php, modifying only conf_global.php to switch between databases. @Wolfie All installs have the same skin, so hope there will be no skin conflicts. Yeah, that's the way I did it, but you could easily do it in one folder.
Wolfie Posted May 1, 2010 Posted May 1, 2010 Doing it in one folder so far. Just fixed a small bug in my PHP script as it was causing one site to switch to the other when using .htaccess to get rid of the index.php from the URL. After I tinker with it a bit more, I plan to 'uninstall' it all (except my script :D) and then try it again and get it down to a few steps. If it works again, I'll type up what I did.
.Ian Posted May 1, 2010 Posted May 1, 2010 How are you going to handle the domains so that the URL remains constant?
Wolfie Posted May 1, 2010 Posted May 1, 2010 How are you going to handle the domains so that the URL remains constant? Each 'install' has it's own URL that it gets from the conf_global file.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.