krlaboratories

How to configure WebDAV on CentOS 7

Jun 19th, 2022 (edited)
552
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.39 KB | None | 0 0
  1. CentOS 7 WebDav Script
  2. --------------------------------
  3. yum install epel-release
  4. yum update -y
  5. yum install httpd
  6. sed -i ' s/^/#& /g'  /etc/httpd/conf.d/welcome.conf
  7. sed -i " s/Options Indexes FollowSymLinks/Options FollowSymLinks/"  /etc/httpd/conf/httpd.conf
  8. systemctl start httpd.service
  9. systemctl enable httpd.service
  10. httpd -M | grep dav
  11. mkdir /var/www/html/webdav
  12. chown -R apache:apache /var/www/html
  13. chmod -R 755 /var/www/html
  14. htpasswd -c /etc/httpd/.htpasswd username
  15. chown root:apache /etc/httpd/.htpasswd
  16. chmod 640 /etc/httpd/.htpasswd
  17. vi /etc/httpd/conf.d/webdav.conf
  18. ...
  19. DavLockDB /var/www/html/DavLock
  20. <VirtualHost *:80>
  21.     ServerAdmin webmaster@localhost
  22.     DocumentRoot /var/www/html/webdav/
  23.     ErrorLog /var/log/httpd/error.log
  24.     CustomLog /var/log/httpd/access.log combined
  25.     Alias /webdav /var/www/html/webdav
  26.     <Directory /var/www/html/webdav>
  27.         DAV On
  28.     AuthType Basic
  29.         AuthName "webdav"
  30.         AuthUserFile /etc/httpd/.htpasswd
  31.         Require valid-user
  32.     </Directory>
  33. </VirtualHost>
  34. ...
  35. systemctl restart httpd.service
  36.  
  37. *Access to WebDAV on Linux local machine *
  38.  
  39. sudo apt install -y davfs2
  40. sudo mount -t davfs https://localhost/webdav /mnt
  41.  
  42. or
  43.  
  44. aptitude install cadaver
  45. cadaver https://localhost/webdav
  46.  
  47. Also, can install Dolphin file mananger for work in graphic interface:
  48.  
  49. sudo apt-get install dolphin
  50. webdav://localhost/webdav/
Advertisement
Add Comment
Please, Sign In to add comment