Remote Access via WebDAV

Remote File Access via WebDAV

WebDAV extends HTTP with remote file-authoring capabilities. It allows users to create, change, copy, move, and organise application files and directories through an HTTP or HTTPS connection.

WebDAV supports features such as locking, namespace management, metadata properties, version management, advanced collections, access control, HTTP Digest Authentication, and XML-based request and response data. Because it is built on HTTP, it can also use established authentication, proxying, caching, SSL, and encryption infrastructure.

Remote File Management Create, edit, copy, move, and organise files without opening the platform file manager.
HTTP and HTTPS Access Connect from a compatible desktop client anywhere a network connection is available.

Create the Environment

1Open the environment wizard

Sign in to the platform dashboard and click Create environment.

Create environment button
Start creating the Java environment from the dashboard.

2Select the Java application server

In the Environment Topology dialog, choose the required application server. The source example uses Tomcat 7 and the environment name webdavtest.

Create Tomcat environment for WebDAV
Select Tomcat, configure its resources, and enter the environment name.

Wait until the environment is created and the Tomcat node reaches the running state.

WebDAV environment created
The Tomcat environment is ready for application deployment.

Upload the Java Package

1Upload the WAR archive

Open Deployment Manager and upload the required Java WAR package.

Upload Java WAR package
Select the local WAR archive and upload it.

2Deploy the application

Deploy the uploaded package to the WebDAV environment and select the required application context.

Deploy the Java package
Choose the deployment context and click Deploy.

Open the application in a browser to confirm that the deployment is working correctly.

Open the deployed application in browser
Verify the deployed application before enabling WebDAV.

Configure Tomcat

Tomcat includes a WebDAV Level 2 servlet in its standard distribution. Enable this servlet in the server configuration.

1Open Tomcat configuration

Click Config for the Tomcat node.

Tomcat Config button
Open the Tomcat Configuration Manager.

2Enable the WebDAV servlet

Open the server-level web.xml file and add the servlet and mapping configuration below:

<servlet>
    <servlet-name>webdav</servlet-name>
    <servlet-class>org.apache.catalina.servlets.WebdavServlet</servlet-class>
    <init-param>
        <param-name>debug</param-name>
        <param-value>0</param-value>
    </init-param>
    <init-param>
        <param-name>listings</param-name>
        <param-value>true</param-value>
    </init-param>
    <!-- The following for read-write access -->
    <init-param>
        <param-name>readonly</param-name>
        <param-value>false</param-value>
    </init-param>
</servlet>

<servlet-mapping>
    <servlet-name>webdav</servlet-name>
    <url-pattern>/webdav/*</url-pattern>
</servlet-mapping>
Tomcat WebDAV servlet configuration
Add the WebDAV servlet and URL mapping to web.xml.
Read-write access: The readonly value is set to false, allowing an authorised client to modify files. Use read-only access when editing is not required.

Create an Authorised User

Limit WebDAV access to authorised users by defining a Tomcat user and role.

3Edit tomcat-users.xml

Open tomcat-users.xml and add a user with the required credentials and role. The source example uses:

<tomcat-users>
    <user name="test" password="tomcat" roles="role1" />
</tomcat-users>
Create a Tomcat WebDAV user
Create the WebDAV user and assign the security role.
Security: Replace the example username and password with strong, unique credentials before using the configuration outside a test environment.

Apply the Security Role

Define the same role in the auth-constraint section of web.xml:

<auth-constraint>
    <role-name>role1</role-name>
</auth-constraint>
WebDAV auth constraint
Link the WebDAV security constraint to the authorised Tomcat role.

4Restart Tomcat

Save the updated configuration files and restart the Tomcat node.

Restart Tomcat after WebDAV configuration
Restart Tomcat to activate the WebDAV servlet and security settings.

Connect with a WebDAV Client

Create a new connection using any compatible desktop WebDAV client. The source example uses BitKinex.

Create a WebDAV connection in BitKinex
Create a new HTTP/WebDAV connection.

Use the following connection format:

http://{your_env_name}.{hoster_domain}/{context}/webdav
  • {your_env_name} — environment name.
  • {hoster_domain} — hosting platform domain.
  • {context} — deployed application context.
  • Enter the Tomcat WebDAV username and password created earlier.
WebDAV server URL and credentials
Enter the WebDAV URL and authorised Tomcat credentials.

After the connection succeeds, the application files are displayed in the desktop client and can be viewed, edited, updated, or supplemented with new files according to the configured access permissions.

Application files accessed through WebDAV
The WebDAV client displays the remotely accessible application files.
For encrypted remote access, use HTTPS and ensure that SSL is properly configured for the environment domain.

What’s next?