Pegasus 2.7
Contents- 1.0.0 For those who are new to Pegasus
- 2.0.0 Pegasus 2.7
- 2.1.0 Changes in specification
- 3.0.0 WebDAV script
- 3.1.0 WebDAV script is written in Lua
- 3.1.1 The advantages
- 3.2.0 You need ...
- 3.2.1 source
- 3.2.2
/usr/web/bin/rc/webdav
- 3.3.0 Configurations
- 3.3.1
/sys/lib/httpd.conf
- 3.3.2
$web/log/webdav.log
- 3.3.3
$web/._.locktokens
- 3.3.4
$web/etc/handler
- 3.3.5
$web/etc/passwd
- 3.4.0 Tested clients
- 3.4.1 OSX 10.8/10.9
- 3.4.2 Windows
Pegasus 2.7 is released with new WebDAV script written in Lua-5.2.
The sources are in
http://plan9.aichi-u.ac.jp/netlib/pegasus/
and
http://plan9.aichi-u.ac.jp/netlib/lua/
For those who are new to Pegasus
For those who are new to Pegasus, the installation instructions for Pegasus 2.7 are provided.
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, Pegasus 2.5, and Pegasus 2.6
Pegasus 2.7
Changes in specification
some of configuration parameters in/sys/lib/http.conf
are gone.They are
- allowbasic
- maxaccess
- connectlimit
Pegasus 2.7 introduced new protection scheme so that it keeps server response to the legitimate clients.
Authenticated client will not be affected by the protection.
This scheme is necessary to support WebDAV because WebDAV client needs vast numbers of accesses in a second.
WebDAV script
WebDAV script is written in Lua
The advantages
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
You need ...
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.
You need:
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/
/usr/web/bin/rc/webdav
The following statement in the file webdav
controls taking log:LOG = io.open("/log/webdav.log","a") -- uncomment if you need logIf you don't want log change the line to
-- LOG = io.open("/log/webdav.log","a") -- uncomment if you need logbut if you want:
LOG = io.open("/log/webdav.log","a") -- uncomment if you need log
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
".
/sys/lib/httpd.conf
Current configuration parameters are listed below.
# # Remove "#" to set your value if you want to change default vaue # Note that # 1. second field is default value except "myname" # 2. all unit of time is second # # # files for Pegasus # # base /usr/web # base directory for Pegasus # namespace /lib/namespace.httpd # name space configuration # rewrite /sys/lib/httpd.rewrite # system rewrite file # # currently we have the following parameters that may be required tuning # charset utf-8 # HTTP header charset specification. The default is latin(iso-8859-1) ## allowbasic 0 # obsolete # parsetimeout 15 # timeout to parse header (in unit of sec) # waittimeout1 15 # wait timeout for an non-authenticated client # waittimeout2 900 # wait timeout for an authenticated client # alivetimeout 15 # keep alive timeout (in unit of sec) cgitimeout 20 # timeout for CGI (in unit of sec) # posttimeout 900 # timeout to get POST data (in unit of sec) ## connectlimit 300 # obsolete # maxpost1 10 # maximum post data size (in unit of MB) for unauthorized client # maxpost2 100 # maximum post data size (in unit of MB) for authorized client # maxconnect 50 # default: max connections by a single remote IP #maxconnect 0 # if 0, disable max connections check # obstime 3 # observation time to detect burst access (in unit of sec) ## maxaccess 20 # obsolete # lockouttime 180 # lockouttime for maxconnect (in unit of sec) # contmax 100 # max persistent continuation count for safty
$web/log/webdav.log
Make a directory $web/log
if you take a log. It must be writable by user web
.
$web/._.locktokens
You 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/handler
If you want to mount $web/doc
onto your local computer with server addresshttp://host/davthen the following lines are required.
/dav - * /bin/webdav /dav /doc /dav/* - * /bin/webdav /dav /docYou 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".
Tested clients
I am afraid that my testing is not enough.Please email to me if you found bugs.
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.
Windows
I haven't tried webDAV on Win7 and Win8 yet.
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.
WinXP and Win2000 should work as has been.