Moved apache code into a folder to help prepare for packaging where we dont want...
[httpd-crcsyncproxy.git] / apache / docs / manual / mod / mod_dav.xml
blob06bd77eb2808cd83b4eb2e954ceb6e75738ed83d
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
6 <!--
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.
21 -->
23 <modulesynopsis metafile="mod_dav.xml.meta">
25 <name>mod_dav</name> 
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>
32 <summary>
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
38     server.</p>
39 </summary>
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>
54     
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>
58     directive:</p>
60     <example>
61       DavLockDB /usr/local/apache2/var/DavLock
62     </example>
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
77     requests.</p>
79     <example><title>Full Example</title>
80       DavLockDB /usr/local/apache2/var/DavLock<br />
81       <br />
82       &lt;Directory /usr/local/apache2/htdocs/foo&gt;<br />
83       <indent>
84         Order Allow,Deny<br />
85         Allow from all<br />
86         Dav On<br />
87         <br />
88         AuthType Basic<br />
89         AuthName DAV<br />
90         AuthUserFile user.passwd<br />
91         <br />
92         &lt;LimitExcept GET POST OPTIONS&gt;<br />
93         <indent>
94           Require user admin<br />
95         </indent>
96         &lt;/LimitExcept&gt;<br />
97       </indent>
98       &lt;/Directory&gt;<br />
99     </example>
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>
104 </section>
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
119     connection.</p>
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
131     allowed.</p>
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>
145 </section>
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>
157 <example>
158 Alias /phparea /home/gstein/php_files<br />
159 Alias /php-source /home/gstein/php_files<br />
160 &lt;Location /php-source&gt;
161 <indent>
162     DAV On<br />
163     ForceType text/plain<br />
164 </indent>
165 &lt;/Location&gt;
166 </example>
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>
172 </section>
174 <directivesynopsis>
175 <name>Dav</name>
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>
181 <usage>
182     <p>Use the <directive>Dav</directive> directive to enable the
183     WebDAV HTTP methods for the given container:</p>
185     <example>
186       &lt;Location /foo&gt;<br />
187       <indent>
188         Dav On<br />
189       </indent>
190       &lt;/Location&gt;
191     </example>
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.
203     </note>
204 </usage>
205 </directivesynopsis>
207 <directivesynopsis>
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>
216 <usage>
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       &lt;Location /MSWord&gt;<br />
231       <indent>
232         DavMinTimeout 600<br />
233       </indent>
234       &lt;/Location&gt;
235     </example>
236 </usage>     
237 </directivesynopsis>
239 <directivesynopsis>
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>
247 <usage>
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>
252 </usage>
253 </directivesynopsis>
255 </modulesynopsis>