1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5              This file is generated from xml source: DO NOT EDIT
6        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7      -->
8<title>mod_dav - Apache HTTP Server</title>
9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
12<script src="/style/scripts/prettify.js" type="text/javascript">
13</script>
14
15<link href="/images/favicon.ico" rel="shortcut icon" /></head>
16<body>
17<div id="page-header">
18<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
19<p class="apache">Apache HTTP Server Version 2.2</p>
20<img alt="" src="/images/feather.gif" /></div>
21<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
22<div id="path">
23<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Modules</a></div>
24<div id="page-content">
25<div id="preamble"><h1>Apache Module mod_dav</h1>
26<div class="toplang">
27<p><span>Available Languages: </span><a href="/en/mod/mod_dav.html" title="English">&nbsp;en&nbsp;</a> |
28<a href="/ja/mod/mod_dav.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
29<a href="/ko/mod/mod_dav.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
30</div>
31<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Distributed Authoring and Versioning
32(<a href="http://www.webdav.org/">WebDAV</a>) functionality</td></tr>
33<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
34<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>dav_module</td></tr>
35<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_dav.c</td></tr></table>
36<h3>Summary</h3>
37
38    <p>This module provides class 1 and class 2 <a href="http://www.webdav.org">WebDAV</a> ('Web-based Distributed
39    Authoring and Versioning') functionality for Apache. This
40    extension to the HTTP protocol allows creating, moving,
41    copying, and deleting resources and collections on a remote web
42    server.</p>
43</div>
44<div id="quickview"><h3 class="directives">Directives</h3>
45<ul id="toc">
46<li><img alt="" src="/images/down.gif" /> <a href="#dav">Dav</a></li>
47<li><img alt="" src="/images/down.gif" /> <a href="#davdepthinfinity">DavDepthInfinity</a></li>
48<li><img alt="" src="/images/down.gif" /> <a href="#davmintimeout">DavMinTimeout</a></li>
49</ul>
50<h3>Topics</h3>
51<ul id="topics">
52<li><img alt="" src="/images/down.gif" /> <a href="#example">Enabling WebDAV</a></li>
53<li><img alt="" src="/images/down.gif" /> <a href="#security">Security Issues</a></li>
54<li><img alt="" src="/images/down.gif" /> <a href="#complex">Complex Configurations</a></li>
55</ul><h3>See also</h3>
56<ul class="seealso">
57<li><code class="directive"><a href="/mod/mod_dav_fs.html#davlockdb">DavLockDB</a></code></li>
58<li><code class="directive"><a href="/mod/core.html#limitxmlrequestbody">LimitXMLRequestBody</a></code></li>
59<li><a href="http://www.webdav.org">WebDAV Resources</a></li>
60</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
61<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
62<div class="section">
63<h2><a name="example" id="example">Enabling WebDAV</a></h2>
64    <p>To enable <code class="module"><a href="/mod/mod_dav.html">mod_dav</a></code>, add the following to a
65    container in your <code>httpd.conf</code> file:</p>
66
67    <div class="example"><p><code>Dav On</code></p></div>
68
69    <p>This enables the DAV file system provider, which is implemented
70    by the <code class="module"><a href="/mod/mod_dav_fs.html">mod_dav_fs</a></code> module. Therefore, that module
71    must be compiled into the server or loaded at runtime using the
72    <code class="directive"><a href="/mod/mod_so.html#loadmodule">LoadModule</a></code> directive.</p>
73    
74    <p>In addition, a location for the DAV lock database must be
75    specified in the global section of your <code>httpd.conf</code>
76    file using the <code class="directive"><a href="/mod/mod_dav_fs.html#davlockdb">DavLockDB</a></code>
77    directive:</p>
78
79    <div class="example"><p><code>
80      DavLockDB /usr/local/apache2/var/DavLock
81    </code></p></div>
82
83    <p>The directory containing the lock database file must be
84    writable by the <code class="directive"><a href="/mod/mpm_common.html#user">User</a></code>
85    and <code class="directive"><a href="/mod/mpm_common.html#group">Group</a></code> under which
86    Apache is running.</p>
87
88    <p>You may wish to add a <code class="directive"><a href="/mod/core.html#limit">&lt;Limit&gt;</a></code> clause inside the <code class="directive"><a href="/mod/core.html#location">&lt;Location&gt;</a></code> directive to limit access to
89    DAV-enabled locations. If you want to set the maximum amount of
90    bytes that a DAV client can send at one request, you have to use
91    the <code class="directive"><a href="/mod/core.html#limitxmlrequestbody">LimitXMLRequestBody</a></code>
92    directive. The "normal" <code class="directive"><a href="/mod/core.html#limitrequestbody">LimitRequestBody</a></code> directive has no effect on DAV
93    requests.</p>
94
95    <div class="example"><h3>Full Example</h3><p><code>
96      DavLockDB /usr/local/apache2/var/DavLock<br />
97      <br />
98       &lt;Location /foo&gt;<br />
99       <span class="indent">
100         Order Allow,Deny<br />
101         Allow from all<br />
102         Dav On<br />
103         <br />
104         AuthType Basic<br />
105         AuthName DAV<br />
106         AuthUserFile user.passwd<br />
107         <br />
108         &lt;LimitExcept GET OPTIONS&gt;<br />
109         <span class="indent">
110           Require user admin<br />
111         </span>
112         &lt;/LimitExcept&gt;<br />
113       </span>
114       &lt;/Location&gt;<br />
115    </code></p></div>
116
117   <p><code class="module"><a href="/mod/mod_dav.html">mod_dav</a></code> is a descendent of Greg Stein's <a href="http://www.webdav.org/mod_dav/">mod_dav for Apache 1.3</a>.  More
118   information about the module is available from that site.</p>
119</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
120<div class="section">
121<h2><a name="security" id="security">Security Issues</a></h2>
122
123    <p>Since DAV access methods allow remote clients to manipulate
124    files on the server, you must take particular care to assure that
125    your server is secure before enabling <code class="module"><a href="/mod/mod_dav.html">mod_dav</a></code>.</p>
126
127    <p>Any location on the server where DAV is enabled should be
128    protected by authentication.  The use of HTTP Basic Authentication
129    is not recommended. You should use at least HTTP Digest
130    Authentication, which is provided by the
131    <code class="module"><a href="/mod/mod_auth_digest.html">mod_auth_digest</a></code> module. Nearly all WebDAV clients
132    support this authentication method. An alternative is Basic
133    Authentication over an <a href="/ssl/">SSL</a> enabled
134    connection.</p>
135
136    <p>In order for <code class="module"><a href="/mod/mod_dav.html">mod_dav</a></code> to manage files, it must
137    be able to write to the directories and files under its control
138    using the <code class="directive"><a href="/mod/mpm_common.html#user">User</a></code> and
139    <code class="directive"><a href="/mod/mpm_common.html#group">Group</a></code> under which
140    Apache is running.  New files created will also be owned by this
141    <code class="directive"><a href="/mod/mpm_common.html#user">User</a></code> and <code class="directive"><a href="/mod/mpm_common.html#group">Group</a></code>.  For this reason, it is
142    important to control access to this account.  The DAV repository
143    is considered private to Apache; modifying files outside of Apache
144    (for example using FTP or filesystem-level tools) should not be
145    allowed.</p>
146
147    <p><code class="module"><a href="/mod/mod_dav.html">mod_dav</a></code> may be subject to various kinds of
148    denial-of-service attacks.  The <code class="directive"><a href="/mod/core.html#limitxmlrequestbody">LimitXMLRequestBody</a></code> directive can be
149    used to limit the amount of memory consumed in parsing large DAV
150    requests.  The <code class="directive"><a href="#davdepthinfinity">DavDepthInfinity</a></code> directive can be
151    used to prevent <code>PROPFIND</code> requests on a very large
152    repository from consuming large amounts of memory.  Another
153    possible denial-of-service attack involves a client simply filling
154    up all available disk space with many large files.  There is no
155    direct way to prevent this in Apache, so you should avoid giving
156    DAV access to untrusted users.</p>
157</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
158<div class="section">
159<h2><a name="complex" id="complex">Complex Configurations</a></h2>
160
161    <p>One common request is to use <code class="module"><a href="/mod/mod_dav.html">mod_dav</a></code> to
162    manipulate dynamic files (PHP scripts, CGI scripts, etc).  This is
163    difficult because a <code>GET</code> request will always run the
164    script, rather than downloading its contents.  One way to avoid
165    this is to map two different URLs to the content, one of which
166    will run the script, and one of which will allow it to be
167    downloaded and manipulated with DAV.</p>
168
169<div class="example"><p><code>
170Alias /phparea /home/gstein/php_files<br />
171Alias /php-source /home/gstein/php_files<br />
172&lt;Location /php-source&gt;
173<span class="indent">
174    DAV On<br />
175    ForceType text/plain<br />
176</span>
177&lt;/Location&gt;
178</code></p></div>
179
180    <p>With this setup, <code>http://example.com/phparea</code> can be
181    used to access the output of the PHP scripts, and
182    <code>http://example.com/php-source</code> can be used with a DAV
183    client to manipulate them.</p>
184</div>
185<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
186<div class="directive-section"><h2><a name="Dav" id="Dav">Dav</a> <a name="dav" id="dav">Directive</a></h2>
187<table class="directive">
188<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable WebDAV HTTP methods</td></tr>
189<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Dav On|Off|<var>provider-name</var></code></td></tr>
190<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Dav Off</code></td></tr>
191<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
192<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
193<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dav</td></tr>
194</table>
195    <p>Use the <code class="directive">Dav</code> directive to enable the
196    WebDAV HTTP methods for the given container:</p>
197
198    <div class="example"><p><code>
199      &lt;Location /foo&gt;<br />
200      <span class="indent">
201        Dav On<br />
202      </span>
203      &lt;/Location&gt;
204    </code></p></div>
205
206    <p>The value <code>On</code> is actually an alias for the default
207    provider <code>filesystem</code> which is served by the <code class="module"><a href="/mod/mod_dav_fs.html">mod_dav_fs</a></code> module. Note, that once you have DAV enabled
208    for some location, it <em>cannot</em> be disabled for sublocations.
209    For a complete configuration example have a look at the <a href="#example">section above</a>.</p>
210
211    <div class="warning">
212      Do not enable WebDAV until you have secured your server. Otherwise
213      everyone will be able to distribute files on your system.
214    </div>
215
216</div>
217<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
218<div class="directive-section"><h2><a name="DavDepthInfinity" id="DavDepthInfinity">DavDepthInfinity</a> <a name="davdepthinfinity" id="davdepthinfinity">Directive</a></h2>
219<table class="directive">
220<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Allow PROPFIND, Depth: Infinity requests</td></tr>
221<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DavDepthInfinity on|off</code></td></tr>
222<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DavDepthInfinity off</code></td></tr>
223<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
224<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
225<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dav</td></tr>
226</table>
227    <p>Use the <code class="directive">DavDepthInfinity</code> directive to
228    allow the processing of <code>PROPFIND</code> requests containing the
229    header 'Depth: Infinity'. Because this type of request could constitute
230    a denial-of-service attack, by default it is not allowed.</p>
231
232</div>
233<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
234<div class="directive-section"><h2><a name="DavMinTimeout" id="DavMinTimeout">DavMinTimeout</a> <a name="davmintimeout" id="davmintimeout">Directive</a></h2>
235<table class="directive">
236<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Minimum amount of time the server holds a lock on
237a DAV resource</td></tr>
238<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DavMinTimeout <var>seconds</var></code></td></tr>
239<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DavMinTimeout 0</code></td></tr>
240<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
241<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
242<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dav</td></tr>
243</table>
244    <p>When a client requests a DAV resource lock, it can also
245    specify a time when the lock will be automatically removed by
246    the server. This value is only a request, and the server can
247    ignore it or inform the client of an arbitrary value.</p>
248
249    <p>Use the <code class="directive">DavMinTimeout</code> directive to specify, in
250    seconds, the minimum lock timeout to return to a client.
251    Microsoft Web Folders defaults to a timeout of 120 seconds; the
252    <code class="directive">DavMinTimeout</code> can override this to a higher value
253    (like 600 seconds) to reduce the chance of the client losing
254    the lock due to network latency.</p>
255
256    <div class="example"><h3>Example</h3><p><code>
257      &lt;Location /MSWord&gt;<br />
258      <span class="indent">
259        DavMinTimeout 600<br />
260      </span>
261      &lt;/Location&gt;
262    </code></p></div>
263
264</div>
265</div>
266<div class="bottomlang">
267<p><span>Available Languages: </span><a href="/en/mod/mod_dav.html" title="English">&nbsp;en&nbsp;</a> |
268<a href="/ja/mod/mod_dav.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
269<a href="/ko/mod/mod_dav.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
270</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
271<script type="text/javascript"><!--//--><![CDATA[//><!--
272var comments_shortname = 'httpd';
273var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_dav.html';
274(function(w, d) {
275    if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
276        d.write('<div id="comments_thread"><\/div>');
277        var s = d.createElement('script');
278        s.type = 'text/javascript';
279        s.async = true;
280        s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
281        (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
282    }
283    else { 
284        d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
285    }
286})(window, document);
287//--><!]]></script></div><div id="footer">
288<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
289<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
290if (typeof(prettyPrint) !== 'undefined') {
291    prettyPrint();
292}
293//--><!]]></script>
294</body></html>