![]() |
![]() |
ETag="" in CGI
"#DEBUG:..." in CGI
$web/etc/namespace has gone
/usr/web/bin/rc/webdav.lua
/sys/lib/lua
$web/log/webdav.log
$web/._.locktokens
$web/etc/handler
$web/etc/passwd
2009/02/01
Pegasus 2.6 is released with new WebDAV script written in Lua.
The sources are in
http://plan9.aichi-u.ac.jp/netlib/pegasus/
and
http://plan9.aichi-u.ac.jp/netlib/webappls/webdav_lua/
For those who are new to Pegasus, the installation instructions for Pegasus 2.6 are provided.
Concept of Pegasus is explained in the document "Pegasus — another httpd for Plan 9 —", and you will find other manuals in ver.2.2 documents. Most of them are kept unchanged.
Pegasus is a flexible httpd server. If you want to know more about current Pegasus, you need to read changes after Pegasus 2.2. These changes are in the documents: Pegasus 2.3, Pegasus 2.4, and Pegasus 2.5
ETag="" in CGIrefrain ETag response header if CGI gives ETag="" in HTTP header.
"#DEBUG:..." in CGIIf CGI put "#DEBUG:..." in headers, the value will be put to log file.
$web/etc/namespace has gonePegasus had certain restriction in $web/etc/namespace. I found that it is better to remove the restriction.
Pegasus had a bug in receiving files in chunk format. OSX 10.5 began to use the format in PUT method. The bug is fixed.
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:
Lua interpreter is 20 times smaller than Perl as shown below.
--rwxr-xr-x M 1438298 arisawa sys 594852 Jan 25 00:06 /bin/lua --rwxrwxr-x M 1438298 bootes sys 9609130 Nov 25 2002 /bin/perl
Corresponding stripped sizes are:
--rwxr-xr-x M 1438298 arisawa arisawa 235922 Jan 31 14:06 /tmp/lua --rwxrwxr-x M 1438298 arisawa arisawa 4548970 Jan 31 14:06 /tmp/perl
I added some codes to support WebDAV. Original size of lua is 6% (for un-stripped) and 8% (for stripped) smaller than above values. Code size is critical in case WebDAV is implemented on script.
Note*: The performance comparison is shown at:
Look http://plan9.aichi-u.ac.jp/netlib/webappls/webdav_lua/
You will find there:
lua-5.1-p9ext.tgz
webdav.lua
libp9.lua
libxml.lua
libdav.lua
lua-5.1-p9ext.tgz is plan9 extension of /n/sources/contrib/iru/lua-5.1-plan9.tgz
Thanks Iruatã
You need:
lua # Lua interpreter with extension for webdav
/386/bin/ or /usr/local/bin/386/
webdav.lua
/usr/web/bin/rc/
chmod 755 webdav.lua
libp9.lua
/sys/lib/lua
libxml.lua
/sys/lib/lua
libdav.lua
/sys/lib/lua
/usr/web/bin/rc/webdav.luaThe following statement in webdav.lua controls taking log:
LOG = io.open("/log/webdav.log","a") -- uncomment if you need log
If you don't want log change the line to
-- LOG = io.open("/log/webdav.log","a") -- uncomment if you need log
but if you want:
LOG = io.open("/log/webdav.log","a") -- uncomment if you need log
/sys/lib/luaIn the explanation below, $web is a httpd root* of a user, and host stands for "host", "host:port" or "host/~user".
$web/log/webdav.logMake a directory $web/log if you take a log. It must be writable by user web.
$web/._.locktokensYou need $web/._.locktokens if you want to mount $web/doc onto your local computer.
More generally you need $web/path/._.locktokens if you want to mount $web/path/foo, where path is any path and foo is a directory name.
The directory "._.locktokens" must be writable by user web.
$web/etc/handlerIf you want to mount $web/doc onto your local computer with server address
http://host/dav
then the following lines are required.
/dav - * /bin/webdav.lua /dav /doc /dav/* - * /bin/webdav.lua /dav /doc
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/passwdProtect your WebDAV by password. My example is
arisawa 312fc1ad084e60da3d1fbbc3b6ad687a /dav arisawa@hera
where arisawa@hera is my realm.
I am afraid that my testing is not enough.
Please email to me if you found bugs.
OSX client is slow because of incredibly stupid behavior of the client.
There are many issues on this subject in the Internet.
You need to adjust parameters in /sys/lib/httpd.conf if OSX client suddenly lost server side information. The candidate is maxconnect and maxaccess. Look /sys/log/blacklist to find which parameter makes the problem.
Note:
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. The huge amount of accesses might make Pegasus busy state. Then you need to loosen maxconnect and/or maxaccess.
OSX 10.4 should work as has been.
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@hosts
in your user name.
WinXP and Win2000 should work as has been.