In this section we will discuss about the various management task - e.g. using LDAP for access control, and working with DAV method on Apache
Most of the configuration changes for the DAV will have to done using the httpd.conf
file. This file is located at /usr/local/apache/conf/httpd.conf
httpd.conf
is a text based configuration file that Apache uses. It can b editted using any text editor - I preffer using vi. Please make backup copy of this file, before changing it.
After making changes to the httpd.conf
the Apache server has to be restarted using the /usr/local/apache/bin/apachectl restart command.
However before restarting you test for the validity of the httpd.conf
by using the /usr/local/apache/bin/apachectl configtest comand.
In the previous section when we created the DAVtest share, we used the LDAP for authentication purposes. However anyone who can authenticates using their LDAP useri/passwd will be able to access that folder.
Using the require directive in the httpd.conf file, we can limit access to certain individuals or groups of individuals.
If we look at the DAVtest configuration from the previosu section:
<Directory /usr/local/apache/htdocs/DAVtest> Dav On #Options Indexes FollowSymLinks AllowOverride None order allow,deny allow from all AuthName "LDAP_userid_password_required" AuthType Basic <Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> Require valid-user </Limit> LDAP_Server ldap.server.com LDAP_Port 389 Base_DN "o=ROOT" UID_Attr uid </Directory>
We see that the require is set to valid-user. Which means any valid authenticated user has access to this folder.
LDAP UID can be used to restrict access to DAV folder.
require valid-user directive can be changed to require user 334455 445566
This will restrict access to individuals with UID 334455 and 445566. Anyone else will not be able to access this folder.
It maybe be required that the editting for the resources on the DAV shares be restricted to certain individual, however anyone can view the resources. This can be easily done using the <Limit> tags in the httpd.conf file
<Directory /usr/local/apache/htdocs/DAVtest> Dav On #Options Indexes FollowSymLinks AllowOverride None order allow,deny allow from all AuthName "LDAP_userid_password_required" AuthType Basic <Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> Require valid-user </Limit> LDAP_Server ldap.server.com LDAP_Port 389 Base_DN "o=ROOT" UID_Attr uid </Directory>
You restrict write access to certain individuals by changing the <limit> to
<Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> Require 334455 </Limit>
Basically we are limiting the PUT POST DELETE PROPPATH MKCOL COPY MOVE LOCK and UNLOCK to an individual who has the UID of 334455. Everyone else will be able to use the methods GET and PROPFIND on the resources, but not any other method.