Apache httpd : Configure WebDAV2024/11/08 |
Configure WebDAV Folder. |
|
[1] | |
[2] | For example, Create a directory [/var/www/webdav] and it makes possible to connect to WebDAV folder only by HTTPS. |
[root@www ~]# mkdir /var/www/webdav [root@www ~]# chown apache:apache /var/www/webdav [root@www ~]# chmod 770 /var/www/webdav
[root@www ~]#
vi /etc/httpd/conf.d/webdav.conf # create new Alias /webdav /var/www/webdav <Location /webdav> DAV On SSLRequireSSL Options +Indexes 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] [root@www ~]# htpasswd -5 -c /etc/httpd/conf/.htpasswd fedora New password: # set password Re-type new password: Adding password for user fedora [root@www ~]# systemctl reload httpd |
[3] | If SELinux is enabled, add rules to allow accesses to target WebDAV directory. |
[root@www ~]# chcon -R -t httpd_sys_rw_content_t /var/www/webdav [root@www ~]# semanage fcontext -a -t httpd_sys_rw_content_t /var/www/webdav |
[4] |
Configure WebDAV client on client computer. This example is on Windows 11.
Open [PC] and Click [Add a network location] icon on the upper-menu.
|
[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. |
Sponsored Link |