Skip to content
OpenCms documentation
OpenCms documentation

WebDAV

This page explains how to access the virtual file system (VFS) via WebDAV. WebDAV is the recommended way of mounting the VFS, replacing the older CMIS and Network share access interfaces.

The OpenCms WebDAV servlet is available below the /webdav path of your OpenCms installation.

WebDAV is enabled by default, there are no special configurations needed.

In order to disable the WebDAV servlet, comment the servlet mapping in the <CATALINA_HOME>/webapps/<OPENCMS>/web.xml file of your Tomcat installation:

<!--servlet-mapping>
    <servlet-name>DavServlet</servlet-name>
    <url-pattern>/webdav/*</url-pattern>
</servlet-mapping-->

The WebDAV servlet needs authentication to access and modify files and folders in the OpenCms VFS.  The OpenCms user needs at least the Workplace Role to access files and folders via WebDAV.

The OpenCms WebDAV servlet is compatible with any WebDAV client.

As an example, we describe the setup with davfs2 on Ubuntu.

sudo apt-get update
sudo apt install davfs2

Set the delay_upload configuration parameter to a value of 1 or lesser, which means, davfs2 will wait at most 1 second until changes in your local file system are propagated to the OpenCms VFS.

/etc/davfs2/davfs2.conf

delay_upload 1

The default parameter value of 10 for delay_upload is set too high for content edition with WebDAV.

sudo mount -t davfs -o rw,user,uid=$USER http://localhost/webdav /mnt/opencms-vfs

You will be prompted to enter your OpenCms username and OpenCms password.

Replace http://localhost/webdav with the URL of your OpenCms installation.

/mnt/opencms-vfs is a freely choosen directory for which your Ubuntu user should have read and write permissions.

With the options -o rw,user,uid=$USER you make sure that the current Ubuntu user can read and write to the mounted WebDAV directory.