Enable Apache

From AwkwardTV
Jump to: navigation, search

Notes

This how-to is based on appletvhacs' description. The idea is to copy the missing files from a Mac running V10.4 "Tiger" to the AppleTV.

With this, you will have a machine running Perl and Apache. If you additionally want PHP and MySQL, you can consider installing XAMPP which provides all 4 items independently of the ApplTV OS.

Prerequisites

As stated, you will need a disk with Mac OS V10.4 "Tiger" installed.

Copying the files

Make sure to preserve file attributes when copying.

The files to copy are:

/usr/sbin/apachectl
/usr/sbin/httpd

The directories to copy are:

/usr/libexec/httpd
/Library/WebServer

The configuration file is already found on the AppleTV:

/etc/httpd/httpd.conf

This file defines defines where the web pages are:

DocumentRoot "/Library/WebServer/Documents"

The Apache startup item is provided in:

/System/Library/StartupItems/Apache/

Starting the server

The Apache way:

apachectl start

The Mac OS X way:

SystemStarter start "Web Server"

With a web browser, check that the service works. Navigate to your AppleTV. You should be greeted with: Seeing this instead of the website you expected?

Enabling at boot time

Edit the file /etc/hostconfig and replace WEBSERVER=-NO- with WEBSERVER=-YES-.

Restart the AppleTV and check the service with a web browser.