CentOS 7
Sponsored Link

Apache httpd : Use WebDAV
2014/09/08
 
This is the example to configure WebDAV settings with SSL connection.
[1]
[2] For example, Make a directory [webdav] and it makes possible to connect to WebDAV directory only by SSL.
[root@www ~]#
mkdir /home/webdav

[root@www ~]#
chown apache. /home/webdav

[root@www ~]#
chmod 770 /home/webdav

[root@www ~]#
vi /etc/httpd/conf.d/webdav.conf
# create new

DavLockDB "/tmp/DavLock"
Alias /webdav /home/webdav
<Location /webdav>
    DAV On
    SSLRequireSSL
    Options None
    AuthType Basic
    AuthName WebDAV
    AuthUserFile /etc/httpd/conf/.htpasswd
    <RequireAny>
        Require method GET POST OPTIONS
        Require valid-user
    </RequireAny>
</Location>

# add a user : create a new file with "-c" ( add the "-c" option only for the initial registration )

[root@www ~]#
htpasswd -c /etc/httpd/conf/.htpasswd cent

New password:    
# set password

Re-type new password:
Adding password for user cent
[root@www ~]#
systemctl restart httpd

[3] If SELinux is enabled, change rules like follows.
[root@www ~]#
chcon -R -t httpd_sys_rw_content_t /home/webdav

[root@www ~]#
semanage fcontext -a -t httpd_sys_rw_content_t /home/webdav

[4]
Configure WebDAV client on client computer. This example is for the case on Windows 10.
Open [PC] and move to [Computer] tab and Click [Add a network location] icon.
[5] Click [Next] button.
[6] Click [Next] button.
[7] Input the URL of WebDav folder.
[8] Authentication is required, input username and password you added in section [1] by htpasswd.
[9] Input WebDav Folder Name. Any name is OK, it's used on your Windows Computer.
[10] Click [Finish] button.
[11] Just accessed to WebDav Folder.
Matched Content