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. It is recommended to use Linux or macOS, as Windows does not sufficiently support the WebDAV protocol.

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.

First, create a folder that will serve as the mount point. Due to read and write permissions, a folder in your own home directory is best suited for this purpose. For example:

mkdir /home/$USER/opencms-vfs

Then set the WebDAV mount in the following way:

sudo mount -t davfs -o rw,user,uid=$USER http://localhost/webdav /home/$USER/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.

/home/$USER/opencms-vfs is a freely choosen directory which must exist and 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.

On macOS, mounting with WebDAV is even simpler.

  • In the Finder of your Mac choose Go > Conntect to server
  • Enter the address of the OpenCms WebDAV servlet in the server address field, e.g. http://localhost/webdav
  • Click connect

You cannot choose a target directory in the dialog. The Finder sets the target of the WebDAV mount point to the directory /Volumes/webdav.