WEBDAV
目次- 1.0.0 WebDAV script
- 1.1.0 Lua WebDAV script
- 2.0.0 Installation
- 2.1.0 Source
- 2.2.0 Installation
- 2.3.0 webdav log
- 3.0.0 Configurations
- 3.1.0
$web/etc/handler
- 3.2.0
$web/etc/passwd
- 4.0.0 Permission Setting
- 5.0.0 Tested clients
- 5.1.0 OSX
- 5.1.1 OSX 10.8/10.9
- 5.1.2 OSX 10.5
- 5.2.0 Windows
- 5.2.1 Win2000
- 5.2.2 WinXP
- 5.2.3 Vista
WebDAV script
Lua WebDAV script
WebDAV script for Pegasus is in http://plan9.aichi-u.ac.jp/netlib/lua/.
The name is "webdav" which is written in 9lua. (Lua with plan9 extension)
The WebDAV works for Mac/OSX, WinXP and optionally for Win2000. I have not examined other type of clients yet.
Win2000 client requires dirty codes in Pegasus. Therefore Win2000 support is only enabled by a compilation option
-DWIN2000DAVPegasus that compiled under this option will lose some of simple logical structure stated in this document.
You can use Digest authentication. Of course, you may not use authentication for debugging purpose.
My old WebDAV script was written in Perl. In releasing Pegasus 2.6, I have rewritten the script in Lua, because we have big advantages if we switch the scripting language from Perl to Lua:
- much better readability
- much easier programming
- much smaller interpreter
- much better performance
Installation
Source
Look http://plan9.aichi-u.ac.jp/netlib/webappls/webdav_lua/You will find there:
9lua-5.2
lua-5.2
webdav
libp9.lua
libxml.lua
libdav.lua
9lua-5.2
is plan9 extension of Lua-5.2.
Installation
9lua
— Lua interpreter with extension for webdav
location:/usr/local/bin/386/
webdav
location:/usr/web/bin/rc/
You need:chmod 755 webdav
libxml.lua
location:/usr/local/lib/lua/5.2/
libdav.lua
location:/usr/local/lib/lua/5.2/
webdav log
The following line in /usr/web/bin/rc/webdav controls webdav log.
-- LOG = io.open("/log/webdav.log","a") -- uncomment if you need logIf you want remove "
--
" at the beginning of the line.
The log is located at $web/log. ($web is your httpd root)
NB:
/log/webdav.log
may grow to huge size. So it is wise to comment out unless you need debugging.
Configurations
In the explanation below, $web
is a httpd root of a user, and host
stands for "host
", "host:port
" or "host/~user
".
$web/etc/handler
/dav - * /bin/webdav /doc /dav/* - * /bin/webdav /doc
NOTE: handler interface is simplefied in webdav 1.3
The old one was
/dav - * /bin/webdav /dav /doc /dav/* - * /bin/webdav /dav /doc
Then your files in document space can be mounted as remote file system with URL:
http://your.host.com/dav/
You may replace "/dav
" by other "/bar
" and likewise you may replace "/doc
" by "/path/foo
". Thus you may have WebDAV storage out of document root.
$web/etc/passwd
Protect your WebDAV by password. My example isarisawa 1ecdd023fbd3c3fe8f63b05827c0d38a /dav arisawa@herawhere
arisawa@hera
is my realm and the md5 value is obtained byecho -n 'arisawa:arisawa@hera:black cat' | md5sumfor password "
black cat
".
Permission Setting
You need to make all files and directories in your document space readable/writable (and also executable for directories) for user web
.
I recommend you to use WebDAV only in your home network. The reason is
(1) security
(2) net work band width
Tested clients
I am afraid that my testing is not enough.Please email to me if you found bugs.
OSX
OSX 10.8/10.9
OSX client of old version was slow because of incredibly stupid behavior of the client.
Now Apple has fixed this problem. Current WebDAV on Mac is acceptable level.
OSX 10.5
OSX client is slow because of incredibly stupid behavior of the client.
There are many issues on this subject in the Internet.
OSX client does not make use of informations returned from
PROPFIND
request with Depth:1
except names in the collection. After the request, the client continues PROPFIND
requests to all names in the collection although the client already has received requesting information. Thus, if a collection has 100 files then 100 PROPFIND
requests continue in a short time.
OSX 10.4 should work as has been.
Windows
I haven't tried webDAV on Win7 and Win8 yet.
Win2000
You need compilation option:-DWIN2000DAV
WinXP
Due to a bug of WinXP, you need a trick in creating web folder: a mark "?" at the end of URI. The example is shown below.http://host/dav?
Vista
The explanation below is for WinVista.
You need "Software Update for Web Folders (KB907306)" so that Vista WebDAV client gets to work.
Microsoft gave up to support WebDAV as a file system in Vista. The design is degraded from that of WinXP.
However some things are improved:
(1) you need not "?
" magic such as
http://host/dav?in creating "Network Place".
If you put "
?
" then Vista fails in creating Network Place.
(2) you need not host name "@host
" such as
alice@hostsin your user name.