Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Symbolic links are a widespread practice on linux to make a ressource (e.g. directory) available in another location without having to maintain several copies of it. This is implemented in many applications, e.g. having a ressources tree and a tree with user directories: Whenever a user is intended to work with a certain ressource, a symbolic link is placed into the directory he or she has access to. Given sufficient permissions, he or she can work with the ressource (create files in it) which may physically be written onto a different location, e.g. on a device with sufficient space. This works fine if the user accesses his home directory using Samba.

However, there are good reasons to work with WebDAV instead, port issues are one of them. The problem when porting such an application to WebDAV: Apache’s mod_dav is written in a way symbolic links are not exposed, no matter wether FollowSymLinks is set. This behaviour is intended by the communtiy, therefore a bug report was never tackled.

However, how can the desired behavior be ported to WebDAV? I tried to use hard links instead, but hard linking a directory seems not to work at all. Using mount might work, but I cannot estimate the side effect of hundreds of mounts. Is there an option I didn’t come over by now? Is there a known “best practice”? Or does WebDAV simply not fit as a replacement for Samba?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

It seems to be that mount --bind is the solution I was looking for. There are reasons for and against the usage of ln -s vs mount --bind, but it seems to be common practice to mount a device several times on linux systems (even mounting single files onto other files is encouraged in man mount) and it seems that system stability isn’t seriously affected.

Only sowbug is of course that, if mount points are not fixed by modifying /etc/fstab, they will get lost upon server restart.

One more word to WebDAV: There was an internet draft (which has expired meanwile) to extend the WebDAV specification in order to allow “advanced collections”, which should offer the capability of handling links, too. Work was spent on that question in about 1998—2002, then the toppic disappeared silently. You might find several pages on the internet claming that WebDav supports symbolic links by means of advanced collections, but currently, this is not the case. Current (v.1.0.3-1.3.6) mod_dav source code reads:

/* ### for now, only process regular files (e.g. skip symlinks) */
if (S_ISREG(fsctx->info1.finfo.st_mode)) {

One might expect that the Tomcat 6’s WebDAV module could be unaware of symbolic links (as, afaik, awareness of such file system special stuff wasn’t incorporated into the Java model before version 7), but it shows the same behaviour, thus conforming to the specification, too.

Last, a symlink patch for mod_dav-1.0.3-1.3.6 has been published, but you will have to apply the patch onto the source code and compile the module yourself … I didn’t try that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.