2012-06-22, 12:33 AM
G'day,
I'm about to push my 5th revision of my website out the door and I was wondering if you could help me with this. What I intend to do, is to "load balance" a single MyBB install over 2 servers, so people can choose which server is closest to them. Let me visualize it for you:
Tomoyo - Main workhorse. Runs the "main" copy of MyBB, hosts the SQL database, hosts the theme files, etc.
Nagato - Secondary workhouse. Runs the same copy of MyBB that I have setup on Tomoyo and also hosts the theme resources, and talks to Tomoyo over a SQL Remote link on a non-standard port.
EDIT: You can see this at work here: hxxp://coburndomain.net . Pick Nagato as the mirror. Nagato is the one that talks to Tomoyo.
I have a rsync crontab that watches any file changes, and will sync them between the servers every 5 minutes.
Now, the thing is, I was wondering if anyone would be able to tell me how I could make it so if someone hits up nagato.domain.com, then MyBB will use the assets (theme images, etc) loaded on that server? At the moment, I can see the system is only designed for one domain install, so if you hit up the other mirror, it'll load the assets and everything off the "main" server, not the one I want it too - that means, all the requests go to tomoyo, which could be under heavy fire and make the software lag.
Simpler form could be this:
if incoming hostname detected by myBB = tomoyo, then set board URL settings (like "Board URL", "Home URL") to tomoyo.domain.com. If incoming hostname detected by myBB = nagato, then set board URLs to nagato.domain.com, etc.
It should not be too hard, maybe I have to hijack a setting or two? Any help would be appreciated!
I'm about to push my 5th revision of my website out the door and I was wondering if you could help me with this. What I intend to do, is to "load balance" a single MyBB install over 2 servers, so people can choose which server is closest to them. Let me visualize it for you:
Tomoyo - Main workhorse. Runs the "main" copy of MyBB, hosts the SQL database, hosts the theme files, etc.
Nagato - Secondary workhouse. Runs the same copy of MyBB that I have setup on Tomoyo and also hosts the theme resources, and talks to Tomoyo over a SQL Remote link on a non-standard port.
EDIT: You can see this at work here: hxxp://coburndomain.net . Pick Nagato as the mirror. Nagato is the one that talks to Tomoyo.
I have a rsync crontab that watches any file changes, and will sync them between the servers every 5 minutes.
Now, the thing is, I was wondering if anyone would be able to tell me how I could make it so if someone hits up nagato.domain.com, then MyBB will use the assets (theme images, etc) loaded on that server? At the moment, I can see the system is only designed for one domain install, so if you hit up the other mirror, it'll load the assets and everything off the "main" server, not the one I want it too - that means, all the requests go to tomoyo, which could be under heavy fire and make the software lag.
Simpler form could be this:
if incoming hostname detected by myBB = tomoyo, then set board URL settings (like "Board URL", "Home URL") to tomoyo.domain.com. If incoming hostname detected by myBB = nagato, then set board URLs to nagato.domain.com, etc.
It should not be too hard, maybe I have to hijack a setting or two? Any help would be appreciated!