# How do I enable mod_dav for apache

## TheJabberwokk

How do I enable mod_dav for apache 2.0.46? and stupid question "where is httpd.conf?"

----------

## slartibartfasz

/etc/apache2/conf/commonapache.conf + files in and under this directory

mod_dav:

 in apache2.conf add:

LoadModule dav_module                    modules/mod_dav.so

----------

## relyt

or you can add

```
-D DAV
```

 to APACHE2_OPTS in /etc/conf.d/apache2

----------

## TheJabberwokk

I added  *Quote:*   

> -D DAV

  to  /etc/conf.d/apache2 and I added  *Quote:*   

> 
> 
> <IfModule mod_dav.c>
> 
> 	<Location /home/httpd/htdocs>
> ...

 

in /etc/apache2/conf/commonapache.conf and recompiled apache with --with-dav --enable-dav etc...

What am I missing?

----------

## slartibartfasz

it worked out of the box for me - no need to recompile with additional flags, DAV is included in apache2:

```
h2o root # cat /usr/portage/net-www/apache/apache-2.0.46.ebuild | grep dav

        for i in 40_mod_ssl.conf 41_mod_ssl.default-vhost.conf 45_mod_dav.conf

        install -d -m0755 -o apache -g apache ${ROOT}/var/lib/dav

```

what error do u get? look at the output of 'tail -f /var/log/apache2/error_log' while accessing a DAV enabled directory. and take a look at http://127.0.0.1/server-info - see if mod_dav.c is there and what the section says...

----------

## TheJabberwokk

http://127.0.0.1/server-info gives me *Quote:*   

> Module Name: mod_dav_fs.c
> 
> Content handlers: none
> 
> Configuration Phase Participation: Create Server Config, Merge Server Configs
> ...

 

however when I go webdav://127.0.0.1:8080 in konqueror I get an error and port 8080 is not coming up on nmap. and  tail -f /var/log/apache2/error_log is not giving me any error

what am I missing?

----------

## slartibartfasz

 *TheJabberwokk wrote:*   

> 
> 
> however when I go webdav://127.0.0.1:8080 in konqueror I get an error and port 8080 is not coming up on nmap. and  tail -f /var/log/apache2/error_log is not giving me any error
> 
> what am I missing?

 

what is the error?

seems like u dont get through on 8080, are u running a firewall? what ports is apache listening on?

----------

## himpierre

Hello

I have a problem with mod_dav to. If i try to start apache2 with mod_dav enabled i get:

```

irmeli modules.d # /etc/init.d/apache2 start

 * Starting apache2...

Syntax error on line 18 of /etc/apache2/conf/modules.d/45_mod_dav.conf:

Unknown DAV provider: filesystem                                          [ !! ]

irmeli modules.d #

```

my mod_dav.conf looks as follows:

```

<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 /home/httpd/htdocs>

Options None

DAV On

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

Require user himbeere

</Limit>

</Location>

</IfModule>

<IfModule mod_dav_fs.c>

    # Location of the WebDAV lock database.

DavLockDB /var/lib/dav/lockdb

</IfModule>

```

Someone has an idea how to resolve that problem?

Thank you and regards

Thomas

----------

## slartibartfasz

@himbeere

try to move the Location container to commonapache.conf

----------

## TheJabberwokk

I added  *Quote:*   

> <IfDefine DAV>
> 
>   <IfModule !mod_dav.c>
> 
>     LoadModule dav_module    modules/mod_dav.so
> ...

  to  commonapache2.conf and I do not get any errors when starting apache. when I do a nmap of my localhost with my firewall turned off I get this *Quote:*   

> Starting nmap 3.30 ( http://www.insecure.org/nmap/ ) at 2003-07-05 20:59 EDT
> 
> Interesting ports on jabberwokk (127.0.0.1):
> 
> (The 1634 ports scanned but not shown below are in state: closed)
> ...

  When I try accessing webdav://127.0.0.1:8080  with konqueror I get this  *Quote:*   

> An error occured while loading webdav://127.0.0.1:8080:
> 
> Could not connect to host 127.0.0.1 (port 8080)

  when I do tail -f /var/log/apache2/error_log afterwards I get this *Quote:*   

> [Sat Jul 05 20:58:06 2003] [notice] Digest: done
> 
> [Sat Jul 05 20:58:07 2003] [notice] Apache/2.0.46 (Gentoo/Linux) DAV/2 mod_ssl/2.0.46 OpenSSL/0.9.6j PHP/4.3.2 configured -- resuming normal operations
> 
> [Sat Jul 05 20:59:29 2003] [notice] caught SIGTERM, shutting down
> ...

 

I am missing something crucial but for the life of me I can't think of what! any suggestiuons?

----------

## slartibartfasz

@himbeere:

to get rid of the startup error u have to add '-D DAV_FS' to the apache startup options in /etc/conf.d/apache2

EDIT:

@TheJabberwokk:

everything seems to be all right - did u try to connect via the standard port? --> webdav://127.0.0.1

 *slartibartfasz wrote:*   

> seems like u dont get through on 8080, are u running a firewall? what ports is apache listening on?

 

did u check this? if u want to connect to 8080 u need to set the listen directive to that port ---> /etc/init.d/conf/apache2.conf --->

```
Listen 80

Listen 8080
```

----------

## himpierre

Hello

Thanks slartibartfasz. Loading the module -D DAV_FS blows away the error message. But i can`t still use webdav. Konqueror gives me:

```

The file or directory webdav://127.0.0.1/ does not exist

```

127.0.0.1/server-info:

```

Module Name: mod_dav_fs.c

Content handlers: none

Configuration Phase Participation: Create Server Config, Merge Server Configs

Request Phase Participation: none

Module Directives:

DAVLockDB - specify a lock database

Current Configuration:

DavLockDB /var/log/apache2/dav/lockdb

Module Name: mod_dav.c

Content handlers: yes

Configuration Phase Participation: Create Directory Config, Merge Directory Configs, Create Server Config, Merge Server Configs

Request Phase Participation: Fixups

Module Directives:

DAV - specify the DAV provider for a directory or location

DAVMinTimeout - specify minimum allowed timeout

DAVDepthInfinity - allow Depth infinity PROPFIND requests

Current Configuration:

DavMinTimeout 600

<Location /home/httpd/htdocs>

  DAV On

</Location>

```

Well, i am lost at the moment.

regards 

Thomas

----------

## slartibartfasz

try to create a directory with proper rights:

```

mkdir /home/httpd/htdocs/dav

chown apache:apache /home/httpd/htdocs/dav

```

then add the following to /etc/apache2/conf/commonapache2.conf

```

<Location /dav>

  DAV on

  Order Deny,Allow

  Deny from All

  Allow from 127.0.0.1 <your-ip-here>

</Location>

```

then

```
tail -f /var/log/apache2/error_log

# open a new console/shell

/etc/init.d/apache2 reload
```

now try to access webdav://127.0.0.1/dav in a webdav capable browser and watch the output of the tail at the same time. what does tail say?

----------

## himpierre

Thanks again slartibartfasz. That worked ganz prima  :Smile: 

viele Gruesse

Thomas

----------

## slartibartfasz

 *himpierre wrote:*   

> Thanks again slartibartfasz. That worked ganz prima 
> 
> 

 

cool  :Cool: 

 *slartibartfasz wrote:*   

> ...and watch the output of the tail at the same time. what does tail say?

 

hehe - sometimes i'm really glad that commands like 'tail' are not in german - if english was my mothertongue i would constantly laugh my ass of   :Laughing: 

----------

## himpierre

 *Quote:*   

> 
> 
> hehe - sometimes i'm really glad that commands like 'tail' are not in german - if english was my mothertongue i would constantly laugh my ass of 
> 
> 

 

No! In that case you would laugh your ass of if you hear words like Kartoffelvollerntemaschine.  :Smile: 

thomas

----------

## TheJabberwokk

Thanks

----------

## volumen1

Howdy all... thanks, in part, to this particular thread, I got DAV working on my apache2 server.  I am able to open a DAV share in IE by doing "Open" and then checking the "Open as a Web Folder" checkbox. 

This seems to work well, however, I can't see any files in the root directory of any DAV share.  That is, I can see all the directories under it and I can see all the files in those subdirectories, but I can't access any files whatsoever in the root directory.  This makes it tricky, since I can't access the index.html on any sites.

Is this something wrong in my DAV setup or is it a shortcoming of IE's DAV support?

----------

## panserg

If you don't want any troubles - just use Zope. Every folder in Zope is available through WebDAV (securily of course!). Interestingly, it works faster (at least for Mozilla Calendar client) than Apache WebDAV!

----------

## -=JB=-

Use the wizard in the "my network places" it will give you access to the root files. I had the same problem with that d.. Windows  :Smile: 

----------

## entalment

the information wasn't quite enough for me to get this working so i'm going to post what did it while i'm still so happy it worked

http://httpd.apache.org/docs-2.1/mod/mod_dav.html

talks about 1.3 but works fine for me.

<Location /dav>

Dav On

AuthType Basic

AuthName DAV

AuthUserFile /var/www/localhost/myhtpasswdfile

<LimitExcept GET OPTIONS>

require user admin

</LimitExcept>

</Location>

make sure to make your password file readable to apache chmod 444 and make sure to make it using htpasswd 

this was also useful from above:

<IfModule mod_dav_fs.c>

DavLockDB /var/lib/dav/lockdb

</IfModule>

and of course this in conf.d/apache

-D DAV -D SVN -D DAV_FS

i'm pretty sure SVN is not needed unless you need versioning but it is working now so i'm posting what i have

i also think it would be a good idea to put an ifmodule around that thing up there from the apache website...

good luck

----------

