Build an autoversioning filesystem with Apache2

3,753 views

Published on

Published in: Technology
1 Comment
3 Likes
Statistics
Notes
No Downloads
Views
Total views
3,753
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
18
Comments
1
Likes
3
Embeds 0
No embeds

No notes for slide

Build an autoversioning filesystem with Apache2

  1. 1. Build a Versioning File Systemusing WebDAV and Subversion BCN Sudoers javier@rodriguez.org.mx 20120103 http://slideshare.net/codehead
  2. 2. WebDAV● RFC4918: HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)● http://www.webdav.org/
  3. 3. WEBDAV METHODS WebDAV Methods● PROPFIND● PROPPATCH● MKCOL● COPY● MOVE● LOCK● UNLOCK
  4. 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
  5. 5. Apache httpdWeb Browser HTTP filesystem
  6. 6. Apache httpdWebDAV Client WebDAV HTTP filesystem
  7. 7. Windows ENTS AV CLI WEBD● Mount as a filesystem ● FTP-like interface
  8. 8. Windows S WINDOW● Native “Web Folders” ● MS Office (Mostly broken) ● Bit Kinex● Xythos Drive ● CyberDuck ● WebDrive $ ● GoodSync $
  9. 9. MAC Mac● Native Finder ● iWork● MacFUSE ● CyberDuck
  10. 10. Linux LINUX● davfs2 ● KDE konqueror● fusedav ● KDE dolphin ● Gnome Nautilus ● cadaver
  11. 11. Re c ipe 1 SubversionWebDAV server using Apache2
  12. 12. In Dependencies s gredient● Mandatory ● apache2-mpm-prefork● Optional ● libapache2-mod-auth-*
  13. 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. 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. 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. 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. 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>
  18. 18. TEST webdav
  19. 19. TEST webdav Apache httpd Web Browser HTTP filesystem# curl --insecure --user testuser https://sandbox.ascii164.com/webdav/
  20. 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. 21. Subversionn v ersio sub● Delta-V WebDAV Versioning Extension (RFC3253)● CollabNet → Apache Software Foundation● http://subversion.apache.org/
  22. 22. RECIPE Subversion 2svn server using Apache2
  23. 23. Dependenciests re dien Ing● Mandatory ● apache2-mpm-prefork ● libapache2-svn ● subversion● Optional ● libapache2-mod-dnssd ● libapache2-mod-auth-*
  24. 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. 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. 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. 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>
  28. 28. TES T SUBVERSION
  29. 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. 30. TES T SUBVERSION Delta-V Apache httpd WebDAV Web Browser HTTP libsvn filesystem# curl --insecure --user testuser https://sandbox.ascii164.com/svn/repo/
  31. 31. v ersi oning vs backup
  32. 32. WHENshould I create a new version ?
  33. 33. Subversion ipe 3 Recautoversioning filesystem
  34. 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. 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. 36. EST autov ersioning T SVN Client Delta-V Apache httpd WebDAV HTTP libsvn filesystem# svn ls https://sandbox.ascii164.com/documents/
  37. 37. MORE RESOUR Further ResourcesS CE● http://svnbook.red-bean.com/
  38. 38. CO ME W EL STI ONS Q UEALL
  39. 39. BCN S udoersjavier@rodriguez.org.mx @codehead
  40. 40. SVN Client Delta-V Apache httpd WebDAV HTTP libsvn filesystem
  41. 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. 42. SVN Client Delta-V Apache httpdWebDAV Client WebDAVWeb Browser HTTP libsvn filesystem
  43. 43. svn ls https://sandbox.company.com/svn/repo/
  44. 44. SVN Client Delta-VWebDAV Client WebDAV ApacheWeb Browser HTTP libsvn filesystem
  45. 45. curl https://sandbox.company.com/svn/repo/
  46. 46. ersioningAutov
  47. 47. SVN Client Delta-VWebDAV Client WebDAV ApacheWeb Browser HTTP libsvn filesystem
  48. 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>
  49. 49. Client Software

×