Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
Thanks, it hadn't occurred to me that it would be as simple as syncing those 2 files! –  BennyP Aug 14 '11 at 15:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.