More Related Content Similar to Build an autoversioning filesystem with Apache2 Similar to Build an autoversioning filesystem with Apache2 (20) More from Javier Arturo Rodríguez More from Javier Arturo Rodríguez (9) Build an autoversioning filesystem with Apache21. Build a Versioning File System
using WebDAV and Subversion
BCN Sudoers
javier@rodriguez.org.mx
20120103
http://slideshare.net/codehead
2. WebDAV
● RFC4918: HTTP Extensions for Web Distributed
Authoring and Versioning (WebDAV)
● http://www.webdav.org/
3. WEBDAV METHODS
WebDAV Methods
● PROPFIND
● PROPPATCH
● MKCOL
● COPY
● MOVE
● LOCK
● UNLOCK
4. ●
the B
'
WHATS Windows IG DE
AL
May use HTTP or HTTPS as transport layer
?
● Use existing infrastructure
● Binary transparent
● Can be used as a remote filesystem
7. Windows ENTS
AV CLI
WEBD
● Mount as a filesystem
● FTP-like interface
8. Windows S
WINDOW
● Native “Web Folders” ● MS Office
(Mostly broken) ● Bit Kinex
● Xythos Drive ● CyberDuck
● WebDrive $
● GoodSync $
9. MAC
Mac
● Native Finder ● iWork
● MacFUSE ● CyberDuck
10. Linux
LINUX
● davfs2 ● KDE konqueror
● fusedav ● KDE dolphin
● Gnome Nautilus
● cadaver
11. Re c ipe 1
Subversion
WebDAV server using Apache2
12. In Dependencies s
gredient
● Mandatory
● apache2-mpm-prefork
● Optional
● libapache2-mod-auth-*
13. Hello, mod-ssl
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/webdav.pem
SSLCertificateKeyFile /etc/ssl/private/webdav.key
BrowserMatch "MSIE [2-6]"
nokeepalive ssl-unclean-shutdown
downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
14. Enable webd
av
# a2enmod ssl dav_svn dav_fs
# mkdir /var/lib/webdav
# chown -R www-data.www-data /var/lib/webdav
Alias /webdav/ /var/lib/webdav/
<Location /webdav>
DAV On
AuthBasicProvider file
AuthType Basic
AuthUserFile htpasswd
AuthName "WebDAV"
require valid-user
Options +Indexes
DirectoryIndex
</Location>
15. Enable webd
av
# a2enmod ssl dav_svn dav_fs
# mkdir /var/lib/webdav
# chown -R www-data.www-data /var/lib/webdav
Alias /webdav/ /var/lib/webdav/
<Location /webdav> Specify a real path
DAV On
AuthBasicProvider file
AuthType Basic
AuthUserFile htpasswd
AuthName "WebDAV"
require valid-user
Options +Indexes
DirectoryIndex
</Location>
16. Enable webd
av
# a2enmod ssl dav_svn dav_fs
# mkdir /var/lib/webdav
# chown -R www-data.www-data /var/lib/webdav
Alias /webdav/ /var/lib/webdav/
<Location /webdav>
DAV On
AuthBasicProvider file Turn DAV on
AuthType Basic
AuthUserFile htpasswd
AuthName "WebDAV"
require valid-user
Options +Indexes
DirectoryIndex
</Location>
17. Enable webd
av
# a2enmod ssl dav_svn dav_fs
# mkdir /var/lib/webdav
# chown -R www-data.www-data /var/lib/webdav
Alias /webdav/ /var/lib/webdav/
<Location /webdav>
DAV On
AuthBasicProvider file
AuthType Basic Season to taste
AuthUserFile htpasswd
AuthName "WebDAV"
require valid-user
Options +Indexes
DirectoryIndex
</Location>
19. TEST webdav
Apache httpd
Web Browser HTTP
filesystem
# curl --insecure --user testuser https://sandbox.ascii164.com/webdav/
20. TEST webdav
Apache httpd
WebDAV Client WebDAV
HTTP
filesystem
# mkdir /mnt/dav
# mount -t davfs https://sandbox.ascii164.com/webdav/ /mnt/dav
# mount
# ls /mnt/dav
21. Subversionn
v ersio
sub
● Delta-V WebDAV Versioning Extension
(RFC3253)
● CollabNet → Apache Software Foundation
● http://subversion.apache.org/
23. Dependenciests
re dien
Ing
● Mandatory
● apache2-mpm-prefork
● libapache2-svn
● subversion
● Optional
● libapache2-mod-dnssd
● libapache2-mod-auth-*
24. Enable SUBV
ERSION
# mkdir /var/lib/svn
# svnadmin create /var/lib/svn/repo
# chown -R www-data.www-data /var/lib/svn
<Location /svn>
DAV svn
SVNParentPath /var/lib/svn
AuthBasicProvider file
AuthType Basic
AuthUserFile htpasswd
AuthName "Subversion"
require valid-user
Options +Indexes
DirectoryIndex
</Location>
25. Enable SUBV
ERSION
# mkdir /var/lib/svn
# svnadmin create /var/lib/svn/repo
# chown -R www-data.www-data /var/lib/svn
<Location /svn>
DAV svn Virtual Path
SVNParentPath /var/lib/svn
AuthBasicProvider file
AuthType Basic
AuthUserFile htpasswd
AuthName "Subversion"
require valid-user
Options +Indexes
DirectoryIndex
</Location>
26. Enable SUBV
ERSION
# mkdir /var/lib/svn
# svnadmin create /var/lib/svn/repo
# chown -R www-data.www-data /var/lib/svn
<Location /svn>
DAV svn
SVNParentPath /var/lib/svnFile System
svn DAV
AuthBasicProvider file
AuthType Basic
AuthUserFile htpasswd
AuthName "Subversion"
require valid-user
Options +Indexes
DirectoryIndex
</Location>
27. Enable SUBV
ERSION
# mkdir /var/lib/svn
# svnadmin create /var/lib/svn/repo
# chown -R www-data.www-data /var/lib/svn
<Location /svn>
DAV svn
SVNParentPath /var/lib/svn Repo Root
AuthBasicProvider file (Use SVNPath
AuthType Basic for a single repo)
AuthUserFile htpasswd
AuthName "Subversion"
require valid-user
Options +Indexes
DirectoryIndex
</Location>
29. TES T SUBVERSION
SVN Client Delta-V
Apache httpd
WebDAV
HTTP
libsvn
filesystem
# svn mkdir https://sandbox.ascii164.com/svn/repo/trunk/
https://sandbox.ascii164.com/svn/repo/tags/
https://sandbox.ascii164.com/svn/repo/branches/
# svn ls https://sandbox.ascii164.com/svn/repo/
30. TES T SUBVERSION
Delta-V
Apache httpd
WebDAV
Web Browser HTTP
libsvn
filesystem
# curl --insecure --user testuser https://sandbox.ascii164.com/svn/repo/
33. Subversion
ipe 3
Rec
autoversioning filesystem
34. Enable auto
versioning
# mkdir /var/lib/svn
# svnadmin create /var/lib/svn/documents
# chown -R www-data.www-data /var/lib/svn
<Location /documents>
DAV svn
SVNPath /var/lib/svn/documents
SVNAutoVersioning on
ModMimeUsePathInfo on
AuthBasicProvider file
AuthType Basic
AuthUserFile htpasswd
AuthName "Documents"
require valid-user
Options +Indexes
DirectoryIndex
</Location>
35. EST autov ersioning
T
Delta-V
Apache httpd
WebDAV Client WebDAV
HTTP
libsvn
filesystem
# mkdir /mnt/docs
# mount -t davfs https://sandbox.ascii164.com/documents/
/mnt/docs
# mount
# ls /mnt/docs
36. EST autov ersioning
T
SVN Client Delta-V
Apache httpd
WebDAV
HTTP
libsvn
filesystem
# svn ls https://sandbox.ascii164.com/documents/
37. MORE RESOUR
Further ResourcesS
CE
● http://svnbook.red-bean.com/
38. CO ME
W EL
STI ONS
Q UE
ALL
40. SVN Client Delta-V
Apache httpd
WebDAV
HTTP
libsvn
filesystem
41. <Location /svn>
DAV svn
SVNParentPath /var/lib/svn
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthType Basic
AuthName "Document Repository"
AuthLDAPURL ldap://localhost/ou=Users,dc=company,dc=com?uid?sub?
require valid-user
</Location>
42. SVN Client Delta-V
Apache httpd
WebDAV Client WebDAV
Web Browser HTTP
libsvn
filesystem
44. SVN Client Delta-V
WebDAV Client WebDAV Apache
Web Browser HTTP
libsvn
filesystem
47. SVN Client Delta-V
WebDAV Client WebDAV Apache
Web Browser HTTP
libsvn
filesystem
48. <Location /documents>
DAV svn
SVNPath /var/lib/svn/docrepo
SVNAutoVersioning on
ModMimeUsePathInfo on
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthType Basic
AuthName "Document Repository"
AuthLDAPURL ldap://localhost/ou=Users,dc=company,dc=com?uid?sub?
require valid-user
</Location>