Apache: Assign SSL server / client certs to directories

Posted by Daniel Amaya on Server Fault See other posts from Server Fault or by Daniel Amaya
Published on 2013-11-09T04:34:55Z Indexed on 2013/11/09 9:58 UTC
Read the original article Hit count: 235

Filed under:
|
|

I have multiple directories on my system, e.g.,

/var/www/dir1 /var/www/dir2 /var/www/dir3

And what I'd like to do is to generate a server/client SSL certificate for each directory, and then set up each directory such that the client cert must match the server cert in order to access said directory. Now, if someone has the client cert for /var/www/dir2 and they try to access /var/www/dir1, they will be unable to do so since those directories use different certs. Each of these directories is hosted on the same domain (i.e., domain.com/dir1, domain.com/dir2).

Now, the problem I am having is that I am not exactly sure how to accomplish this in Apache. (Also, I don't really care for domain.com to require SSL, but I do want the directories to require it.)

© Server Fault or respective owner

Related posts about apache2

Related posts about ssl