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 Order Allow,Deny<br />
90 AuthUserFile user.passwd<br />
92 <LimitExcept GET POST OPTIONS><br />
94 Require user admin<br />
96 </LimitExcept><br />
98 </Directory><br />
101 <p><module>mod_dav</module> is a descendent of Greg Stein's <a
102 href="http://www.webdav.org/mod_dav/">mod_dav for Apache 1.3</a>. More
103 information about the module is available from that site.</p>
106 <section id="security"><title>Security Issues</title>
108 <p>Since DAV access methods allow remote clients to manipulate
109 files on the server, you must take particular care to assure that
110 your server is secure before enabling <module>mod_dav</module>.</p>
112 <p>Any location on the server where DAV is enabled should be
113 protected by authentication. The use of HTTP Basic Authentication
114 is not recommended. You should use at least HTTP Digest
115 Authentication, which is provided by the
116 <module>mod_auth_digest</module> module. Nearly all WebDAV clients
117 support this authentication method. An alternative is Basic
118 Authentication over an <a href="../ssl/">SSL</a> enabled
121 <p>In order for <module>mod_dav</module> to manage files, it must
122 be able to write to the directories and files under its control
123 using the <directive module="mod_unixd">User</directive> and
124 <directive module="mod_unixd">Group</directive> under which
125 Apache is running. New files created will also be owned by this
126 <directive module="mod_unixd">User</directive> and <directive
127 module="mod_unixd">Group</directive>. For this reason, it is
128 important to control access to this account. The DAV repository
129 is considered private to Apache; modifying files outside of Apache
130 (for example using FTP or filesystem-level tools) should not be
133 <p><module>mod_dav</module> may be subject to various kinds of
134 denial-of-service attacks. The <directive
135 module="core">LimitXMLRequestBody</directive> directive can be
136 used to limit the amount of memory consumed in parsing large DAV
137 requests. The <directive
138 module="mod_dav">DavDepthInfinity</directive> directive can be
139 used to prevent <code>PROPFIND</code> requests on a very large
140 repository from consuming large amounts of memory. Another
141 possible denial-of-service attack involves a client simply filling
142 up all available disk space with many large files. There is no
143 direct way to prevent this in Apache, so you should avoid giving
144 DAV access to untrusted users.</p>
147 <section id="complex"><title>Complex Configurations</title>
149 <p>One common request is to use <module>mod_dav</module> to
150 manipulate dynamic files (PHP scripts, CGI scripts, etc). This is
151 difficult because a <code>GET</code> request will always run the
152 script, rather than downloading its contents. One way to avoid
153 this is to map two different URLs to the content, one of which
154 will run the script, and one of which will allow it to be
155 downloaded and manipulated with DAV.</p>
158 Alias /phparea /home/gstein/php_files<br />
159 Alias /php-source /home/gstein/php_files<br />
160 <Location /php-source>
163 ForceType text/plain<br />
168 <p>With this setup, <code>http://example.com/phparea</code> can be
169 used to access the output of the PHP scripts, and
170 <code>http://example.com/php-source</code> can be used with a DAV
171 client to manipulate them.</p>
176 <description>Enable WebDAV HTTP methods</description>
177 <syntax>Dav On|Off|<var>provider-name</var></syntax>
178 <default>Dav Off</default>
179 <contextlist><context>directory</context></contextlist>
182 <p>Use the <directive>Dav</directive> directive to enable the
183 WebDAV HTTP methods for the given container:</p>
186 <Location /foo><br />
193 <p>The value <code>On</code> is actually an alias for the default
194 provider <code>filesystem</code> which is served by the <module
195 >mod_dav_fs</module> module. Note, that once you have DAV enabled
196 for some location, it <em>cannot</em> be disabled for sublocations.
197 For a complete configuration example have a look at the <a
198 href="#example">section above</a>.</p>
200 <note type="warning">
201 Do not enable WebDAV until you have secured your server. Otherwise
202 everyone will be able to distribute files on your system.
208 <name>DavMinTimeout</name>
209 <description>Minimum amount of time the server holds a lock on
210 a DAV resource</description>
211 <syntax>DavMinTimeout <var>seconds</var></syntax>
212 <default>DavMinTimeout 0</default>
213 <contextlist><context>server config</context><context>virtual host</context>
214 <context>directory</context></contextlist>
217 <p>When a client requests a DAV resource lock, it can also
218 specify a time when the lock will be automatically removed by
219 the server. This value is only a request, and the server can
220 ignore it or inform the client of an arbitrary value.</p>
222 <p>Use the <directive>DavMinTimeout</directive> directive to specify, in
223 seconds, the minimum lock timeout to return to a client.
224 Microsoft Web Folders defaults to a timeout of 120 seconds; the
225 <directive>DavMinTimeout</directive> can override this to a higher value
226 (like 600 seconds) to reduce the chance of the client losing
227 the lock due to network latency.</p>
229 <example><title>Example</title>
230 <Location /MSWord><br />
232 DavMinTimeout 600<br />
240 <name>DavDepthInfinity</name>
241 <description>Allow PROPFIND, Depth: Infinity requests</description>
242 <syntax>DavDepthInfinity on|off</syntax>
243 <default>DavDepthInfinity off</default>
244 <contextlist><context>server config</context><context>virtual host</context>
245 <context>directory</context></contextlist>
248 <p>Use the <directive>DavDepthInfinity</directive> directive to
249 allow the processing of <code>PROPFIND</code> requests containing the
250 header 'Depth: Infinity'. Because this type of request could constitute
251 a denial-of-service attack, by default it is not allowed.</p>