Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

A simple WebDAV repository with user directories (See related posts)

The following snippet goes into the main Apache config (or a VirtualHost config). It allows you to create a simple repository access by WebDAV, with distinct logins for your users. All users must authenticate to access the /webstore directory, they can browse and see all subdirectories, but they can only upload into their own /webstore/user directory, or into any directory which may be created under /webstore, but not mentioned in the config.

You still need to have the mod_dav module installed and loaded, and to actually add all users into the dav.digest.passwd file using the htdigest command:

htdigest dav.digest.htpasswd foobar.com foo


The +Indexes option also makes it to possible to browse the repository using a regular web browser (with no upload rights, of course).

<Location /webstore>
  DAV On
  Options +Indexes
  AuthType Digest
  AuthName foobar.com
  AuthDigestFile /home/foobar/etc/dav.digest.passwd
  Require valid-user
  ForceType text/plain
Location>
/webstore/foo">
  Require valid-user
  
    Require user foo
  

"/webstore/bar">
  Require valid-user
  
    Require user bar
  


You need to create an account or log in to post comments to this site.


Related Posts