Apache-2.4

AH01630:客戶端被伺服器配置拒絕

  • May 25, 2021

我正在嘗試在我的 centos 8 上設置一個 webdav 伺服器,並且在過去的幾個小時裡被一條"client denied by server configuration: /srv/webdav/fs"消息卡住了。我已經閱讀了幾個發生此錯誤的執行緒,但沒有一個可以幫助我找出問題所在。

這是我的配置文件:

DavLockDB "/etc/httpd/var/davlock"
<VirtualHost *:443>
   ServerName example.com
   ServerAdmin example@mail
   DocumentRoot /srv/webdav
   ErrorLog /var/log/httpd/error.log
   CustomLog /var/log/httpd/access.log combined
   SSLEngine on
   SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
   SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
   Alias /fs /srv/webdav/fs
   <Directory /fs>
       AuthType "Basic"
       AuthName "Password Manager"
       AuthBasicProvider file
       AuthUserFile "/etc/httpd/conf/dav_passwords"
       Require valid-user
       DAV On
       Options Indexes
   </Directory>
</VirtualHost>

我創建了一個使用者sudo htpasswd -c /etc/httpd/conf/dav_passwords john/srv/webdav歸 apache:apache 所有。

非常感謝您的幫助。提前致謝!

編輯:

我將日誌級別更改為 trace3 並在錯誤文件中獲得了一些更詳細的日誌。我仍然看不出問題出在哪裡:

[Thu May 13 08:11:02.888221 2021] [ssl:trace3] [pid 3464:tid 140514974116160] ssl_engine_init.c(607): Using OpenSSL/system default SSL/TLS protocols
[Thu May 13 08:11:02.888225 2021] [ssl:trace3] [pid 3464:tid 140514974116160] ssl_engine_init.c(628): Creating new SSL context (protocols: default)
[Thu May 13 08:11:02.888535 2021] [ssl:trace1] [pid 3464:tid 140514974116160] ssl_engine_init.c(972): Configuring permitted SSL ciphers [ALL:!COMPLEMENTOFDEFAULT:!eNULL:!aNULL:!eNULL:!EXP]
[Thu May 13 08:11:02.888590 2021] [ssl:debug] [pid 3464:tid 140514974116160] ssl_engine_init.c(520): AH01893: Configuring TLS extension handling
[Thu May 13 08:11:02.888795 2021] [ssl:warn] [pid 3464:tid 140514974116160] AH01906: example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu May 13 08:11:02.888809 2021] [ssl:trace3] [pid 3464:tid 140514974116160] ssl_util_ssl.c(433): [example.com:443] modssl_X509_match_name: expecting name 'example.com', matched by ID 'example.com'
[Thu May 13 08:11:02.888840 2021] [ssl:debug] [pid 3464:tid 140514974116160] ssl_util_ssl.c(444): AH02412: [example.com:443] Cert matches for name 'example.com' [subject: emailAddress=example@mail,CN=example.com / issuer: emailAddress=example@mail,CN=example.com / serial: 7C1166CC353EC7F29C68B66269042224CEE41E67 / notbefore: May 12 08:52:52 2021 GMT / notafter: May 12 08:52:52 2022 GMT]
[Thu May 13 08:11:02.888846 2021] [ssl:info] [pid 3464:tid 140514974116160] AH02568: Certificate and private key example.com:443:0 configured from /etc/ssl/certs/apache-selfsigned.crt and /etc/ssl/private/apache-selfsigned.key

好的,所以我解決了這個問題。我完全重新安裝了 httpd 並再次創建了文件(具有適當的權限和所有權)。然後我沒有DavLockDB "/etc/httpd/var/davlock"在 webdav.conf 文件中指定,因此它預設為/var/lib/dav/lockdb根據預設的 Apache 配置。(我不知道為什麼會有所不同…)最後我需要chcon -R -t httpd_sys_content_rw_t /path/to/dir. 現在它起作用了。再次感謝安德魯您的幫助!

問題在這裡:

Alias /fs /srv/webdav/fs
<Directory /fs>
...
</Directory>

裡面的指令<Directory /fs>不適用,因為目錄不是/fs,它是/srv/webdav/fs. 試試<Directory /srv/webdav/fs>

引用自:https://serverfault.com/questions/1063308