Remote Access to Your Files via WebDAV

| January 28, 2013

While setting up a website you can face the need to build some complicated method of viewing and updating the information on the site. There are lots of solutions, which use local copies of your files and a combination of HTTP and FTP tools to download the original files and upload the changes etc. But also as an easy solution you can use Web-based Distributed Authoring and Versioning (WebDAV) which is available in Jelastic. It is a set of extensions to HTTP that allows clients to perform remove web authoring operations. Some of these extensions overwrite protection by locking, name-space management and properties (metadata) are fully implemented. Other offered extensions include version management, advanced collections and access control with HTTP Digest Authentication. XML is used to encode method parameters and responses.

The biggest advantages of WebDAV come from the fact that the protocol is based on HTTP that already has widely deployed infrastructure. It means that any application built on top of WebDAV can use cryptographically strong authentication, proxying, caching and encryption with SSL, if so desired. The protocol has been developed in co-operation with the major vendors of web publishing tools, which promises a good level of compatibility with existing products. Another advantage is that WebDAV uses XML, which means that the protocol itself can be extended without fragmenting it.

You can use WebDAV in Jelastic to create, change, copy and move files on your server and create and manage file directories right in the cloud, simply by accessing them via HTTP/HTTPS. By using WebDAV, you can have free, instant, and secure access to your application files anywhere you have a network connection.

So, let see how to use this great solution for your Java applications in the cloud!

Create an environment

1. Go to and sign up if you haven't done it yet or log in with your Jelastic credentials by clicking the Sign In link on the page.

2. While in Jelastic dashboard, click the Create environment button:

3. In the Environment Topology dialog, pick your application server (for example, Tomcat 7 or 6). Then type your environment name, for example, webdavtest.


It will take just a minute for your environment to be created.


Upload Java package

1. Upload your Java WAR package to the Deployment manager.


2. Once the package is in Jelastic, deploy it to the environment you have created earlier.


Open in browser your application to ensure that everything is ok.


Configure Tomcat

Tomcat implements the WebDAV specification using WebDAV Servlet, which is included with all standard Tomcat distributions. Follow the next steps to configure and test WebDAV connection.

1. Click config button for Tomcat.


2. Tomcat comes prebundled with a WebDAV Level 2 servlet. To enable WebDAV connection, add the following to web.xml (server directory):

<!-- The following for read-write access -->

3. Make sure that only authorized users can access WebDAV to your context. Navigate to tomcat-users.xml, create a new user and designate a new role, for example:

<user name="test" password="tomcat" roles="role1" />

4. Define the role you have just created in the auth-constraint section of the web.xml:


5. Save the changes and restart Tomcat.


Connection to the server

1. Create a new connection using any desktop client for WebDav (we'll use BitKinex as an example).


2. Enter the URL to your server (http://{your_env_name}.{hoster_domain}/{context}/webdav), specify login and password to your Tomcat user (in our case credentials are test/tomcat).


3. As you can see we have successfully connected to our server.


WebDAV provides you a secure remote way of viewing, uploading, moving and changing your files, since they will be editable in-place, typically in a location provided by an Internet service provider. You can go to any WebDAV client. State there the host and connect to the server. As a result you'll see your files and will be able to edit them, update, add some new files etc.

Enjoy with WebDAV and Jelastic!