Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm looking for a solution to restrict access to directorys. I've a bunch of clients and each of them should be allowed to view only his own directory. But he needs to have (read) access to the global directory. And this driving me nuts...

I can easily restrict each client folder seperatly but if i do that the client will have no longer access to the global dir.

The global dir contains following: http://larsjung.de/h5ai/

This is how my directory structure looks like:

    www (DocumentRoot)
        - global
        - client #1
            - folder 1
            - folder 2
            - folder 3
        - client #2
            - folder 1
            - folder 2
            - folder 3
        - client #3
            - folder 1
            - folder 2

Outside of my document root i've a folder which contains my .htpasswd and my .htgroups.

Any suggsetions?

share|improve this question

1 Answer 1

Look at the Apache documentation at http://httpd.apache.org/docs/2.2/howto/auth.html

Basically, you would be using "Require user" or "Require group" for each Location or Directory, depending on how you've set up the users for each client. For the Global directory, you could just require an authenticated user.

share|improve this answer
Do you have an hint how to require an (any) authenticated user? Could find nothing in the documentation... –  gearsdigital Apr 5 '12 at 13:42
@gearsdigital "Require valid-user". Look at wiki.apache.org/httpd/PasswordBasicAuth –  cjc Apr 5 '12 at 14:25

Your Answer


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.