views:

202

answers:

1

Hello all,

I am about to be writing a Ruby on Rails app which will use sub-domains to authenticate users. We will have two types of accounts:

  • user accounts
  • domain accounts

Users will thus be able to belong to multiple domain accounts using the same credentials. I hope to have the ability for a domain account administrator to be able to search for particular users and add them to their domain.

In addition to simply creating a domain account in the database, I want to setup an actual account on the machine (linux-based) so that users can drop files into a special directory and we can run some scripts to import that new data. Alternatively, I may write a client/server script to make this process easier.

All of this I believe I can do, however, as soon as the project attains a certain number of domain accounts, it will be necessary to figure out how to cluster the domain accounts appropriately so that we can have multiple machines.

From a database standpoint, this is fairly easy and there are lots of tutorials on how to cluster MySQL or whichever SQL server I decide to use. So my question really pertains more to machine accounts as well as how to cluster a Rails app.

If you want a comparison, think of this project like GitHub or Beanstalk but with data that isn't source control related.

Does anybody have any experience with this or know of any really good articles/books to get me started?

Thanks very much!

A: 

I suggest you look at using one of the PAM modules that lets you do account authentication against a SQL database. That way you just add the domain account to the SQL database and you get UNIX accounts (on all your servers) automagically, for free. So the clustering should just happen for free too...

caf
Thanks caf, I'll look into it. Would PAM actually give them a home directory? They need to be able to upload files via SCP or SFTP so that we can run scripts against them. In addition, many of the clients will want to be able to hop on the server and run mysql...
Topher Fangio
For that you could add module pam\_mkhomedir to your PAM config ("The pam\_mkhomedir PAM module will create a users home directory if it does not exist when the session begins."). That, or you can use a shared filesystem like NFS to hold the home directories.
caf