]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_dav.xml
Update transforms
[apache] / docs / manual / mod / mod_dav.xml
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$ -->
5
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
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
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 -->
22
23 <modulesynopsis metafile="mod_dav.xml.meta">
24
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>
31
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>
43
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>
47
48     <example>Dav On</example>
49
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>
59
60     <example>
61       DavLockDB /usr/local/apache2/var/DavLock
62     </example>
63
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>
68
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>
78
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         Require all granted<br />
85         Dav On<br />
86         <br />
87         AuthType Basic<br />
88         AuthName DAV<br />
89         AuthUserFile user.passwd<br />
90         <br />
91         &lt;LimitExcept GET POST OPTIONS&gt;<br />
92         <indent>
93           Require user admin<br />
94         </indent>
95         &lt;/LimitExcept&gt;<br />
96       </indent>
97       &lt;/Directory&gt;<br />
98     </example>
99
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>
103 </section>
104
105 <section id="security"><title>Security Issues</title>
106
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>
110
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
118     connection.</p>
119
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
130     allowed.</p>
131
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>
144 </section>
145
146 <section id="complex"><title>Complex Configurations</title>
147
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>
155
156 <example>
157 Alias /phparea /home/gstein/php_files<br />
158 Alias /php-source /home/gstein/php_files<br />
159 &lt;Location /php-source&gt;
160 <indent>
161     DAV On<br />
162     ForceType text/plain<br />
163 </indent>
164 &lt;/Location&gt;
165 </example>
166
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>
171 </section>
172
173 <directivesynopsis>
174 <name>Dav</name>
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>
179
180 <usage>
181     <p>Use the <directive>Dav</directive> directive to enable the
182     WebDAV HTTP methods for the given container:</p>
183
184     <example>
185       &lt;Location /foo&gt;<br />
186       <indent>
187         Dav On<br />
188       </indent>
189       &lt;/Location&gt;
190     </example>
191
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>
198
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.
202     </note>
203 </usage>
204 </directivesynopsis>
205
206 <directivesynopsis>
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>
214
215 <usage>
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>
220
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>
227
228     <example><title>Example</title>
229       &lt;Location /MSWord&gt;<br />
230       <indent>
231         DavMinTimeout 600<br />
232       </indent>
233       &lt;/Location&gt;
234     </example>
235 </usage>     
236 </directivesynopsis>
237
238 <directivesynopsis>
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>
245
246 <usage>
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>
251 </usage>
252 </directivesynopsis>
253
254 </modulesynopsis>
255
256