Setting up webdav on mybooklive is fairly easy because apache2 supports it natively and there is nothing you have to install. I use webdav across SSL so that my Apple iPad can access presentations from keynote directly from MBL versus a 3rd party service. You can mount the folder as a web drive as well and access externally. When finished, you will be able to access your files at:
https://<nas_ip>/webdav
You will logon using username/password: webdav / webdav
Your files are stored in /var/www/webdav (or your samba share "public folder" etc)
Here are the steps:
Enable webdav and ssl and restart apache2
# a2enmod dav_fs
# a2enmod ssl
# /etc/init.d/apache2 restart
Backup the default-ssl before we edit it:
# cd /etc/apache2/sites-available
# cp default-ssl default-ssl.orig
Edit default-ssl:
# nano default-ssl
(just below ServerAdmin webmaster@localhost)
#our webdav stuff
DocumentRoot /var/www/webdav/
<Directory /var/www/webdav>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Alias /webdav /var/www/webdav
<Location /webdav/>
DAV On
AuthType Basic
AuthName "WebDAV-Realm"
AuthUserFile /etc/apache2/passwd.dav
Require valid-user
</Location>
#end of webdav stuff
(save your edited file)
Create new passwd file called passwd.dav with username webdav:
# htpasswd -c /etc/apache2/passwd.dav webdav
(note that this is quite basic password authentication. More secure methods exist but I don't have experience in using them).
Enable our new web site:
# a2ensite default-ssl
Test your new config with this command:
# apache2ctl configtest
If there are no errors then continue and restart apache2 (otherwise check your edits to default-ssl:
# /etc/init.d/apache2 reload
To prevent directory browsing of https://<nas_ip>
# touch /var/www/index.html
You are done!
Now test that it works. Either from your browser or application. Or you can do this directly from your MBL using “cadaver” which will also give decent error information if its not working as expected.
Install cadever
# apt-get install cadaver
Then run:
# cadaver https://192.168.1.11/webdav
Follow prompts…
Username: webdav
Password: webdav
Then when you get here, type ls to list everything inside /var/www/webdav
dav:/webdav/> ls
To complete this tutorial, I prefer my files are stored in a separate folder that I can access also from my PC as a share. (i.e. samba)
# cd /var/www
(remove dir webdav if you created it)
# rmdir webdav
# mkdir /nfs/Public/webdav
# ln –s /nfs/Public/webdav .
Set permissions so that any file created by WebDav can also be read by a PC through samba:
# echo “umask 002" » /etc/apache2/envars
(will make apache2 write 664 as www-data, most important is that group must be read-write)
set gid so that all files created by webdav or your PC will be with the same group “share”:
# chgrp w+s /nfs/Public/webdav
END