Steve Finkelstein wrote:
Hi all,

This is more of a conceptual question than actual syntax or the like.

I'm currently revising an application which should contain one documentroot for each user. The catch is, the application should connect to a user specific backend database based on who's logging in.

My thoughts are the following:

URL name will be something like: http://application.example.com/user (One DocumentRoot and the application's config file, config.php for argument sake, will reside here.)

Would my best bet be to use mod_env and SetEnv to grab the /(user) portion of the URL and then stick to my script specific engine to direct them to the user specific config file, based somewhere else on the filesystem? (At this point, it's not Apache's responsibility, it's at the application layer.)

Also, how about handling for URLs where a /user does not exist. Such as http://application.example.com/joebob (user joebob doesn't exist, I wish to redirect them), I'm assuming that's also best to do from an application level?
---------------- End original message. ---------------------

You could do all of this (and a lot more) through a Rails application and the dynamic routing scheme that Rails uses. While a typical Rails app is tied to a single database, there is no reason why you can't connect to multiple database instances if they all share a common structure. If you went this way, I would suggest using Apache as a proxy or load balancer only and actually serving the Rails application via Lighttpd or Mongrel.

I highly recommend looking into it. A few months ago, I was convinced the hype over this framework was just that but I have to say that after having learned it and begun using it on a non-trivial project, it is a very powerful environment with a lot of good features.

The downside is having to learn a new language but it isn't a hard one to learn.



Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to