# mod_dav setup

## aleskx

Can anyone point me to a howto on Apache 1.3 and mod_dav ?

P.S. I'd rather use Apache 2 but mod_dav ebuild calls for 1.3 (or I'm doing something wrong)

----------

## systerfrida

I believe Apache2 has mod_dav built-in, but it needs to be enabled in /etc/conf.d/apache2 (or something close, anyway).

----------

## tuxmin

Besides /etc/conf.d/apache2 you need to explicitly activate DAV for a specific Location in apache.conf using the

```

DAV on

```

directive.

Consult the modules section of the online apache2 docs for details.

Alex!!!

----------

## aleskx

 *tuxmin wrote:*   

> Besides /etc/conf.d/apache2 you need to explicitly activate DAV for a specific Location in apache.conf using the
> 
> ```
> 
> DAV on
> ...

 

This is actually in 

```

/etc/apache2/conf/modules.d/45_mod_dav.conf

```

Here's a mini-howto for apache2 + dav:

1) emerge apache

2) in /etc/conf.d/apache2:

```
APACHE2_OPTS="-D DAV -D DAV_FS"
```

3) Make sure you have this line in /etc/apache2/conf/apache2.conf (it should be there, but just in case):

```
Include conf/modules.d/*.conf
```

4) create password directory and file (directory, file and user names can be changed): 

```

mkdir /var/www/DAV

chown apache:apache /var/www/localhost/DAV

htpasswd2 -c /var/www/localhost/DAV/.davpasswd davuser

```

5) create the dav directory

```

mkdir /var/www/localhost/htdocs/dav

chown apache:apache /var/www/localhost/htdocs/dav

```

7) Edit /etc/apache2/conf/modules.d/45_mod_dav.conf (see http://www.webdav.org/mod_dav/ for configuration details)

```

<IfDefine DAV>

  <IfModule !mod_dav.c>

    LoadModule dav_module    modules/mod_dav.so

  </IfModule>

</IfDefine>

<IfDefine DAV_FS>

  <IfModule !mod_dav_fs.c>

    LoadModule dav_fs_module   modules/mod_dav_fs.so

  </IfModule>

</IfDefine>

<IfModule mod_dav.c>

    DavMinTimeout 600

        <Location /dav>

                Dav On

                <Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>

                   AuthType Basic

                   AuthName "WebDAV Restricted"

                   AuthUserFile  /var/www/localhost/DAV/.davpasswd

                   Require user davuser

                </Limit>

        </Location>

</IfModule>

<IfModule mod_dav_fs.c>

    # Location of the WebDAV lock database.

    DavLockDB /var/lib/dav/lockdb

</IfModule>

```

----------

## AnubisTheKing

i have a problem too publish my Files vi webdav. I want to share a directory which is not under my DocumentRoot. 

so ich changed you Code in:

<IfModule mod_dav.c>

    Alias /musik /mnt/musik

    DavMinTimeout 600

        <Location /musik>

                Dav On

                   AuthType Basic

                   AuthName "WebDAV Restricted"

                   AuthUserFile  /etc/apache2/webdavuser

                <Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>

                   Require user davuser

                </Limit>

        </Location>

</IfModule>

But something is wrong. I cannot access my shared Directory. 

The only thing i found in the logs is:

[error] [client xxx.xxx.xxx.xxx] client denied by server configuration: /mnt/musik

But i dont know what is wrong with my server configuration. Does one of you have an idea?

Thanks for your help

AnubisTheKing

----------

## aleskx

Try this in apache2.conf:

Alias /musik /mnt/musik

<Directory /mnt/musik>

Order allow,deny

Allow from all

</Directory>

----------

## AnubisTheKing

thx that solve my problem

----------

## hw-tph

Thank you for your posts aleskx. One thing I had to change was in /etc/conf.d/apache2 where I had to switch order of the the modules, otherwise apache would exit with a mod_dav error:

```
Syntax error on line 18 of /usr/lib/apache2/conf/modules.d/45_mod_dav.conf:

Unknown DAV provider: filesystem
```

The DAV_FS module provides "filesystem", so I'm assuming that is the reason I had to specify DAV_FS prior to DAV itself in /etc/conf.d/apache2:

```
APACHE2_OPTS="-D PHP4 -D DAV_FS -D DAV"
```

This works for me so I thought I'd let others know. Thanks again.

Håkan

----------

## duozmo

aleskx, thanks very much for the short writeup. I think you owe it to everyone to put that on gentoo-wiki. If you don't want to i will with your permission

----------

## mallchin

Still nothing on the gentoo wiki. I had looked prior to finding this post, would be a worthwhile admission.

----------

## Pergamon

I've put together a howto based mainly on the informations of this thread:

https://forums.gentoo.org/viewtopic-p-2419476.html#2419476Last edited by Pergamon on Thu May 19, 2005 7:49 am; edited 1 time in total

----------

## mallchin

Cool, I'll give it a whirl...

----------

