How to hide files in Apache 2.2 WebDAV Directory listings

Posted on

How to hide files in Apache 2.2 WebDAV Directory listings – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about apache-2.2, webdav, , , .

I use Apache 2.2 as WebDAV file server to a bunch of Mac and MS Windows clients. Unfortunately both clutter the filesystem with files like .DS_Store or thumbs.db.

Since hte files distract my users i want to hide them from directory listings. Unfortunately the standard way of hiding files in Apache (via IndexIgnore) seems not to work via WebDAV.

Is there any other way to hide files?

Solution :

Add this to your apache config file below the DocumentRoot directive.

<FilesMatch '^.[Dd][Ss]_[Ss]'>
Order allow,deny
Deny from all
</FilesMatch>

<FilesMatch '.[Dd][Bb]'>
Order allow,deny
Deny from all
</FilesMatch>

Apache can style the very simplistic display of SVN repositories with svnindex.xsl/svnindex.css (http://code.google.com/p/tortoisesvn/source/browse/trunk/contrib/svnindex/ is as good a source as any). Dump those in the web accessable root directory, and you will at least get pretty output.

XSLT isn’t exactly an easy language, but I’m sure you can skip patterns, and just not print out what you don’t want. Alternatively, I suppose you can just add javascript, which rewrites the page content after the XSLT is finished.

Leave a Reply

Your email address will not be published.