2

Suppose I have two local websites under /var/www/mysite1 and /var/www/mysite2 via apache I can access them via localhost/mysite1 and localhost/mysite2.

The pages are for local use only and I have multiple users on my machine, say user, user1 and user2. Is it possible, that user can view both sites, but user1 only mysite1 and user2 only mysite2?

3
  • 2
    I doubt it, I'm pretty sure the server doesn't get sent the username. You could do it with http passwords.
    – Kevin
    Jan 27, 2012 at 16:25
  • You could also achieve this with a Single Sign-On solution, I think; with a lot more effort compared to @Kevin's htaccess hint.
    – sr_
    Jan 28, 2012 at 10:10
  • (Scratch that last remark, both solutions probably need some kind of htaccess-like configuration.)
    – sr_
    Jan 28, 2012 at 14:08

1 Answer 1

3

In the old days, you could use mod_access_identd. It added an Ident directive allowing authentication and authorization through the Ident protocol. The Apache server interrogates an Ident server running on the client machine, which can provide reliable information as long as you trust root on the client machine and the communication between the client and the server.

Nowadays, on the Internet, both assumptions are almost always false: communications can't be trusted without cryptography, and being root on the remote machine is not significant. In your case, Ident would work. I don't see any signs that the module has been ported to Apache 2; I don't know how hard it would be to port it. You would have to run an identd server; most Linux distributions ship a couple but don't install them by default.

There's still an official mod_ident, but it only provides logging, not authorization.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .