I think you'll have to abandon the POSIX requirement, very few systems implement that - in fact even NFS doesn't really (think locks etc) and that has no redundancy.
Any system which uses synchronous replication is going to be glacially slow; any system which has asynchronous replication (or "eventual consistency") is going to violate POSIX rules and not behave like a "conventional" filesystem.
It's rather a pity that Apache's config isn't as flexible as nginx's, so you could do something like:
Alias /dav /path/to/dav/store/$REMOTE_USER
However, you can use REMOTE_USER
in a rewrite rule, like so:
RewriteEngine On
RewriteRule ^/dav(.*)$ /__davinternal/%{LA-U:REMOTE_USER} [PT]
Then put all your auth/DAVish loveliness into a <Location /__davinternal>
and bob's your auntie's live-in lover.
This works great if you've got consistent locations in your filesystem for all your users (say /path/to/dav/store/<username>
); if you've got user folders scattered across the filesystem (with a mapping in MySQL), you can still map your user locations, but you've got to use a RewriteMap
:
RewriteMap davdirs txt:/path/to/user/dir/map.txt
RewriteRule /^dav(.*)$ /__davinternal/${davdirs:%{LA-U:REMOTE_USER}}
You can do a RewriteMap straight out of MySQL (via an external script), but I'd try and get my app to update a dbm file whenever that mapping information changed and use a dbm map instead -- much better performance, and doesn't hammer your database into the ground.
I've not covered the security implications of these setups in this answer, partially because I'm not entirely sure myself, and because I don't know what your exact security policy might be.
Best Answer
I was able to use wdfs to make it work as a non priv. user:
To unmount
wdfs is from here and uses fuse. I use Archlinux and this AUR package worked fine.
But current state of wdfs is unclear, there is a kind-of-fork lurking at gihub as well.