Turn an Apple TV 2 into a Web Server

May 18, 2011 - 11 Comments

Turn Apple TV2 into a Web Server

So you already setup your Apple TV2 to run XBMC, and now you’re bored with it. Why not turn the ATV2 into a webserver like the guys at MacMiniVault did? Yes this link opens a web page served from an Apple TV2. You can do this yourself with your own Apple TV without too much work, just a bit of patience.

Before getting started, you’ll need to jailbreak the Apple TV2 with Seas0nPass, Seas0nPass is the easiest jailbreak utility around, but you could use PwnageTool or Redsn0w if that floats your boat. After you’ve done this, here’s a rundown of what you’ll need to do:

  • SSH into the newly jailbroken Apple TV2 from the Terminal, the default root password is ‘alpine’ and you’ll need to know the AppleTV2′s IP address or you can try using the hostname apple-tv.local:
  • ssh root@apple-tv.local

  • Change the root password from alpine to something else by typing ‘passwd’
  • Install Lighttpd onto the Apple TV2 by using apt-get:
  • apt-get install lighttpd

  • Use your favorite SFTP app (CyberDuck is free) to upload a lighttpd config file to /etc/lighttpd.conf – here’s a sample lighttpd.conf to work from
  • Now launch lighttpd server with (you may need to run this as /usr/sbin/lighttpd-angel):
  • lighttpd-angel -f /etc/lighttpd.conf

Your Apple TV2 web server should now be up and running, this can be verified by pulling up the ATV’s IP address in a web browser.

If you want the webserver to automatically start when the Apple TV boots or reboots, you’ll need to add a launch agent plist to /Library/LaunchDaemons/, plist files are different than bash scripts in that you have to spell out each individual flag and argument as a string. In this case, the command to execute lighttpd-angel would translate to plist keys looking something like this:

This walkthrough isn’t perfect yet, it’s an elaborated version from the super simplified instructions on MacMiniVault who setup this live Apple TV webserver just to see how well it will handle the traffic load.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Matt Chan in Apple TV, Fun, Tips & Tricks

11 Comments

» Comments RSS Feed

  1. czar says:

    New weekend project… there goes $99!

  2. [...] tweeted and blogged about this project. A special thanks goes out to macstories.net, cultofmac.com, osxdaily.com, and [...]

  3. Mike says:

    Really a great idea and a much better tutorial than on the mac mini vault page. Unfortunately in the last step I get an error: After typing lighttpd-angel -f /etc/lighttpd.conf I get this error (even if in the directory /usr/sbin): “can’t find username lighttpd”.

    I’m a total newbie, perhaps someone can help me.

  4. [...] Wer das Ganze selbst mal ausprobieren möchte, findet bei OSXDaily eine ausführliche Installationsanleitung. [...]

  5. Darl Bundren says:

    If you aren’t going to use the aTV as an actual TV display device, you can disable the “AppleTV” service and save 25% CPU instantly. The “AppleTV” service is not required to be running for the machine to function… it is only required to launch frappliances (XBMC, NitoTV, etc…) and provide the GUI interface, which is unnecessary for a webserver.

    To do this, do ‘chmod -x /Applications/AppleTV.app/AppleTV’ followed by a ‘killall AppleTV’

    You should be good to go!

  6. [...] Turn an Apple TV 2 into a Web Server – Bored with your Apple TV 2 just being a media player? Did you already jailbreak, install XBMC, and turn the ATV2 into a media center? Go a step further and turn the Apple TV2 into a full blown web server, because you can. [...]

  7. Chris C. says:

    Another option is to install the yaSSL Embedded Web Server on your Apple TV. Process is explained here: http://bit.ly/oqmu8V.

  8. Dan says:

    Any way you know of to get PHP and MySQL running on there as well? That would rule.

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates