summaryrefslogtreecommitdiff
blob: cf1d4d4dafe063bec0694333666c5f73728313bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Example Apache HTTP server configuration snippet for WebDAV CGI
#
# Add the following lines to the Apache HTTP virtual host which should run
# WebDAV CGI.
#
# WebDAV CGI will be accessible via http://www.example.com/webdav/ and uses
# basic HTTP authentication (by default). For this to work, you need to add all
# valid users to the AuthUserFile with the help of the htpasswd command:
#
# htpasswd -c /etc/webdavcgi-0.8/default/users.htpasswd user1
# htpasswd /etc/webdavcgi-0.8/default/users.htpasswd user2
#
# Note, that if you have the UID/GID wrapper enabled (USE=suid), WebDAV CGI will
# switch to the login user after a successful login, thus the users within the
# AuthType need to present on the system as well.
#
# You probably want to review and change the following settings:
# - /webdavcgi should point to your desired webdavwrapper, which is either
#   webdavwrapper, webdavwrapper-afs, webdavwrapper-krb or in case you disabled
#   the UID/GID wrapper (USE=-suid), webdav.pl
#
# - The /webdav location
#   If you change this location, make sure to reflect the new path within the
#   WebDAV CGI configuration (WEBDAVCONF -> $VIRTUAL_BASE) as well.
#
# - The authentication provider and/or AuthUserFile
#
# - The HOMEURL environment variable. After a user logs out, the browser will
#   be redirected to this URL.
#
# - The WEBDAVCONF environment variable has to point to your configuration
#
# For further informations and other configuration possibilities consult the
# WebDAV CGI documentation which is located at http://webdavcgi.sourceforge.net
# and the Apache HTTP server documentation at https://httpd.apache.org/docs/
#
    ScriptAlias /webdavcgi "/usr/libexec/webdavcgi-0.8/cgi-bin/webdavwrapper"
    ScriptAlias /webdav/logout "/usr/libexec/webdavcgi-0.8/cgi-bin/logout"

    <Location /webdav>
        Order Allow,Deny
        Allow from all
    </Location>

    <Location /webdavcgi>
        AuthType Basic
        AuthName "WebDAV-CGI"
        AuthUserFile /etc/webdavcgi-0.8/default/users.htpasswd
        Require valid-user
        Order Allow,Deny
        Allow from all
    </Location>


    RewriteEngine On

    RewriteRule ^/webdav/logout -  [L,E=REALM:WebDAV-CGI,E=HOMEURL:/webdav,E=TIMEOUT:5]

    RewriteRule ^/webdav        /webdavcgi [PT,L,E=WEBDAVCONF:/etc/webdavcgi-0.8/default/webdav.conf,E=PERLLIB:/usr/share/webdavcgi-0.8/lib/perl,E=LOGOUTURL:/webdav/logout]