httpd关于web-dav的配置

 var/davlock为ServerRoot下的子目录,并且需要chown apache.apache

ServerRoot/user/.htpasswd采用Basic鉴权方式

ServerRoot/user/password采用Digest鉴权方式

htpasswd -cm /usr/local/svn/svn-auth-file user1

htdigest -c .....   realm  user1

# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf

DavLockDB "var/davlock"

Alias /webdav /home/yhhan/webdav

<location /webdav>
    Dav On

    Order Allow,Deny
    Allow from all

    AuthType Digest
    AuthName user
    AuthUserFile /etc/httpd/user/password
    <LimitExcept OPTIONS>
        require user test
    </LimitExcept>
</location>

Alias /webdav2 /home/yhhan/webdav

<directory /home/yhhan/webdav>
    Dav On

#    Require all granted
    Order Allow,Deny
    Allow from all

    AuthType Basic
    AuthName user
    AuthUserFile /etc/httpd/user/.htpasswd
    <LimitExcept OPTIONS>
        require user test
    </LimitExcept>
</directory>
以下方法能成功上传二进制文件:
[root@han ~]# curl --user "test:123456" --request PUT http://192.168.130.57/webdav2/otp-19.3.tar.gz --data-binary @otp-19.3.tar.gz
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>201 Created</title>
</head><body>
<h1>Created</h1>
<p>Resource /webdav2/otp-19.3.tar.gz has been created.</p>
</body></html>
[root@han ~]# httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Nov 16 2020 16:18:20
[root@han ~]# httpd -V
Server version: Apache/2.4.6 (CentOS)
Server built:   Nov 16 2020 16:18:20
Server's Module Magic Number: 20120211:24
Server loaded:  APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
[root@han ~]# 

主要问题在于目录以及文件的权限。

DavLockDB "var/davlock" 必须是apache.apache

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值