Enable WebDAV

From AwkwardTV
Jump to: navigation, search

WebDAV is supported by default in both Mac and Windows. So, it will be easier to set up in a heterogeneous environment than an AFP or FTP server.

Install Apache

I won't repeat what has already been said here: http://www.appletvhacks.net/2007/03/25/apache-running-on-apple-tv/

Configure Apache

Copy and paste the following to have the appropriate configuration directives added to the end of the Apache configuration file:

sudo -s

cat <<EOT >> /etc/httpd/httpd.conf   
<IfModule mod_dav.c>
    DAVLockDB /Library/WebServer/DAVDB/Lock.db
    DAVMinTimeout 600

    Alias /media "/Users/frontrow/Movies/"
    <Directory "/Users/frontrow/Movies/">
        DAV On
        Allow From all

If you want to point elsewhere, just be sure to adjust the directory here and the chmod step below.

Set up Lock Database

WebDAV requires a database file to track file locks. Simply copy and paste commands to get that set up:

mkdir /Library/WebServer/DAVDB
chown www:admin /Library/WebServer/DAVDB
touch /Library/WebServer/DAVDB/Lock.db
chown www:admin /Library/WebServer/DAVDB/Lock.db

Set up Permissions

Since Apache runs as the www user, you'll need to give write access to the folder you're uploading files to.

chmod 777 /Users/frontrow/Movies

Restart Apache and Connect

Now just restart Apache to pick up the changes

apachectl restart

And connect with the URL http://IPADDRESS/media/ and that should be all there is to it.

Be warned that this opens up WebDAV without any restrictions on who can connect or any password protection! Do not follow these exact instructions if your AppleTV is accessible outside your network, or if your network is not trusted! You can look at basic Allow/Deny directives in Apache, or setting up password protection. There are numerous guides out there.