Implementing True WebDAV Homedirs?
"Apache has mod_dav, which seems to be primarily designed to provide a single shared space to files, where the Apache process user has read/write access. mod_auth_digest doesn't seem to be usable at the same time as mod_auth_shadow. It would appear that the only way to 'properly' do what I want to do would be to run Apache as root(!), have vhosts for every user (webdav.username.domain.com), have Apache change to that user's uid and gid before enabling webdav for their home directory, and then use basic authentication instead of digest authentication.
Is anyone out there trying this? Has Anyone used Jigsaw, kirra-httpd or even the no-longer-available MoulDAVia in a production environment? What are you using to provide non-trivial, safe WebDAV services?
I know I can use something like a restricted SCP- and SFTP-only shell, like scponly and rssh, but again, I'd prefer WebDAV as it wouldn't require the end user to install a client
application."
You've pretty much hit the nail on the head when it comes to correct file permissions and remote access to folders under apache.
The only way to really achieve it is to allow apache to set(e)uid to the user who you want it to be running as. I extended mod_become for our internal use here, and it works ok, but yes, you need to run apache as root to achieve this. I wouldn't want to go exposing it to the world-at-large.
We do something very similar to this for AFS access, using a module called "web aklog". aklog is an AFS tool for giving a process group "tokens" to talk to AFS servers on behalf of the user. The concept of "root" is meaningless in AFS, so this is a pretty secure methodology. Doesn't really help if you're trying to serve the local filesystem, tho.
:w
Have you looked at any of the tools from Novell? They've invested a fair amount of effort in WebDav, they've transitioned to Apache, and NetWare 7 promises to run on a Linux kernel.
Plus, they're the only shop in the bidness with a robust, distributable, replicatable, dynamically inheritable directory service [without which they would've long since ceased to exist].
Roll Your Own. It will have to run as root, but it could change the userid as required.
It's kind of a nasty hack, but won't this work?
??Could you couple WebDAV with SSH to achieve the requisite security?
- Vincit qui patitur.
WebDAV is supported as Web Folders in Windows, meaning there is no need to download and install SFTP, SCP, FTPS, and other clients. It's also supported natively in Mac OS X
:p.
Somethings to watch for: Windows 2000 SP2 had some issues with the mod_dav/mod_ssl combination we're running (uploads failed). Upgrading to SP3 fixed that problem.
Windows makes it a royal pain in the ass if you are planning on using self-signed certificates. I just couldn't figure out how to make IE accept self-signed CA certs. After literally years of seeking this information, I've finally found a solution this past week. This is something you have to consider for your users if you're going to use SSL with self-signed certs: how much can they take the constant popup cert warnings and how happy will they be about going through a 8 step process to get rid of it. Either way: poor user experience, which makes it hard for me to convince my users that DAV is a good thing (they're used to FTP).
OSX natively supports DAV but unless something has changed recently, it does NOT natively support DAV over SSL. You need Goliath for that. At least Goliath has a single "Accept this certificate permanently?" button that actually does what it advertises
I have to say I feel your pain. I'm not trying to do something as ambitious as you (I just wanted something to replace FTP for users that wanted to share files with other users outside of our network), but I've still been frustrated with trying to get the authentication business worked out with different directories having different sets of users that can access them, some with read/write and some with read-only.
To be honest, I've recently started to re-evaluate using DAV for our needs. It just hasn't been as flexible as I had hoped.
-h3
But this doesn't address the file permissions. If you're running apache as user www, then at the file system level you won't have the correct access to homedirs.
:)
You need some way to make apache spawn a fork as the user in question so that you limit access to that available to that user.
Phew, that was terse
Surprisingly, even though they had a pretty big hand in publishing the WebDAV standard, Microsoft's implementations are pretty poor. Depending on whether or not certain other packages are installed (mostly anything that talks Frontpage), and service release levels, there are several different sets of behaviors/bugs you can encounter with the Web Folders implementation.
In one project I was working on, the DLL driving Web Folders would freeze up Explorer, on a couple of different XP boxes. Frozen. You had to log out to clear it up.
You might want to consider a hybrid approach anyway. WebDAV isn't really a stellar performer, nor is it really designed to be. Why not do Samba, WebDAV, Netatalk, and NFS?
you could set up a folder in each users homedir that is accessable by webdav.
/var/www/homedir/user1
/var/www/homedir/user2
/var/www/homedir/user3
/home/user1/dav /var/www/homedir/user1
set up a webdav folder and give each user their own dir
chown it www chgrp webdavusers
ln -s
And viola, roberts your fathers brother
Is that even possible?
.Mac services, but .Mac doesn't try to fit the square peg of UNIX user/groups into the round peg of WebDAV. It utilizes individual users as the entire security paradigm. It's not nearly as sophisticated, but it could work.
I mean, I can see this actually working if you do something like rsync between two servers or sync two directories, one preserving file ownerships a la the UNIX security paradigm, one owned by webserver, using WebDAV security.
The shortcoming here is that you couldn't use groups very easily, but you could work around this without too much difficulty.
WebDAV was never meant to mirror the UNIX user/group paradigm. I think as close as you can get is the Apple
I don't know, but when I think about it, forking httpd as arbitrary users seems like a security nightmare.
Notes From Under *nix: blas.phemo.us
apache 2 supports prechild MPM: "Multi-Processing Module allowing for daemon processes serving requests to be assigned a variety of different userids" Here is link: perchild It solves your uids permission part of a problem.
Have you looked at WebRFM? It seems old and abandoned (home page gone, mirror remains) but they implemented it on a server at my uni just this year. The "visible" part of WebRFM is web-based file browser but this does include the code to get the per-user stuff happening. Here's the relevant bit from the web page:
"WebRFM implements a virtual-root mechanism, such that each user's access is restricted to his own area (home directory, by default), and it is designed to run in the user's security context (UID/GID) such that OS-based access control and quota limits are also being imposed. A special setuid wrapper to enable this is included. Other wrappers (such as the Apache suEXEC wrapper) can also be used."
You could try Apache 2.0 with perchild MPM which allows requests to be served under arbitrary user ids... (no suid,suexec crap)
It's 10 PM. Do you know if you're un-American?
Just curious why you chose WebDAV over Samba/Netatalk for doing this.
If you are using samba, you might want to try using davenport. Davenport offers a read only listing of files in your browser and permits read/write via webdav. davenport converts webdav requests to smb requests via the jcifs project. Davenport is a java servlet.
davenport.sourceforge.net
Yeah, it likely is a nightmare.
It's too bad that HTTP/dav is so limiting, because it is a pretty useful tool. Well supported and fairly cross-platform. Not to mention Adobe's integration into Photoshop and Illustrator (or Macromedia's integration into Dreamweaver and Fireworks).
I believe that this could be done on a mass issue with mod_rewrite and mpm_perchild_module
remapping the hostnames into virtual server directives with the correct mpm_perchild module settings via the hostname.
You could tie this up to your favourite directory service, ( mod_ldap ) and things should be sweet.
Im not a mod_rewrite master, but im sure it can be done.
has a filemanager with user/group permissions www.phpgroupware.org
Check out Novell NetDrive. It's available as a free download right here support.novell.com/servlet/filedownload/uns/pub/ne tdrv41.exe/ and allows you to mount FTP servers, WebDAV shares, and iFolders as local Windows drives.
/var/www/html/share] /etc/htpasswd
Works with 98, 2K, and up and allows you to control caching, supports SSL, etc.
Here's a clip that I used to get WebDAV to work while testing. Only use this as a _starting point_ -- I wouldn't trust its security setup for live usage without some tweaking/checking.
-- Replace [ and ] with greater-than/less-than:
[Directory
Dav On
Options Indexes
AuthName "password_required"
AuthUserFile
AuthType Basic
AllowOverride None
order allow,deny
Allow from all
[Limit HEAD GET PUT POST OPTIONS CONNECT DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK]
Require user jsmith
[/Limit]
[/Directory]
-- Then just have a WebDAV client open up whatever URL points to that specific directory.
It's not a bad setup, the FTP mount is actually pretty decent here also.
Send me an email privately if you have any issues.
Jason
the WebDAV server is separately maintained from the regular server, and is a revision or two behind. Maybe it's usable, but it's not the target of their main development efforts, it appears.
--Matthew
well, disregard that... it looks like the WebDAV support was rolled in.
--Matthew
You're mixing authentication (identity) with authorization (privilege). Read up on Apache::Authen vs Apache::Authz . You can intercede arbitrary access control modules (via the C or Perl APIs), before any content handling module (incl. DAV).
Brown has documented an elaborate system.
Netware fully supports WebDAV protocol to access their file shares on the Netware Servers. They use mod_dav+Apache for providing the access. There is a elaborate GUI to control access.
I use Apache+mod_dav on a Linux server, which authenticates against a LDAP server. I dont use mod_digest, but I do everything over https:// so no need for mod digest. We have been using this for last 2 years, wwithout any issues. Very successful too. http://www.xml-dev.com/xml/photo/
Consensus is good, but informed dictatorship is better