Fedora 30
Sponsored Link

Apache httpd : WebDAV Settings2019/05/12

 
Configure httpd to use WebDAV.
[1]
[2] For example, Make a directory [webdav] and it makes possible to connect to WebDAV directory only by SSL.
[root@www ‾]#
dnf -y install apr-util-bdb
[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

<IfModule mod_dav_fs.c>
    DAVLockDB /var/lib/dav/lockdb
</IfModule>
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" ("-c" is needed only for the initial regist)

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

New password:    
# set password

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

[3] If SELinux is enabled, change policy 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