Difference between revisions of "Enable AFP Server"

From AwkwardTV
Jump to: navigation, search
m (AppleTV 2.0 - Now working)
 
(24 intermediate revisions by 13 users not shown)
Line 1: Line 1:
 +
== AppleTV 1.0 software ==
 
Editing /etc/hostconfig will start Appleshare service on boot.
 
Editing /etc/hostconfig will start Appleshare service on boot.
  
Line 5: Line 6:
 
to
 
to
 
<pre>AFPSERVER=-YES-</pre>
 
<pre>AFPSERVER=-YES-</pre>
 +
 +
 +
==AppleTV 1.1 software ==
 +
 +
* Copy from you mac Intel computer the binary:
 +
<pre>cp -R /System/Library/CoreServices/AppleFileServer.app /Volumes/OSBoot/System/Library/CoreServices/AppleFileServer.app</pre>
 +
 +
* Alternatively you can extract AppleFileServer.app from your Apple TV's recovery partition, this method involves:
 +
** extracting a dmg from the disk0s2 partition : dd if=/dev/disk0s2 of=recovery.dmg bs=1m
 +
** transferring that dmg to your Mac (verified on a G4 so no Intel mac required for this).
 +
** mounting the dmg
 +
** mounting the "osboot.dmg" found inside the mount
 +
** Find AppleFileServer.app in that mount, in /System/Library/CoreServices
 +
 +
 +
* Editing <code>/etc/hostconfig</code> will start Appleshare service on boot.
 +
 +
*Then change:
 +
**<pre>AFPSERVER=-NO-</pre>
 +
**to
 +
**<pre>AFPSERVER=-YES-</pre>
 +
 +
CAUTION: If your AppleTV came with software version 1.1 factory installed then the recovery partition doesn't seem to contain the required binary any longer. Copying it from a mac machine didn't work for me either as AppleFileServer crashed every time on startup with "Illegal instruction" error. The only way I found to obtain the working AppleFileSever was to dump the recovery partition from AppleTV, which originally came with software version 1.0, and copy it from there.
 +
 +
== Setting up the server ==
  
 
If you'd like to start appleshare without rebooting, run:
 
If you'd like to start appleshare without rebooting, run:
 
<pre>sudo /usr/sbin/AppleFileServer</pre>
 
<pre>sudo /usr/sbin/AppleFileServer</pre>
  
 +
Once AFP is running, you can mount the OS and Media partitions from the AppleTV as user 'frontrow', with the password 'frontrow'.
 +
 +
==AppleTV 2.0 - Now working ==
  
Once AFP is running, you can mount the OS and Media partitions from the AppleTV as user 'frontrow', with the password 'frontrow'.
+
Unlike the previous poster, I found I was able to get this working.  Here is what I did (in simple steps, assuming everyone is a noob):
 +
 
 +
1.  From my Macbook running Leopard I copied "/System/Library/CoreServices/AppleFileServer.app" using Cyberduck to /Users/frontrow
  
Chasd: If you need access to all platforms, WebDAV is cross platform, unlike AFP or CIFS. Since someone has been able to get Apache to run, I would like to see some try to enable WebDAV. To enable WebDAV, uncommenting the config file line that loads the dav_module, and also the line that adds mod_dav.c. Then set up Directives that create an alias and enable WebDAV, like this :
+
(edit from CousinCocaine: this did not work from my Macbook running Leopard 10.5.6. What did work was extracting the file from the 10.4.8 install DVD)
  
Inside the
+
2.  From terminal,
 +
sudo mv ~/AppleFileServer.app /System/Library/CoreServices/
  
<pre><IfModule mod_alias.c>
+
3. This doesn't seem to work (see discussion): ''In AppleTV 2.3 you also need to copy /System/Library/PrivateFrameworks/ByteRangeLocking.framework''
[...]
+
</IfModule></pre>
+
sudo mv ~/ByteRangeLocking.framework /System/Library/PrivateFrameworks/
  
block, add this block, generally after the block of lines for CGI-
+
4.  Then to run it,  
 +
sudo /usr/sbin/AppleFileServer
  
<pre><IfModule mod_dav.c>
+
5.   From my MacBook, I connect to it by selecting Finder, Ctrl+K, and then "afp://AppleTV.local/frontrow", where "AppleTV" is the name of my ATV. 
Alias /media "/mediadirectorypath/"
 
  
# Create a lock database file for this server at this path
+
6.   Username and password are, as always, "frontrow"
DAVLockDB /Library/Webserver/DAVLock.ical
 
# Minimum life of a lock
 
DAVMinTimeout 600
 
<Directory /mediadirectorypath>
 
DAV On
 
AllowOverride None
 
Options None
 
allow from all
 
</Directory>
 
</IfModule>
 
</pre>
 
  
Make sure the media directory is writable by the apache process.
+
Update - I find this service is still running after reboots and so there is no need to restart it.
You may need to touch the lock file and set its permissions.
 
  
Restart apache, then use this URL in "Connect To Server"
 
  
<nowiki>http://<ipaddressofappletv/media/</nowiki>
+
[[Category:How-to]][[Category:1.1]][[Category:2.0]][[Category:2.3]]

Latest revision as of 13:00, 17 May 2009

AppleTV 1.0 software

Editing /etc/hostconfig will start Appleshare service on boot.

Simply change:

AFPSERVER=-NO-

to

AFPSERVER=-YES-


AppleTV 1.1 software

  • Copy from you mac Intel computer the binary:
cp -R /System/Library/CoreServices/AppleFileServer.app /Volumes/OSBoot/System/Library/CoreServices/AppleFileServer.app
  • Alternatively you can extract AppleFileServer.app from your Apple TV's recovery partition, this method involves:
    • extracting a dmg from the disk0s2 partition : dd if=/dev/disk0s2 of=recovery.dmg bs=1m
    • transferring that dmg to your Mac (verified on a G4 so no Intel mac required for this).
    • mounting the dmg
    • mounting the "osboot.dmg" found inside the mount
    • Find AppleFileServer.app in that mount, in /System/Library/CoreServices


  • Editing /etc/hostconfig will start Appleshare service on boot.
  • Then change:
    • AFPSERVER=-NO-
    • to
    • AFPSERVER=-YES-

CAUTION: If your AppleTV came with software version 1.1 factory installed then the recovery partition doesn't seem to contain the required binary any longer. Copying it from a mac machine didn't work for me either as AppleFileServer crashed every time on startup with "Illegal instruction" error. The only way I found to obtain the working AppleFileSever was to dump the recovery partition from AppleTV, which originally came with software version 1.0, and copy it from there.

Setting up the server

If you'd like to start appleshare without rebooting, run:

sudo /usr/sbin/AppleFileServer

Once AFP is running, you can mount the OS and Media partitions from the AppleTV as user 'frontrow', with the password 'frontrow'.

AppleTV 2.0 - Now working

Unlike the previous poster, I found I was able to get this working. Here is what I did (in simple steps, assuming everyone is a noob):

1. From my Macbook running Leopard I copied "/System/Library/CoreServices/AppleFileServer.app" using Cyberduck to /Users/frontrow

(edit from CousinCocaine: this did not work from my Macbook running Leopard 10.5.6. What did work was extracting the file from the 10.4.8 install DVD)

2. From terminal,

sudo mv ~/AppleFileServer.app /System/Library/CoreServices/

3. This doesn't seem to work (see discussion): In AppleTV 2.3 you also need to copy /System/Library/PrivateFrameworks/ByteRangeLocking.framework

sudo mv ~/ByteRangeLocking.framework /System/Library/PrivateFrameworks/

4. Then to run it,

sudo /usr/sbin/AppleFileServer

5. From my MacBook, I connect to it by selecting Finder, Ctrl+K, and then "afp://AppleTV.local/frontrow", where "AppleTV" is the name of my ATV.

6. Username and password are, as always, "frontrow"

Update - I find this service is still running after reboots and so there is no need to restart it.