WebDAV, Dropbox, and an iPad walk into a bar.
Two weeks ago apple released updates to all three iWork applications, Pages, Numbers, and Keynote on the iPad. The update to version 1.2 adds some small new features such as MS office export capabilities across all the applications, word count in Pages, and the ability to open .csv and .txt files. The biggest new feature included in this update I'd this suability to open and save files from your MobileMe iDisk or any other WebDAV disk. This is a huge feature that enables iWork to be a powerful office application without access to the iPad’s filesystem.
WebDAV is a web protocol that enables file reading and writing via the web. A few cloud storage services support WebDAV including MobileMe but favorites such as Dropbox and Box.net lack WebDAV support. Since I have replaced MobileMe with other services including dropbox I wanted to figure out a way to allow iWork to read and write files from my existing dropbox account. This tutorial is based on OS X but WebDAV can be set up on any windows or Linux machine.
1) Start Apache
You will need to enable Web Sharing, since the WebDAV service will be provided by Apache, the web server on Mac OS X. You do not necessarily need to have a web site running, but you will need to activate and run Apache. Go to System Preferences > Sharing, and turn on the box labeled Web Sharing.
2) Enable WebDAV support in Apache
First navigate to the /etc/ folder. This is a hidden folder so I recommend using the Finders go to folder feature as show below.
Once there copy the file /etc/apache2/httpd.conf to your desktop and open it with your favorite text editor, then locate this line:
LoadModule dav_module libexec/apache2/mod_dav.so
Remove the “#” at the beginning of the line if one exists.
Then locate this line
Include /private/etc/apache2/extra/httpd-dav.conf
Again, make sure it is not commented out. It is disabled by default, so you need to remove the “#” from this line. Finally, save the file and then drag it back into it’s existing folder. You will be prompted for your admin password.
3) Configure WebDAV
Next, edit the file /etc/apache2/extra/httpd-dav.conf by dragging it to your desktop as before. Add a section in it to create our new WebDAV share. Here’s what the new section should look like. You should also go ahead and delete the /usr/uploads share that is set by default.
Alias /webdav "/Library/WebServer/WebDAV"
Dav On
Order Allow,Deny
Allow from all
AuthType Basic
AuthName WebDAV-Realm
AuthUserFile "/usr/webdav.passwd"
require user YourUserName
On line 1, the name following the Alias keyword is the URL you’d like for your new WebDAV share. I recommend leaving this as is. The second half of this line, the portion in double quotes, should be the path to the portion of your Dropbox you would like to access on the iPad. My line 1 reads as follows.
Alias /webdav "/Users/jordanpatterson/Dropbox/Documents"
On line 9, we specify the authentication scheme as Basic, not Digest. The security conscious will note that this sends unencrypted passwords over plain text, so don’t use this username and password combination for anything else.
On line 14, substitute the username you would like to use for your WebDAV account. Remember this because you will need this again in the next step.
4) Create user accounts and passwords
Use the htpasswd tool to create your password file. Enter the following command in terminal.
htpasswd -c /usr/webdav.passwd "YourUserName"
New password:
Re-type new password:
Adding password for user YourUserName
5) Create the necessary directories
Enter the following command in terminal.
sudo mkdir -p /usr/var
6) Setup permissions correctly
Enter the following command in terminal.
sudo chown -R www:www /Library/WebServer/WebDAV2
sudo chown -R www:www /usr/var
sudo chgrp www /usr/webdav.passwd
7) Restart Apache gracefully
Enter the following command in terminal.
sudo apachectl graceful
8) Adjust permissions of Dropbox folder
Get info on the Dropbox folder you are using with WebDAV.
In the sharing and permissions portion of the get info window click the lock icon and authenticate with your account password. Then click the plus button and add your user account and give it read and write access.
To ensure no issues I went ahead and gave everyone read and write permissions to this folder. Finally, click on the cog wheel and apply these permissions to all enclosed folders.
You have now successfully set up a WebDAV server on your Mac.
9) Configuring your iPad
Now on to the iPad settings. Open iWork and click on either the copy to or copy from icon.
Select the webdav option and enter the ip address of your Mac, and the user name and password you set in step 4 above. iWork will now remember this information and you will be able to copy to and from our Dropbox folder within iWork.
If you would like to access your WebDAV server from outside your local network you can forward port 80 to the IP address of the mac running the WebDAV server and enter your external ip address into iWork. As a word of caution, I am sure that forwarding port 80 is a cause for concern by many security experts. If you have any reservation about this please only access the WebDAV server only over your local network as i am not responsible for any issues you may encounter. To continue with the disclaimers, backup your data before setting this up. I had no issues at all but I don’t want any of my readers to loose data.
Update: I forgot to add that the skeleton of my WebdADAV setup came from a great article by Manus Tungare. This is a great piece on setting up WebDAV for Omnifocus syncing.



We opted against DropDAV because we don't know if we can truly trust the company to have access to our Dropbox account. The data inside is too secure to chance (in this case).
Does anyone know more about DropDAV security practices?
Can you please help?
Thanks.
Andrew
http://itunes.apple.com/us/app/mediamaster-server/id427559105?mt=12
Please advise.
Thanks.
http://192.168.X.X:8000
hope that helps Andrew.