Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
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 '12 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 '12 at 10:10
    
(Scratch that last remark, both solutions probably need some kind of htaccess-like configuration.) –  sr_ Jan 28 '12 at 14:08
add comment

1 Answer

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.

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.