Remote Access via WebDAV
Remote File Access via WebDAV
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.
Create the Environment
1Open the environment wizard
Sign in to the platform dashboard and click Create environment.
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.
Wait until the environment is created and the Tomcat node reaches the running state.
Upload the Java Package
1Upload the WAR archive
Open Deployment Manager and upload the required Java WAR package.
2Deploy the application
Deploy the uploaded package to the WebDAV environment and select the required application context.
Open the application in a browser to confirm that the deployment is working correctly.
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.
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>
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>
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>
4Restart Tomcat
Save the updated configuration files and restart the Tomcat node.
Connect with a WebDAV Client
Create a new connection using any compatible desktop WebDAV client. The source example uses BitKinex.
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.
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.
