找回密碼
 註冊
搜索
查看: 1693|回復: 0

[CentOS] CentOS 7 架設 WebDAV注意事項

[複製鏈接]
發表於 2021-4-8 22:26:12 | 顯示全部樓層 |閱讀模式
 
Push to Facebook
架設過程主要參照這篇文章:
How to Set up WebDAV with Apache on CentOS 7

由於我只是在區網下架設,所以不進行認證,因此conf檔改成以下形式:


  1. DavLockDB /var/www/html/DavLock
  2. <VirtualHost *:80>
  3.         ServerAdmin webmaster@localhost
  4.         DocumentRoot /var/www/html/webdav/
  5.     ErrorLog /var/log/httpd/error.log
  6.     CustomLog /var/log/httpd/access.log combined
  7.         Alias /webdav /var/www/html/webdav
  8.         <Directory /var/www/html/webdav>
  9.             DAV On
  10.             Order allow,deny
  11.             Allow from all
  12.             AuthType None
  13.             Require all granted
  14.             Satisfy Any
  15.         </Directory>
  16. </VirtualHost>
複製代碼

但這樣Client端會無法寫入檔案,此時在 /var/log/httpd/error.log 下會出現以下錯誤訊息:

[Sun Jan 13 20:32:34.870769 2019] [dav:error] [pid 22893] [client 192.168.2.26:63409] The locks could not be queried for verification against a possible "If:" header.  [500, #0]
[Sun Jan 13 20:32:34.870975 2019] [dav:error] [pid 22893] [client 192.168.2.26:63409] Could not open the lock database.  [500, #400]
[Sun Jan 13 20:32:34.871053 2019] [dav:error] [pid 22893] (13)Permission denied: [client 192.168.2.26:63409] Could not open property database.  [500, #1]

這是由於apache沒有寫入 /var/www/html/DavLock的權限,將DB的路徑改到其他有存取權限的地方,或是修改 /var/www/html/ 目錄的owner即可正常使用。
 
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|小黑屋|TShopping

GMT+8, 2025-5-10 13:18 , Processed in 0.025133 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回復 返回頂部 返回列表