[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 602
  • Last Modified:

Permissions Issue I cannot seem to resolve

Hi all,

I am seeing this error in my error logs when I attempt to upload a file using webDAV to a folder:

Mon Dec 28 10:32:01 2009] [error] [client 163.153.xxx.xxx] The locks could not be queried for verification against a possible "If:" header. [500, #0]
[Mon Dec 28 10:32:01 2009] [error] [client 163.153.xxx.xxx] Could not open the lock database. [500, #400]
[Mon Dec 28 10:32:01 2009] [error] [client 163.153.xxx.xxx] (13)Permission denied: Could not open property database. [500, #1]

I noticed that my attempted upload did not write anything to the DAV directory (which I believe is what this error is referring to).  The DAV directory is writable by the apache service. Can anyone shed some light on this?  Thanks.
0
Melinda-D
Asked:
Melinda-D
  • 4
  • 2
1 Solution
 
torimarCommented:
This error usually is thrown on WebDAV with shared login when the DAVLock file, that is supposed to manage the shared login, either does not exist or is not writeable by Apache. Most of the time it simply does not seem to exist because it needs to be created by the user during installation.

In principle, the solution is easy: create a lock file and chown it to your apache user:
# touch /some/folder/DAVLock
# chown <your_apache_user> /some/folder/DAVLock

In practise, you need to find out who Apache is run by (users: apache, www-data, wwwrun etc are possible) and you need to decide which folder to use.
Check you httpd.conf file for references to "DAVLock"; if none exist, you are free to create the file wherever you want; if one exists, use the directory specified or check the file referenced. Directories that the file may be or have been created in could be like these:
/var/davlock/
/var/lock/apache2/
/usr/share/apache2/var/

Here's a small reminder (meant for Ubuntu, but the principle is the same):
http://www.nubae.com/webdav-with-ubuntu-and-moodle
0
 
torimarCommented:
For got to mention:
Once you created the lock file, add its location to the httpd.conf file as specified in the link I posted.
Or check this link for more Suse specific advice: http://www.novell.com/coolsolutions/trench/16442.html
0
 
Melinda-DAuthor Commented:
Okay, Apache is running as user wwwrun and as group www.  I checked the httpd.conf file which makes no mention of DAV lock files.  The individual vhost.conf files (located at /srv/www/vhost) do make mention of a DavLockDB.  This is one from a working virtual host:

DavLockDB /srv/www/vhosts/neric.vidupload.neric.org/Dav/
<Directory "/srv/www/vhosts/neric.vidupload.neric.org/httpdocs/">
DAV on
AllowOverride all
#options
AuthType Basic
Authname "DAV Login neric.vidupload.neric.org"
AuthUserFile "/srv/www/vhosts/neric.vidupload.neric.org/pd/d..httpdocs
<LimitExcept GET >
Require valid-user
</LimitExcept>
Order Allow,Deny
Allow from all
Deny from none
</Directory>

<Directory "/">
AllowOverride All
</Directory>

If I do a ls -l on the Dav directory I get this:

-rw-r--r-- 1 wwwrun www 0 Aug 21  2008 .dir
-rw-r--r-- 1 wwwrun www 0 Aug 21  2008 .pag

When I set up the new virtual host I copied all of the permissions exactly from a functioning virtual host and restarted apache of course.  Still no joy.  
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
torimarCommented:
Well, this may make things a little bit more complicated, but the principle is still the same.

- check the vhost.conf file of the problematic server for the DavLockDB
- make sure the DavLockDB setting points to a file (not a folder) that exists
- run a "chown wwwrun.www /file" on that lockfile
- check the permissions for the DAV directory (not the one that holds the lockfile, but the one in the "<Directory "..... > line
- make sure this directory is writable to both owner and group by running "chmod g+w" on it

(As to that last directive, I can't tell whether this would play a part in your permission's issue, but I've mostly seen it done that way)

- restart Apache
0
 
Melinda-DAuthor Commented:
This is the vhost.conf for the site that is not working:

DAVLockDB /srv/www/vhosts/davtest.neric.org/Dav/

<Directory "/srv/www/vhosts/davtest.neric.org/httpdocs/">
DAV on
AllowOverride all
#options
AuthType Basic
AuthName "Webdav Authoring"
AuthUserFile "/srv/www/vhosts/webdav.neric.org/pd/d..httpdocs
<LimitExcept GET>
Require valid-user
</LimitExcept>
Order Allow,Deny
Allow from all
Deny from none
</Directory>

<Directory "/">
AllowOverride All
</Directory>

One thing I am confused about is what should be in the Dav directory.  I see that there are two files: .dir and .pag.  Are those the lock files?  Is that what it should look like?  In the non-working site I created those in an attempt to match what was in a working site, but I am wondering if I messed myself up by doing that.  
0
 
torimarCommented:
The lock file is any empty file whatsoever that you declare to be the lock file.
I assumed that this would result from what I said in my comments; sorry if it didn't.

Please create a file (lets call it "lock") inside the directory:
# touch /srv/www/vhosts/davtest.neric.org/Dav/lock
# chown wwwrun.www /srv/www/vhosts/davtest.neric.org/Dav/lock

Then modify the line in vhost.conf to:
DAVLockDB /srv/www/vhosts/davtest.neric.org/Dav/lock

Save and restart Apache.
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now