Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT?] How to get WebDAV going on Apache?
Date: Sat, 01 Mar 2014 12:08:50
Message-Id: 201403011208.19278.michaelkintzios@gmail.com
In Reply to: Re: [gentoo-user] [OT?] How to get WebDAV going on Apache? by Peter Humphrey
1 On Saturday 01 Mar 2014 11:13:40 Peter Humphrey wrote:
2 > On Friday 28 Feb 2014 16:31:39 Nilesh Govindrajan wrote:
3 > > You don't need moddav for owncloud. Owncloud implements it via php.
4 >
5 > Now I am confused. Do I need to add or remove a USE flag from php or
6 > owncloud?
7
8 I can't advise on owncloud, because I hadn't heard of it until now. In a
9 vanilla apache installation you would need to do the following:
10
11
12 1. Set up the dav, dav_fs, dav_lock USE flags in apache, remerge it and
13 restart it.
14
15
16 2. Check that /etc/apache2/httpd.conf shows:
17
18 <IfDefine DAV>
19 LoadModule dav_module modules/mod_dav.so
20 </IfDefine>
21 <IfDefine DAV>
22 LoadModule dav_fs_module modules/mod_dav_fs.so
23 </IfDefine>
24 <IfDefine DAV>
25 LoadModule dav_lock_module modules/mod_dav_lock.so
26 </IfDefine>
27
28
29 3. Set up your vhost fs to enable webdav access to it:
30
31 <VirtualHost *:80>
32 ServerName example.com
33 ServerAlias my_example.com
34 DocumentRoot /var/www/dev.example.com/htdocs
35 <Location />
36 Dav On
37 AuthType Basic
38 AuthUserFile /var/www/.basic_password
39 AuthName "My WebDav Site - Admin Access Only!"
40 Require user My_User
41 </Location>
42 </VirtualHost>
43
44
45 4. Configure your corresponding modules.d vhost file:
46
47 <Directory "/var/www/dev.example.com/htdocs">
48 Options FollowSymlinks
49 AllowOverride All
50 Order deny,allow
51 Allow from all
52 </Directory>
53
54
55 5. Configure the installed webdav module file. I don't know what are the
56 defaults but this is what I have in my /etc/apache2/modules.d/45_mod_dav.conf:
57
58 <IfDefine DAV>
59 DavLockDB "/var/lib/dav/lockdb"
60
61 # The following directives disable redirects on non-GET requests for
62 # a directory that does not include the trailing slash. This fixes a
63 # problem with several clients that do not appropriately handle
64 # redirects for folders with DAV methods.
65 <IfModule setenvif_module>
66 BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-
67 carefully
68 BrowserMatch "MS FrontPage" redirect-carefully
69 BrowserMatch "^WebDrive" redirect-carefully
70 BrowserMatch "^WebDAVFS/1.[012345678]" redirect-carefully
71 BrowserMatch "^gnome-vfs/1.0" redirect-carefully
72 BrowserMatch "^XML Spy" redirect-carefully
73 BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
74 </IfModule>
75 </IfDefine>
76
77
78 6. Set up /etc/conf.d/apache2 to start the DAV option. In mine I have both '-
79 D DAV' and '-D DAV_FS', but I don't know if apache-2.4 needs the latter to be
80 explicitly started by apachectl or if it is loaded by the DAV module.
81
82
83 Restart apache and you should be able to access the fs from a browser, with
84 username 'My_User' and whatever password you have created with htpasswd. If
85 you don't trust the network and therefore you don't want to be sending
86 credentials in the clear, enable SSL.
87
88 I hope I haven't missed anything important here. Have a look at the online
89 apache documentation for more advanced settings, if you want to lock down what
90 webdav will allow, otherwise keep an eye on your apache logs to see if there
91 are any errors.
92
93 HTH.
94
95 --
96 Regards,
97 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] [OT?] How to get WebDAV going on Apache? Peter Humphrey <peter@××××××××××××.uk>