简体   繁体   English

Apache停止Windows上的webdav目录列表

[英]Apache stop webdav directory listing on windows

I'm working on a server which has to serve a few files publically via WebDav. 我正在使用必须通过WebDav公共提供一些文件的服务器。 The public availability and WebDav is a must have, so I can't just change them. 公共可用性和WebDav是必须具备的功能,因此我不能仅仅更改它们。 Windows support (sadly) is another must thing... Windows支持(很遗憾)是另一件事。

It would be great if I could disable directory listing, so the person who I give the webdav link would only be able to either guess the link or use only the one I gave. 如果我可以禁用目录列表,那就太好了,所以给我提供webdav链接的人将只能猜测该链接或仅使用我给的链接。

In default case it's quite easy to disable directory listing, and in the browser the current configuration perfectly stops dir listing, but when I open it via windows explorer, I can easily see the whole directory and its content. 在默认情况下,禁用目录列表非常容易,并且在浏览器中,当前配置可以完美地停止目录列表,但是当我通过Windows资源管理器打开目录时,可以轻松地看到整个目录及其内容。 My current config is: 我当前的配置是:

<VirtualHost *>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/web1/web/
    <Directory /var/www/web1/web/>
        Options MultiViews
        AllowOverride None
        Order allow,deny
        allow from all

        <LimitExcept GET PROPFIND>
                        Require valid-user
                </LimitExcept>
    </Directory>

    Alias /v1 /var/www/web1/web

    <Location /v1>
        DAV On
        AuthName "webdav"
    </Location>
</VirtualHost>

If I wont allow PROPFIND method, windows thinks that the host is unavailable (unsure if linux can access it, that's not my target). 如果我不允许使用PROPFIND方法,Windows会认为该主机不可用(不确定linux是否可以访问它,这不是我的目标)。

Is it possible to stop directory listing on windows? 是否可以停止Windows上的目录列表? For me it seems the PROPFIND is what causes this, but I'm unsure if I can somehow bypass this problem. 对我来说,似乎PROPFIND是导致此问题的原因,但是我不确定是否可以以某种方式绕过此问题。 Do you have any idea how should I modify my config file? 您知道如何修改配置文件吗?

I know this question is old, but in your VirtualHost file (the file in /etc/apache2/sites-available/[yoursite].conf), you need to add something. 我知道这个问题很旧,但是在您的VirtualHost文件(/etc/apache2/sites-available/[yoursite].conf中的文件)中,您需要添加一些内容。 This is in your directory tag. 这是在您的目录标记中。 Supply it with DirectoryIndex disabled . 为它提供DirectoryIndex disabled Like this 像这样

<Directory [yourdirectory]>
 (...)
 DirectoryIndex disabled
</Directory>

Sincerly, Chris Fowl 真诚的克里斯·福尔(Chris Fowl)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM