首页 > 解决方案 > Apache webdav 登录适用于浏览器,但 net use 命令/窗口资源管理器出错

问题描述

我想在我的服务器上设置一个简单的 WebDAV 服务,该服务在 Linux (Amazon EC2) 上运行并为用户提供保存文件和文件夹的功能。

在配置了一些文件之后,我设法让服务运行在下面的配置中:

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/webdav/
        ServerName webdav.example.com
        ErrorLog /var/log/httpd/error.log
        CustomLog /var/log/httpd/access.log combined

        Alias /user1 /var/www/html/users/user1
        <Directory /var/www/html/users/user1>
            DirectoryIndex disabled
            Options Indexes MultiViews
            AllowOverride None
            DAV On
            AuthType Digest
            AuthName "user1"
            AuthUserFile /etc/httpd/.htpasswd
            Require valid-user

            # Force not to render PHP files and make all files to plain text 
            RemoveHandler .php
            ForceType text/plain
            php_flag engine off
        </Directory>

        # Lets Encrypt's SSL stuff
        SSLCertificateFile /etc/letsencrypt/live/webdav.example.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/webdav.example.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
    </VirtualHost>
</IfModule>

重新启动 httpd 服务后,当我在 Google Chrome 或 Firefox 中导航到时https://webdav.example.com/user1,我可以登录(带有提示)对话框,询问用户名/密码。输入正确的用户名/密码后,我可以按预期获得文件列表。

但是,当我想在 Windows 资源管理器中或通过命令设置网络驱动器时net use u: https://webdav.example.com/user1,我不断收到错误消息:

System error 67 has occurred. 

The network name cannot be found.

我已经在多台 Windows 机器上进行了测试(都是最新的 Windows 10 1803)并且它们都有相同的错误。

任何帮助将不胜感激。

标签: windowsapacheamazon-ec2webdav

解决方案


推荐阅读