2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_dav.xml.meta">
26 <description>Distributed Authoring and Versioning
27 (<a href="http://www.webdav.org/">WebDAV</a>) functionality</description>
28 <status>Extension</status>
29 <sourcefile>mod_dav.c</sourcefile>
30 <identifier>dav_module</identifier>
33 <p>This module provides class 1 and class 2 <a
34 href="http://www.webdav.org">WebDAV</a> ('Web-based Distributed
35 Authoring and Versioning') functionality for Apache. This
36 extension to the HTTP protocol allows creating, moving,
37 copying, and deleting resources and collections on a remote web
40 <seealso><directive module="mod_dav_fs">DavLockDB</directive></seealso>
41 <seealso><directive module="core">LimitXMLRequestBody</directive></seealso>
42 <seealso><a href="http://www.webdav.org">WebDAV Resources</a></seealso>
44 <section id="example"><title>Enabling WebDAV</title>
45 <p>To enable <module>mod_dav</module>, add the following to a
46 container in your <code>httpd.conf</code> file:</p>
48 <example>Dav On</example>
50 <p>This enables the DAV file system provider, which is implemented
51 by the <module>mod_dav_fs</module> module. Therefore, that module
52 must be compiled into the server or loaded at runtime using the
53 <directive module="mod_so">LoadModule</directive> directive.</p>
55 <p>In addition, a location for the DAV lock database must be
56 specified in the global section of your <code>httpd.conf</code>
57 file using the <directive module="mod_dav_fs">DavLockDB</directive>
61 DavLockDB /usr/local/apache2/var/DavLock
64 <p>The directory containing the lock database file must be
65 writable by the <directive module="mod_unixd">User</directive>
66 and <directive module="mod_unixd" >Group</directive> under which
67 Apache is running.</p>
69 <p>You may wish to add a <directive module="core" type="section"
70 >Limit</directive> clause inside the <directive module="core"
71 type="section">Location</directive> directive to limit access to
72 DAV-enabled locations. If you want to set the maximum amount of
73 bytes that a DAV client can send at one request, you have to use
74 the <directive module="core">LimitXMLRequestBody</directive>
75 directive. The "normal" <directive module="core"
76 >LimitRequestBody</directive> directive has no effect on DAV
79 <example><title>Full Example</title>
80 DavLockDB /usr/local/apache2/var/DavLock<br />
82 <Directory /usr/local/apache2/htdocs/foo><br />
84 Require all granted<br />
89 AuthUserFile user.passwd<br />
91 <LimitExcept GET POST OPTIONS><br />
93 Require user admin<br />
95 </LimitExcept><br />
97 </Directory><br />
100 <p><module>mod_dav</module> is a descendent of Greg Stein's <a
101 href="http://www.webdav.org/mod_dav/">mod_dav for Apache 1.3</a>. More
102 information about the module is available from that site.</p>
105 <section id="security"><title>Security Issues</title>
107 <p>Since DAV access methods allow remote clients to manipulate
108 files on the server, you must take particular care to assure that
109 your server is secure before enabling <module>mod_dav</module>.</p>
111 <p>Any location on the server where DAV is enabled should be
112 protected by authentication. The use of HTTP Basic Authentication
113 is not recommended. You should use at least HTTP Digest
114 Authentication, which is provided by the
115 <module>mod_auth_digest</module> module. Nearly all WebDAV clients
116 support this authentication method. An alternative is Basic
117 Authentication over an <a href="../ssl/">SSL</a> enabled
120 <p>In order for <module>mod_dav</module> to manage files, it must
121 be able to write to the directories and files under its control
122 using the <directive module="mod_unixd">User</directive> and
123 <directive module="mod_unixd">Group</directive> under which
124 Apache is running. New files created will also be owned by this
125 <directive module="mod_unixd">User</directive> and <directive
126 module="mod_unixd">Group</directive>. For this reason, it is
127 important to control access to this account. The DAV repository
128 is considered private to Apache; modifying files outside of Apache
129 (for example using FTP or filesystem-level tools) should not be
132 <p><module>mod_dav</module> may be subject to various kinds of
133 denial-of-service attacks. The <directive
134 module="core">LimitXMLRequestBody</directive> directive can be
135 used to limit the amount of memory consumed in parsing large DAV
136 requests. The <directive
137 module="mod_dav">DavDepthInfinity</directive> directive can be
138 used to prevent <code>PROPFIND</code> requests on a very large
139 repository from consuming large amounts of memory. Another
140 possible denial-of-service attack involves a client simply filling
141 up all available disk space with many large files. There is no
142 direct way to prevent this in Apache, so you should avoid giving
143 DAV access to untrusted users.</p>
146 <section id="complex"><title>Complex Configurations</title>
148 <p>One common request is to use <module>mod_dav</module> to
149 manipulate dynamic files (PHP scripts, CGI scripts, etc). This is
150 difficult because a <code>GET</code> request will always run the
151 script, rather than downloading its contents. One way to avoid
152 this is to map two different URLs to the content, one of which
153 will run the script, and one of which will allow it to be
154 downloaded and manipulated with DAV.</p>
157 Alias /phparea /home/gstein/php_files<br />
158 Alias /php-source /home/gstein/php_files<br />
159 <Location /php-source>
162 ForceType text/plain<br />
167 <p>With this setup, <code>http://example.com/phparea</code> can be
168 used to access the output of the PHP scripts, and
169 <code>http://example.com/php-source</code> can be used with a DAV
170 client to manipulate them.</p>
175 <description>Enable WebDAV HTTP methods</description>
176 <syntax>Dav On|Off|<var>provider-name</var></syntax>
177 <default>Dav Off</default>
178 <contextlist><context>directory</context></contextlist>
181 <p>Use the <directive>Dav</directive> directive to enable the
182 WebDAV HTTP methods for the given container:</p>
185 <Location /foo><br />
192 <p>The value <code>On</code> is actually an alias for the default
193 provider <code>filesystem</code> which is served by the <module
194 >mod_dav_fs</module> module. Note, that once you have DAV enabled
195 for some location, it <em>cannot</em> be disabled for sublocations.
196 For a complete configuration example have a look at the <a
197 href="#example">section above</a>.</p>
199 <note type="warning">
200 Do not enable WebDAV until you have secured your server. Otherwise
201 everyone will be able to distribute files on your system.
207 <name>DavMinTimeout</name>
208 <description>Minimum amount of time the server holds a lock on
209 a DAV resource</description>
210 <syntax>DavMinTimeout <var>seconds</var></syntax>
211 <default>DavMinTimeout 0</default>
212 <contextlist><context>server config</context><context>virtual host</context>
213 <context>directory</context></contextlist>
216 <p>When a client requests a DAV resource lock, it can also
217 specify a time when the lock will be automatically removed by
218 the server. This value is only a request, and the server can
219 ignore it or inform the client of an arbitrary value.</p>
221 <p>Use the <directive>DavMinTimeout</directive> directive to specify, in
222 seconds, the minimum lock timeout to return to a client.
223 Microsoft Web Folders defaults to a timeout of 120 seconds; the
224 <directive>DavMinTimeout</directive> can override this to a higher value
225 (like 600 seconds) to reduce the chance of the client losing
226 the lock due to network latency.</p>
228 <example><title>Example</title>
229 <Location /MSWord><br />
231 DavMinTimeout 600<br />
239 <name>DavDepthInfinity</name>
240 <description>Allow PROPFIND, Depth: Infinity requests</description>
241 <syntax>DavDepthInfinity on|off</syntax>
242 <default>DavDepthInfinity off</default>
243 <contextlist><context>server config</context><context>virtual host</context>
244 <context>directory</context></contextlist>
247 <p>Use the <directive>DavDepthInfinity</directive> directive to
248 allow the processing of <code>PROPFIND</code> requests containing the
249 header 'Depth: Infinity'. Because this type of request could constitute
250 a denial-of-service attack, by default it is not allowed.</p>