# Apache2 & WebDAV Troubles [Resolved]

## VinnieNZ

I have been trying to get WebDAV and Apache2 to work for quite some time now, and I think I'm pretty close now, but just can't quite get there.

When I try to publish a file from Sunbird to the webdav server http://127.0.0.1/dav/test.ics it asks me for username and password as it should and then tries to put the file.  I get the following in the error_log:

```
[error] [client 127.0.0.1] The locks could not be queried for verification against a possible "If:" header.  [500, #0]

[error] [client 127.0.0.1] Could not open the lock database.  [500, #400]

[error] [client 127.0.0.1] (13)Permission denied: Could not open property database.  [500, #1]
```

The 45_mod_dav.conf has /var/lib/dav/locksdb as the dav database listed and I've been through and checked that the file and directories permissions are set so that it is at least readable by everyone.

I noticed that when I originally started that the /var/lib/dav/locksdb file never existed.  I've tried doing a 'touch /var/lib/dav/locksdb' to create the file but it never gets filled.  When the file is non-existant it never gets created (either on Apache startup or when you try to access the WebDAV server).

Does anyone have any ideas or want more info to be able to help me.

ThanksLast edited by VinnieNZ on Mon Jan 24, 2005 2:23 am; edited 1 time in total

----------

## Petyr

You probably need to chown the file to apache:apache

I think that just because it's readable by everyone isn't enough. Apache wants to be able to write the file, and it seems that it doesn't have permissions to do so.

hth,

Petyr

p.s. Submit a bug report, the ebuild should have auto-created that file and set it up correctly...

----------

## VinnieNZ

Gave that a try and even modded the file +0777 and still no luck.

I notice that there is a new version of apache under ~x86 so since this isn't a production server I will try that and see if it helps any.

----------

## VinnieNZ

Still no luck with this.  The new install didn't create the file so I once again created and changed the ownerships to apache:apache and +rwx'd it and it still produces the same error.

I've ensured that the line in the apache module is pointing at the lockdb file that I've created but it still doesn't seem to be able to read/write to it

----------

## VinnieNZ

Finally a break through.

I had to add the lockdb file to /var/lib/dav/lockdb and chown it to apache:apache and chmod it to +0666.

I also had to make sure the permissions for the /var/lib/dav directory were also set to chmod +0666.

This got rid of the errors and started things working correctly.

----------

## OneInchMen

VinnieNZ, Could you post your apache2/webdav configuration files and the steps needed to accomplish this? (or in one word: "howto")

I just started to look how to do this on Gentoo, but I haven't found any help in the forums yet...

Thanx, Harold.

----------

## TheAmazingRando

To get this working you only need to create the directory and chown it

as root:

```

mkdir /var/lib/dav

chown apache: /var/lib/dav

```

mod_dav knows to make the file if it doesnt exist. I've submitted this as an ebuild bug

https://bugs.gentoo.org/show_bug.cgi?id=92181

----------

