publishing repositories with mod_dav
DESCRIPTION
Publishing Repositories with mod_dav. Greg Stein CollabNet, Inc. [email protected], http://www.lyra.org/greg/. Agenda. WebDAV introduction mod_dav introduction The mod_dav API for backends Example: mod_dav_fs Example: mod_dav_svn Future. WebDAV Introduction What is it? (1 of 2). - PowerPoint PPT PresentationTRANSCRIPT
July 24, 2002 O'Reilly Open Source Convention 1
Publishing Repositories with mod_dav
Greg SteinCollabNet, Inc.
[email protected], http://www.lyra.org/greg/
July 24, 2002 O'Reilly Open Source Convention 2
Agenda
• WebDAV introduction
• mod_dav introduction
• The mod_dav API for backends– Example: mod_dav_fs– Example: mod_dav_svn
• Future
July 24, 2002 O'Reilly Open Source Convention 3
WebDAV IntroductionWhat is it? (1 of 2)
• Web-based Distributed Authoring and Versioning– “DAV” is the usual short form
• Goal: enable interoperability of tools for distributed web authoring
• Turns the Web into a writeable medium
July 24, 2002 O'Reilly Open Source Convention 4
WebDAV Introduction What is it? (2 of 2)
• Applies to all kinds of content - not just HTML and images
• Based on extensions to HTTP
• Uses XML for properties, control, status
• RFC 2518 and RFC 3253
July 24, 2002 O'Reilly Open Source Convention 5
WebDAV IntroductionScenarios
• Collaborative authoring
• Network file system
• Remote software engineering
• Unified repository-access protocol
July 24, 2002 O'Reilly Open Source Convention 6
WebDAV Introduction Some Tools and Clients
• Open source– Joe Orton’s sitecopy and cadaver– Nautilus (gnome-vfs), KDE (kio)– Subversion– Python, Perl, C, Java client APIs
• Commercial– MacOS X, most Adobe and Microsoft products– Dreamweaver and other authoring tools
• Lots of (commercial) DAV servers
July 24, 2002 O'Reilly Open Source Convention 7
mod_dav Introduction
• mod_dav is an Apache module
• Separate module for Apache 1.3
• Integrated into Apache 2.0
• On June 1, securityspace.com reported 171505 sites using mod_dav (6th most popular Apache module)
July 24, 2002 O'Reilly Open Source Convention 8
mod_dav Introduction
• mod_dav has an API for a “pluggable back-end repository”
• Default repository uses the native filesystem
• Oracle and ClearCase are shipping products using mod_dav with custom back-ends
July 24, 2002 O'Reilly Open Source Convention 9
mod_dav Back-ends
• Sometimes called “providers”
• Implemented as Apache modules
• Register themselves with mod_dav when they are first loaded
• Each has a short name for reference– Used in the DAV directive (e.g. DAV svn)
• Associated with a portion of the URL tree
July 24, 2002 O'Reilly Open Source Convention 10
mod_dav Back-endsApache 2.0
DSO loader
mod_dav
mod_dav_fs
FS
July 24, 2002 O'Reilly Open Source Convention 11
mod_dav Hooks
• mod_dav does the protocol work and most of the interaction with Apache
• Back-ends provide groups of functionality– Each group defines a set of “hooks”– Some groups or individual hooks are optional
• The provider fills in the groups and hooks that it understands and can respond to
July 24, 2002 O'Reilly Open Source Convention 12
Groups of Functionality
• Content (“repository”) required
• “Dead” properties required
• “Live” properties optional, recommended
• Locks optional
• Versioning optional, very complex
• Binding optional, ill-defined
• Searching optional, ill-defined
July 24, 2002 O'Reilly Open Source Convention 13
How to Start
• Look at mod_dav_fs– Set up your Apache module– Register your provider with mod_dav
• Set up your dav_provider structure– Begin with the repository hooks– Stub out the dead property hooks– Leave the other groups as NULL
July 24, 2002 O'Reilly Open Source Convention 14
Key Structures
• dav_resource - the backend object being operated upon– The “info” field for your private data
• dav_error - returning errors• dav_response - returning multistatus info
• See mod_dav.h
July 24, 2002 O'Reilly Open Source Convention 15
dav_hooks_repository
• get_resource
• open/close/seek/write_stream
• set_headers, deliver
• copy/move/remove_resource
• create_collection
• walk
• miscellaneous
July 24, 2002 O'Reilly Open Source Convention 16
get_resource
• Identify a resource based on the user request
• Four parameters– The Apache request_rec pointer– The root of this DAV-enabled space– Label header and DAV:checked-in property
• Remember stuff in resource->info
July 24, 2002 O'Reilly Open Source Convention 17
Future
• Evolve the mod_dav API– Integrate more closely with Apache, apr(-util)– Performance and memory usage changes– Documentation(!)
• New Open Source providers– Catacomb (a MySQL backend)– Shims to implement a backend in Perl, Python,
or PHP