Followed https://httpd.apache.org/docs/2.4/mod/mod_dav.html˙(and a few
other places). I have read access to my /dav/ folder, but when I
attempt to write, I get:
```
The locks could not be queried for verification against a possible
"If:" header.˙ [500, #0]
Could not open the lock database.˙ [500, #400]
APR does not understand this error code: [client X.X.X.X:XXXX] Could
not open database.˙ [500, #1]
```
What do you set for DavLockDB ?enabled
Please provide your apache conf for your host and for dav* mods which are
My webdav.conf mostly copies the Apache WebDAV documentation:
Define _WEBDAV_URI /webdav
Define _WEBDAV_FOLDER /var/www/html/webdav
Alias ${_WEBDAV_URI} ${_WEBDAV_FOLDER}
DavLockDB ${_WEBDAV_FOLDER}/DavLockDB
DAV on # I'm led to believe this is all that's _necessary_AuthType basic
˙Where do you put this webdav.conf ?/etc/apache2/sites-enabled/webdav.conf
˙Could you provide ls -l /etc/apache2/mods-enabled/dav*lrwxrwxrwx 1 root root 29 Jan 31˙ 2023 /etc/apache2/mods-enabled/dav_f
˙Could you provide˙cat /etc/apache2/mods-enabled/dav*DAVLockDB ${APACHE_LOCK_DIR}/DAVLock
˙Could you provide ls -ld /var/www/htmldrwxr-xr-x 1 root root 32 Mar˙ 1 17:49 /var/www/html
Could you provide ls -ld /var/www/html/webdavdrwxrwxrwx 1 www-data www-data 20 Mar˙ 1 18:07 /var/www/html/webdav/
Could you provide ls -l /var/www/html/webdav/DavLockDBls: cannot access '/var/www/html/webdav/DavLockDB': No such file or directo
Could you provide ls -l /var/www/html/webdav/user.passwd# ditto. Nobody creates it.
˙I suppose AuthType is on a separate line ?Yes, sorry. Strictly speaking though, the documentation doesn't say what di fference it makes. The documentation leads me to believe that I can set up
/apache2/modules/mod_dav.so˙Could you provide˙cat /etc/apache2/mods-enabled/dav*DAVLockDB ${APACHE_LOCK_DIR}/DAVLock
# Depends: dav
LoadModule dav_fs_module /usr/lib/apache2/modules/mod_dav_fs.so
<IfModule !mod_dav.c>
˙˙˙˙˙˙˙ LoadModule dav_module /usr/lib
</IfModule>apache2/envvars:
LoadModule dav_lock_module /usr/lib/apache2/modules/mod_dav_lock.so
In case it makes a difference, APACHE_LOCK_DIR appears to be set in /etc/
export APACHE_LOCK_DIR=/run/lock/apache2$SUFFIX
˙You redefine DavLockDB in your webdav.conf withfs.conf
DavLockDB ${_WEBDAV_FOLDER}/DavLockDB
So remove this line from your webdav.conf to use DavLockDB from˙dav_
Needless to say, it still doesn't work with this change enacted. As a reminder, apache2/error.log reads:
[dav:error] [pid Y:tid Y] [client 127.0.0.1:46XXX] Unable to PUT new contents for /webdav/test-text-file.txt.? [500, #0]
[dav:error] [pid Y:tid Y] (30)Read-only file system: [client 127.0.0.1:46XXX] An error occurred while opening a resource for writing: /var/www/html/webdav/test-text-file.txt.? [500, #0]
Needless to say, it still doesn't work with this change enacted. As a reminder, apache2/error.log reads:
[dav:error] [pid Y:tid Y] [client 127.0.0.1:46XXX] Unable to PUT new
contents for /webdav/test-text-file.txt.˙ [500, #0]
[dav:error] [pid Y:tid Y] (30)Read-only file system: [client
127.0.0.1:46XXX] An error occurred while opening a resource for
writing: /var/www/html/webdav/test-text-file.txt.˙ [500, #0]
˙Assuming you didn't actually mount this file system read-onlyIt's my root partition, so I'd have a lot more symptoms if that were the ca
˙Check the systemd unit$ systemctl list-units | grep -i dav
and the /etc/apparmor.d/ directory$ ls /etc/apparmor.d
˙But it fixes the lock error we begin with.Somewhat. We already know that Apache cannot write to /var/www/html/webdav
˙To make sure it is the problem please provideWorks. I can read and write whatever I want wherever I want from bash. Just
sudo -u www-data touch /var/www/html/webdav/newtest
ps aux|grep apache```
ls -ld /var/www/html/webdavdrwxrwxrwx 1 www-data www-data 38 Mar 13 16:07 /var/www/html/webdav
ls -al /var/www/html/webdav/total 4
$ systemctl cat apache2...
```
# /usr/lib/systemd/system/apache2.service
ProtectSystem=full...
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
ProtectProc=invisible
ProcSubset=pid
ReadWritePaths=-/var/log/apache2 ReadWritePaths=-/var/cache/apache2/mod_cache_disk
Somewhat. We already know that Apache cannot write to /var/www/html/webdav , so trying to put the DBLock file there won't work. The fix, not that I'm complaining, relocated the DBLock file to a directory where Apache can write, but it has yet to explain why /var/www/html/webdav *isn't* writeable.
But I think we established that Apache *can* write to some directories (like /var/log/apache2/). Just not that one.
ls -ld /var/www/html/webdavdrwxrwxrwx 1 www-data www-data 38 Mar 13 16:07 /var/www/html/webdav
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 5 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 119:49:23 |
| Calls: | 125 |
| Calls today: | 125 |
| Files: | 489 |
| D/L today: |
859 files (365M bytes) |
| Messages: | 76,568 |
| Posted today: | 26 |