contact

Mac Mini as a home theater PC, a file server and a web server

Finally Apple released an update to the mac mini product line. I finally got mine and its already up and running. I set it up to be my HTPC, file server and web server. I want to go through each of these three topics and describe the configuration I used.

Hardware:

The mac mini is way too expensive for the hardware you get. I was really disappointed at first because they even raised the price from 439€(with student discount) t0 526€. For 550 euros I could get twice as much ram and way more disk space, eSata, blueray and hdmi output easily with a linux or windows machine. BUT OS X makes it still worth the money FOR ME. I do not agree with the back and forth disccussion about macs vs. pcs. A computer is a TOOL, like a car is for transportation. There is diffrent cars with different uses and different prices. Some cars are easy to drive some require a skilled driver… Everybody has to decide for himself if its worth the money and if it will do what you want it do in the way you want it to be done. Be glad there is a choice!

1 mac mini 3/2009, 2.0 GHZ, 2GB RAM

mac mini

mac mini

Mac Mini – The mean reasons I chose the mac mini over other more powerful computer were that its really small and really really quite. The mini is inaudible and I really hated the constant buzz from my old server, even though I already spent way to much money on expensive CPU coolers. The power consumption is also quite low and since the server will be always on its a big plus. The display output options are sufficient. I use the included mini DVI to DVI adapter and connect it to an DVI to HDMI cable. As soon as reasonably priced mini display port to hdmi adapters hit the market I will change to that. I like the built in SPIDIF audio connectors and the built in Firewire 800 port. In combination witth the 2 FW800 enabled drives it is really faster than a USB 2.0 solution and not much more expensive.

2 Western Digital My Book Studio Edition 1 TB

Western Digital My Book Studio Edition

Western Digital My Book Studio Edition

Western Digital My Book Studio Edition – Even though I had some problems with this type of hard drive before I chose them because of their low price and their ability to shut down when not in use. For a HTPC noise is a key factor. The new drives are really quiet in the first place but if the server or just the drives are not in use they turn off and are therefor completly silent. The only downturn to this is that when you want to access the drives it takes a couple of seconds to wake up from sleep but that is not a realy problem. The drives come with a 5 year warranty. Since I already experienced the rather smooth and fast exchange process of such a drive I do not expect any major worries in the next 5 years( In 5 years I hope we will be carrying Terrabytes on our thumb drives).

Setup -The set up is fairly simple. I connected the mac mini to my Flat Screen TV. I attached the two hard drives in serial mode via Firewire 800.  The WD Mybooks come with two FW 800 ports which means you can hook up one hard drive to the second hard drive and then hook up the second one to the mac. They will both be recognized and keep their ability to shut down after ten minutes when no in use. I did no real bench mark testing but the throughput was really really fast from my point of view. about 400GB in 2 hours. For Audio I connected the mini via SPIDIF to my AV Receiver. The achive clean unclutterd cabeling is the most challenging part. I did an average job on this part.

Mac mini as a server in general

  • If you are on a wanky power grid power sometimes fails and the pc shuts down. in the energy settings tick of “restart after power failure” so it comes back up.
    energy settings

    energy settings

  • Make sure that all the programs you rely on for remote access of media or files launch at start up. this is import for the reason stated above
  • If you run OS X without a mouse or keyboard attached, which is very likely for a server it always comes up with the buletooth assistant to find a bluetooth input device. This can be disabled in the advanced section of the bluetooth preference pane in the system preferences.

Screen sharing

Screen sharing with macs is really easy. OS X Leopard comes with a built in VNC server. You can enable this feature in the sharing preference pane. Make sure you set a password since we will make the screen sharing accessable over the internet.

screen sharing

how to enable screen sharing

In order to connect to your server using screen sharing in finder you go to connect to server and enter vnc://YOUR_PUBLIC_IP OR HOSTNAME ( If you do not have a static public IP you can get a free dyndns.org domain and us it). If you are on your private WIFI, the screen sharing will also appear in the finder under shares. If you set up your router correctly this also works over the internet and it will also work with windwos pcs that run a VNC server.

how to connect to vnc server

how to connect to vnc server

So Setting up the router is really easy, all you have to do is forward the port 5900 from your router to your mac minis ip address. This works differently for every router, I have and Airport extreme Basestation and there the port forwarding can be set at the port mapping section.

With this technology you can access your computer from every computer with an internet connection and a vnc client(built into leopard). It is also very useful to control the mac mini without having a keyboard or mouse attached. There are serveral programs for the Ipod Touch and Iphone that use this technology to function as a remote mouse/keyboard.

Mac mini as an HTPC

Pictures

I have all my photos on my Mac Book Pro in iPhoto. iPhoto offers a similar sharing feature like iTunes does, so that is the easiest way to share photos across computers. This can be enabled in iPhotos preferences under the sharing tab. There are also tools that sync your libraries but I have not gotten into that yet. You can also use front row to access your photos on other macs. For people that do not want to use iPhoto I recommend picasa from google as a photo organizer.

Audio

iTunes – I use iTunes for my audio and most of my video playback. So If you do not like iTunes skip this part. There are many other viable solutions out there but I like this one.

  • I store all the music on the external storage drives since I have a huge music collection that would not fit on the mac minis internal hard drive. You can change the storage folder of iTunes in the iTunes preferences.
  • Enable sharing in iTunes so my other macs(or PCs) can access the complete music library.
  • Create watch folder to which you copy new music. Using folder actions the music gets added to iTunes and deleted afterward.(the deletion part requires that you let itunes copy new music and manage it). Here is a link with a detailed description and a download of the folder action sript. This is very handy. If I get new music on my MacBook Pro I just copy it to this new music folder via the network and the music automatically finds its way into my servers iTunes and gets deleted so I do not end up with mp3s in million places. If you have a windows PC look for a program called Ttunes folder watch, its free and does the same thing
  • Setting up an Ipod Touch or Iphone (if you have one) as a remote
  • Pairing your Apple remote. If you have more than one mac like me and unpaired apple remote will drive you crazy, since every mac will pick and act according to the signal. In order to pair the remote simply hold the remote really close to the IR sensor of your mac. At the mac mini its hidden at the right corner of the dvd drive’s loading slot. Point your remote there and hold down the “next” and the “menu” button for a couple of seconds. A remote icon appears on the screen indicating the pairing is complete.

and that’s it.

Video / Media Center

iTunes /Frontrow – Video is not as trivial as Audio since Itunes sucks as a video player, if you have any formats other than supported by  Apples quicktime. Everything iTunes is capable of playing can be played using front row. So as my main media center i use Apples built in front row(enhanced with perian). It is also nice because it can access your other macs and fetch content from there. I do not bother keeping my podcasts in sync across computers so the only device that has my podcasts is my laptop and that way I can simply stream it from there.

Perian – This gives front row the capability to play almost any video format. Its an amazing tool, also called the swiss army knife for quicktime.

VLC – Video that can not be played back with front row I throw at VLC . This is one of the most robust, free media players out there. I can open pretty much anything. Saddly there is no front row integration. There is also an Ipod Touch / Iphone vlc remote app that makes using it a bit more pleasant.

Video Storage - I also store all my video on the external drives. That leaves me with the problem that I can not access them via front row if, I do not add them to iTunes which i certainly do not want to do. The solution is simple. Just put an alias of the video storage folder into the movies folder in your home directory and it will show up in front row.

Boxee - Is a new and interesting solution that can pull content from many places including local media as well as onlin stuff. I did not have time yet to look into it. once I tried it out I will update this post.

DVD Ripping / Archiving - I have a bunch of dvds and I want to watch them instant on demand without the stupid discs. I use JackTheRipper to decrypt the complete DVD to the hard drive. Front row and other media players will read the files as if they were a real dvd. This makes movies really large 4GB + but you keep the experience of a dvd. One could also convert the dvd files to a more compressed format but since I have the massive storage i’d rather have the better picture. Note: Depending on your country of residence ripping dvds may be an illegal thing to do. I do not take any liability nor do I encourage any illegal action.

Again there are many more options for media centers and media playback.

Mac mini as a file server

AFP – Since I finally managed to get rid of the last pc in my household I can use Apples afp:// protocol for file sharing. There are two ways to access the files on mac. The first is to Login to the mac using a existing user account from this mac. This only requires file sharing to be turned on, no additional settings.  Just connect and you have access to all the files that the user would have if he were using the mac itself.

picture-5

You can also enable the sharing preferences for file sharing and windows file sharing if you want your files to be available without login.

file sharing

how to enabe file sharing

The AFP file sharing also works over the internet. You can connect to your mac server if you forward the port 548 from your router to your mac. This is one of the handiest features that is not available to windows servers that easily. In order to connect use the finders ability “connect to server” and use afp://YOUR_PUBLIC_IP OR HOSTNAME.

FTP - Since I don’t have a mac everywhere and many other people don’t, I want my server to support a non apple-propreitary protocol to share files. On windows the FTP server that comes with XAMPP is really good – Filezilla. The proFTPd that comes with xampp does not have a GUI and requires quite some UNIX knowlegde to get up and running. All macs running OS X 10.5 come with a built in FTP server but its configuration possibilities are more than limited. I do not recommend using it. Instead I chose PureFTPd Manager that offers a really nice GUI and is easy to set up. This is really a question of how much geek credability you want to earn with your server. I like simple GUIs.

WebDAV – I am currently working on that.


Mac mini as a web server

XAMPP – All macs come with an apache server built in but if you don’t to bother installing a SQL server separatly I recommend XAMPP. Its a prepacked WEB server that comes with everything you need and requires very little configuration.

  • Make sure you go through the security setup and set all the passwords otherwise you mac is in serious danger.
  • I encountered some big problems changing the sql password. After I changed it I could not access the myphpadmin that came with XAMPP. The problem can be solved by editing the /Applications/xampp/xamppfiles/phpmyadminconfig.inc.php file. find this section:/* Server parameters */
    $cfg['Servers'][$i]['host'] = ‘localhost’;
    $cfg['Servers'][$i]['user'] = ‘root’;
    $cfg['Servers'][$i]['password'] = ”; // PUT YOUR SQL PASSWORD HERE
    $cfg['Servers'][$i]['connect_type'] = ’socket’;
    $cfg['Servers'][$i]['compress'] = false;
  • Saving the file is the next challenge since you will most likely not have the sufficient privileges to do so. You can edit the file as a super user using the terminal, here is a link with a more detailed description. After you have done that the permissions of the file will be messed up so you have to reset them in the finder.  Relaunch SQL server after that.
  • If you want to change the default location of your webserver from htdocs to something else you have to edit the etc/http.conf file as well as the etc/extras/httpd-vhosts.conf file. There you will find the defaults paths that lead to the xampp directory. Just put in you desired folder and restart the apache server.
  • If you want your server to be accesable from the internet you have to forward the port 80(thats just http so https won’t go through) from your router to your server. Be aware though that this makes it accessable for everybody else on the internet as well.

BACKUP

Backup often! It is not a question whether a hard drive will die or not, but only when it will die. So I wanted my media collection to be fairly secure from hard drive failure. That is why I bought 2 of the 1 TB hard drives. At first I thought about hardware based raid, or software based raid but Raid really is not the best backup solution. If you delete something it gets deleted on all drives on the raid and is lost forever. I Therefor decided to use a simple backup program to do an incremental backup of the first drive to the second drive once a day. If a drive dies, I have everything backed up, and if I delete something I can still get back to it. I recommend the free software carbon copy cloner.

Time Machine it really good solution for personal computers but not for servers. Since Time Machine saves all changes and gives you the possibility to go back in time it keeps every file you delete or change. So if I were to back up my entire 1TB media collection with time machine and change a few things over time, the second drive would soon not be able to store everything. I do use time machine though to backup my mac minis internal system hard drive to a hard drive that is attached to my airport extreme base station. That way I do not have to set everything up again if the internal drive dies.

Syncing Data across computers

Quite often you want to sync your data form one computer to your server. There are a lot of solutions to this problem but I have to pieces of software that I like best.

  • Use dorpbox for small file swapping and file syncing. It requires you to sign up but you get 2GB of online storage that is automatically synced to every computer you install drop box on for free. This works with Windwos and OS X.
  • Use windows live sync for serious syncing of 2 or more computers. It also works with mac and it works really well. It does require a windows live Id. I really like the software I just find it perverted that Microsoft offers the best free sync solution for macs. The technology uses P2P protocols so the data is not synced via some Microsoft server but exchanged directly between your computers. Microsofts servers only organize the transfers and the set up.

Other software to install

  • cyberduck as an ftp client. The best free mac ftp client that I know.

Enjoy!

Heres a few shots of the final result:

Tags: , , , , , , , , , , , ,

  1. Now it’s age of Home Theater PC. Your range is very fine and it is a new technology and good thing is that it is a cost effective. I am also fan of Thermaltake VF7001BNS Home Theater Media PC Chassis

  2. Great article. The only difference in the setup I’m building is that I’m using a cheap external enclosure attached to my AirPort Extreme to run as a NAS. I find the extra price for the Western Digital MyBook Studio is not worth it, as sweet as they are.

    I’m wondering why you don’t use Plex as a media centre app though.

    I also seem to be having some problems with vnc screen sharing, where I can’t always connect to my Mini with my local MacBook Pro. I’d rather not have to buy an extra mouse just for the mini when I can remotely control it, but the screen sharing seems flaky.

  3. I have never heard of Plex before but I will certainly try it now. I only tried boxee, but I did not really like it.

    As for the Hard drives, I chose them over cheap enclosures because they auto-power-down and they come with a 5 year warranty which is rather important for hard drives since every drive dies at some point. I already got a WD 500 GB hard drive replaced under warranty and the customer service and replacement went really smooth. The other thing is that the FW 800 port is a lot faster than the LAN. I often move large 10+ GB files around and this setup was the fastest I could achieve without e-Sata, which Apple unfortunatly does not support.

    I never had any problems with the screen-sharing, also using my mac book pro , but it greatly depends on the networks bandwidth. Over the Internet it is kind often kind of flaky and I could imagine that if you have lots of traffic on your network it could unsmooth.

  4. I’m still playing around with Plex, and so far it seems like a great solution.

    I’m using WD drives with my cheap enclosure, because I trust them too. I’d go with the FW800 option, but my enclosure will be attached to the AirPort Extreme (ordered, not delivered) and it only supports USB. I read that the AirPort powers down any drive attached to it after a certain amount of inactivity, so I’m not worried about that. I do have a 2TB MyBook Studio to move large files and use as a workspace when editing HD video in Final Cut Pro.

    I’m currently on a g network, and when my AirPort arrives, I’m hoping the screen sharing issue doesn’t happen anymore (as I always connect locally, never through the internet). By flaky I meant that it doesn’t even connect, but it appears to be a bug that not everyone is having.

  5. I was not aware that the basestation powers down all drives, please let me know if that really works. Depending if you have your mini as an always on server or just on when you need it I think it would be more performant if you attached the drives directly to the mini and simply share them, making the mini a NAS. I have had the experience that streaming video over Lan does not always work so smoothly, especially with high dev content. When I watch video on my Mac Book Pro I always transfer the video to the hard drive first and play it from there. I don’t know the reason for this problem though since the wireless N network should be plenty fast to stream video.

  6. I can now confirm that the basestation powers down my drive. It’s a Vantec NexStar 3 (3.5” SATA to USB). I’m not sure how long it takes to power down, but I copied a file over to it, then left the house for two hours, and when I came back the drive was cold and silent. I brought my MacBook to the basestation, copied something over, and heard the drive spinning up again.

    I found some more cheap SATA drives, so I’m purchasing extra NexStar 3 enclosures as well as a USB hub to attach to the basestation. I’ll let you know how that works out.

    Streaming content over the network seems to be working well with the n network, but I had to force my Macs to connect to the 5Ghz bandwidth, otherwise I wasn’t getting a decent transfer rate.

    I also solved the issue with the Screen Sharing; turns out it’s a bug with the network service that occasionally doesn’t close, so I have to force quit it.

  7. thanks for sharing your findings, thats very interesting, I guess I can go with cheaper drives then in the future. How do you force a mac to use the 5GHz spectrum? I am quite sure that is the cause for my streaming problems as well. I’d really appreciate it if I did not have to copy everything to my hard drive first befor watching it.

  8. To force a 5Ghz connection, you have to create a separate network with a different name. There’s an option to do this in the Airport Utility. Then simply join this network. Otherwise, if both the 2.6Ghz and 5Ghz networks have the same name, the Airport automatically will choose between the two, depending on the signal strength (sometimes choosing the 2.6Ghz network by mistake).

    To be sure, you can test this if you hold down the option key while clicking the airport icon. It will display the transmit rate. If it’s above 54, you know you’re connected to the N network. I generally get somewhere between 161 and 240 (in a small apartment, about 20 feet from the Airport Extreme).

    Good luck! Copying something to your hard drive before watching it certainly ruins the point of having such a convenient home theater system!

  9. I found it, and just as I suspected mine is set with the slower default setting to be compatible with b/g networks. That is a good thing because otherwise my ipod touch would not work anymore since it can not handle 5Ghz or even 2.4Ghz N. Since my Basestation is an older version it does not support the multicasting that yours has now –> being able to have a 5GHz network and a 2.4GHz network simultaniously. I can only choose between 5GHz or 2.4GH b/g/n. The best solution would be to use an old router for the b/g stuff and set the base station to a 5GHz N only network. I will try that tomorrow and see how it works out. thanks again for your detailed help!

  10. Christoph…I am considering this type of configuration. Any thoughts on like a Play Station 3 in the mix, since it is a Blue Ray and has games. Also, are you up on some of the apps that allow the ipod touch to control the mac mini /tv etc the remote app. Thanks for this valuable info and I look forward to hearing from you. BC

  11. HI I am not a console gamer so I have no experience with these devices but if your tv has enough hdmi ports its probably one of the best ways to add blueray to the setup. As for the apps, there is something called “vlc remote” that works quite well. Most of the time I just use the regular Apple IR Remote or I VNC into the mini and control it with my laptop.