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'd like to deny access if the REMOTE_USER does not match SUBDOMAIN.example.com. The site is protected by Require valid-user (as usual). Currently anybody can access all areas so long as she's logged in.

The intended behavior is this:

  • alice can access alice.example.com and nothing else
  • bob can access bob.example.com and nothing else
  • bonus points for granting all-access to admin

Sound too easy? Here's the catch: Subdomains/usernames are dynamic, so any hard-coded "alice" or "bob" strings do not count!

Is there any way I can do that with Apache?

Thanks!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

As the apps I'm trying to authorize are all Rack apps, I've ended up implementing this as a Rack middleware, released as the Portarius gem.

share|improve this answer
add comment

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.