publishing repositories with mod_dav

17
July 24, 2002 O'Reilly Open Source Co nvention 1 Publishing Repositories with mod_dav Greg Stein CollabNet, Inc. [email protected], http://www.lyra.org/greg/

Upload: fiorello-lappin

Post on 31-Dec-2015

11 views

Category:

Documents


0 download

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 Presentation

TRANSCRIPT

Page 1: Publishing Repositories with mod_dav

July 24, 2002 O'Reilly Open Source Convention 1

Publishing Repositories with mod_dav

Greg SteinCollabNet, Inc.

[email protected], http://www.lyra.org/greg/

Page 2: Publishing Repositories with mod_dav

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

Page 3: Publishing Repositories with mod_dav

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

Page 4: Publishing Repositories with mod_dav

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

Page 5: Publishing Repositories with mod_dav

July 24, 2002 O'Reilly Open Source Convention 5

WebDAV IntroductionScenarios

• Collaborative authoring

• Network file system

• Remote software engineering

• Unified repository-access protocol

Page 6: Publishing Repositories with mod_dav

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

Page 7: Publishing Repositories with mod_dav

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)

Page 8: Publishing Repositories with mod_dav

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

Page 9: Publishing Repositories with mod_dav

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

Page 10: Publishing Repositories with mod_dav

July 24, 2002 O'Reilly Open Source Convention 10

mod_dav Back-endsApache 2.0

DSO loader

mod_dav

mod_dav_fs

FS

Page 11: Publishing Repositories with mod_dav

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

Page 12: Publishing Repositories with mod_dav

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

Page 13: Publishing Repositories with mod_dav

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

Page 14: Publishing Repositories with mod_dav

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

Page 15: Publishing Repositories with mod_dav

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

Page 16: Publishing Repositories with mod_dav

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

Page 17: Publishing Repositories with mod_dav

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