Setting Up WebDAV

When using the "library of files" feature, administrators need a way to get the library files into the library directory. This can be done using scp, sftp or psftp. However, it is easier if the web server Apache is configured to provide WebDAV access to the directory. Once setup, a Windows user can use Windows Explorer to map a network drive to http://zendto.example.com/library or a Mac user can use Finder to connect to a server at the same address.

Note: The rest of this page is a bit out of date, as the installer now sets up this for you, but leaves it commented out of the website configuration files. The "configure web server and PHP" stage will have said where these 2 files are (usually either /etc/httpd/conf.d/ or /etc/apache2/sites-enabled/), so look in there and you will find some of the steps below have already been done for you.

Creating the WebDAV Location

Firstly you must enable the required Apache modules (they are already enabled on CentOS/RedHat/Fedora). So, on Ubuntu or Debian, as root:

a2enmod dav_fs
a2enmod dav

Next you must add the WebDAV location to your Apache host configuration. So as root:

  • In CentOS / RedHat / Fedora, you need to edit /etc/httpd/conf/httpd.conf and add the text below at the end of the file. If you are using https for your ZendTo server you need to edit /etc/httpd/conf.d/ssl.conf and add the text below just before the </VirtualHost> at the end of the file.
  • In Ubuntu / Debian, you need to edit /etc/apache2/sites-enabled/000-zendto, or 001-zendto-ssl if you are using https for your ZendTo server. In both cases add the text below just before the </VirtualHost> at the end of the file.

At the location given above, add the following

  Alias /library /var/zendto/library
  <Location /library>
    DAV on
    AuthUserFile /var/zendto/library.passwd
    AuthName "ZendTo Library"
    AuthType Basic
    Require valid-user
  </Location>

If you want a per-user library (any user that has their own library will select files in the web interface from their own library instead of any global one), you can do it like this instead:

  Alias /library /var/zendto/library
  RewriteEngine On
  BrowserMatch "^WebDAVLib/1.*" redirect-carefully
  RewriteCond %{LA-U:REMOTE_USER} (.+)
  RewriteRule ^/library(.*) /var/zendto/library/%1$1
  <Location /library>
    DAV on
    AuthUserFile /var/zendto/library.passwd
    AuthName "ZendTo Library"
    AuthType Basic
    Require valid-user
  </Location>

Adding the User and Password

It is relatively complicated to use the main ZendTo user authentication, unless you are using MySQL and the Local authenticator. So for simplicity, in this example we will set up 2 users "alice" and "bob" with their own passwords, separate from any other passwords on your systems.

So to add the usernames and passwords for our 2 users "alice" and "bob", run these commands as root:

htpasswd -c -m /var/zendto/library.passwd alice
htpasswd -m /var/zendto/library.passwd bob

In each case it will prompt you to enter the password for that user.
Note: the first command has an extra "-c" option. This forces it to create the library.passwd file. If that was present in the 2nd command, the "alice" user would be deleted. If it was not present in the 1st command, an error would be produced since the file did not exist.

Restart Apache

To make Apache use all this new configuration, we need to restart it using these commands as root:

  • On CentOS / RedHat / Fedora: service httpd restart
  • On Ubuntu / Debian: sudo apachectl restart

Test It

Now test that your ZendTo server is still working. If you have problems, start by looking in /var/log/httpd/error_log or /var/log/apache2/error_log.

If that is working fine, then try mapping a network drive from a Windows desktop to the location http://zendto.example.com/library where zendto.example.com is the full name of your ZendTo server. When prompted, give it either of the "alice" or "bob" usernames and the appropriate password. You should be able to drag files into or out of this window.

Setting File Descriptions

There is no separate way of setting the description used for each library file in ZendTo. Instead, you can edit the description when you use any library file. ZendTo will remember what you set as the description when you use a file when creating a new drop-off.