简体   繁体   中英

Apache stop webdav directory listing on windows

I'm working on a server which has to serve a few files publically via WebDav. The public availability and WebDav is a must have, so I can't just change them. Windows support (sadly) is another must thing...

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.

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. 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).

Is it possible to stop directory listing on windows? For me it seems the PROPFIND is what causes this, but I'm unsure if I can somehow bypass this problem. 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. This is in your directory tag. Supply it with DirectoryIndex disabled . Like this

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

Sincerly, Chris Fowl

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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