1

I'm doing some research for a project I'm working on, and I'm a bit stumped as to what to do when it comes to load balancing and mpm-itk.

I currently have a web server (webA) running apache2-mpm-itk, which stores the user files in /sites/<sitename>. So, if I hit www.siteA.tld it pulls from /sites/siteA and runs as user siteA.

This works fine for a single server, but if I now put haproxy in front, and direct to webA and webB, only the requests that hit webA work. (Obviously, as I haven't synced the boxes yet.)

The question is, what's the best way to sync these machines?

  1. Use rsync to sync the /sites/* folder? (But what about user accounts??)
  2. Use NFS to store the /sites/* folder, and just sync the users somehow?
  3. Some other cool way that works much better with mpm-itk?!

I guess what I'm really after is how to keep the user accounts synced so that mpm-itk still works on either box.

Edit: It doesn't have to be mpm-itk, but any way that I can run apache as separate users, load balanced, and keep the user accounts in sync between multiple machines.

Ben Pilbrow
  • 12,041
  • 5
  • 36
  • 57
Ben
  • 13
  • 3

1 Answers1

0

You will have to ensure that the contents of the /etc/passwd and /etc/group files are the same on both machines if you are to use mpm-itk. This means same UIDs and GIDs for the files you are about to replicate. At least for the part used by the mpm. What you want can be done pretty easy, as long as you sync the above, then replicate the content of the websites base folder over the new machine (via rsync or anything else). It may involve a bit of scripting and a feeling of scratching right ear with left hand, but it will actually work.

On the other hand, if you really want to go with horizontal scaling, I would recommend one of the following two approaches:

a) DRBD to replicate a partition in something similar to a networked RAID1 - all you would need would be to sync user contents

b) try a distributed filesystem. GlusterFS is already mature enough and should not be hard to set up.

Any of the above will get you a bit close to the scaling you are trying to achieve.

O G
  • 874
  • 4
  • 6
  • Thanks, it hadn't occurred to me that it would be as simple as syncing those 2 files! – Ben Aug 14 '11 at 15:38