Back in 2003, I used to connect my computer on the my old 32′ TV, those huge and heavy TVs, to watch stuff from the internet, at that time, eMule was ruling the p2p community (can’t talk about USENET right? :} ). Then in 2008 I decided to build a better HTPC (Home Theater PC), a full dedicated computer connected to my TV, with good MotherBoard/VGA/SoundBoard, well, a good computer, with gaming capacities. It was good while it lasted, but you know, it was huge black box below my TV, bit noisy, but it did the job.
Early this year, I got a 2TB Lacie Network Space 2, which is a simple NAS Server, and a WD Plus Live. The WD PLUS LIVE is nothing more than a small computer with an operating system to playback videos and music. He has no storage, so it should you have to plug a thumb-drive, external hard drive on it or connect to the network, which will give access to shared files over the network, in my case, files are stored at the Network Space 2 connected to the router. When I bought the WD, I was impressed with the image quality, and how he can play heavy files without any choke. I watched the Band of Brothers show recently co-directed by Tom Hanks and Steven Spielberg in FULL HD 1920×1080 , where files were like 7GB for episode of 50-60 minutes. I played all over the network, and it worked perfectly.
Anyway, my Lacie NAS stopped working, some problem with the file system, but the HD was still working great. There is a way to re-format the Lacie’s file system, but it’s a pain in the as*. So that’s when I decided to build a real NAS Server, running UBUNTU and using that Network Space’s hard drive and another 1TB driving that was laying around. I based my NAS on the DIY 200U$ PC from Paul Stamatiou, I don’t even know if he still has his own NAS, but I’m really enjoin mine.
For the hardware, I ended up with a fanless MiniITX motherboard Intel D510MO, which has an Atom processor, Gigabit ethernet (all my home network is Gigabit, so it does make a difference). I am also using a 2GB 800Mhz Kingston RAM memory, and both two SATA connectors. The MOBO has up to seven 2.0 USB and one mini PCI Express, in case I want to add more SATA drives in the future.
As I told before, I am using a 2TB HD from my old NAS, and also a 1TB HD that I had, so ≈ 3TB, good enough for now… for now!
Power supply, well, just got a regular one, but another good solution would be a tiny power supply, for example the picoPSU.
Building the case
As the MOBO is fanless, I don’t think it would be a good idea to let it locked in a box somewhere in my apartment, so I decided to build a acrylic case and leave the sides open for air circulation.
You just need to get a drill, make some holes and you are done.
There is nothing better then Linux for any kind of server, and my distro of choice is UBUNTU, quick to install, easy to configure get it running smooth.
For installing it, you could use an USB stick with ubuntu on it, and set to install from the stick, and you are good to go.
When UBUNTU was installed, internet started working right away and there was no extra driver needed, just what I like about this distro.
You may want to update the packs from your server. I like using the Terminal, you can do it simply by typing:
sudo apt-get update sudo apt-get upgrade
For downloading stuff from the internet, such as my Linux distribution, I like using torrent, the best p2p protocol ever!
I like leaving torrent open 24/7, and my choice for this task is Transmission-daemon, it runs on the background, I can access it using any Browser, iPhone using an app called iControlBits or even using a super cool and multiplatform GUI called Transmission-Gui.
For backups, I am using Super Flexible File Synchronizer, and backing up my files via SFTP.
For backup I use SSH and RSYNC via terminal. It’s simple, light weight and funcional, you don’t need to use ShareWare software for this, and the way I’m doing it, you can even backup to your server through the internet.
I am not using any RAID to clone my disks because one is 1TB and the other is 2TB, the second reason is that I don’t really need to backup all data on that disks. My main concern is Documents and Pictures, especially pictures! So these are the files I save on both drives. What i’ve done is, I always sync my files to one folder on the NAS via SFTP, then with RSYNC and Cron, everyday at 3AM, it checks if files are the same, otherwise they sync both HDs. Maybe not the best ou easiest way, but it works.
Next month I will move to Italy for one semester, and I know I will take many Gigs of pics. University’s internet connection will probably be fast, so I will backup everything from there to my NAS Server. So if something goes wrong with my files there, I will still be able to access them from home.
So, for backing up my photos via SSH to the NAS, I always want to make an exact copy of the files on my Macbook, so the code below does the job.
You can remove the -e ‘ssh -p 224’ part if your SSH uses the default port 22. And my server IP is 192.168.1.104, you should change to your IP.
rsync -av --update --delete -e 'ssh -p 224' /home/path/to/folders email@example.com:/home/path/on/SERVER/
Webmin is a great application to help you manage your server. I use it to create FTP users, manage crons and much more.
“Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.” Text from Webmin’s website. There you can find all information on how to install/configure it.
You should take a look!
I like building websites, I usually run websites on my own computer before launching it to the world. But I am enjoying more creating websites and accessing them from my NAS Servers.
To install all this, just time on terminal:
sudo apt-get install apache2 mysql-server-5.1 php5 php5-mysql php5-cli
Your default home folder will be /var/www
Right now I am using proftpd to run all my ftp file transfers (but today I usually just transfer files over SSH). You can use WEBMIN to handle the FTP, or you can follow many tutorials found on the internet. For example THIS.
To install SSH on your server, just use this:
sudo apt-get install openssh-server
A good thing to do is to change your default SSH port, it can help on the security of your server. For that, edit the config file:
[cc lang=”c”]gksu gedit /etc/ssh/sshd_config[/cc] where it says PORT 22, change to something like PORT 224.
Subsonic – Free Music Streamer
OMG, I wish I knew this software before, it AMAZING! Check the description from their website, I’m highlighting what I think amazing:
“Subsonic is a free, web-based media streamer, providing ubiquitous access to your music. Use it to share your music with friends, or to listen to your own music while at work. You can stream to multiple players simultaneously, for instance to one player in your kitchen and another in your living room.
Subsonic is designed to handle very large music collections (hundreds of gigabytes). Although optimized for MP3 streaming, it works for any audio or video format that can stream over HTTP, for instance AAC and OGG. By using transcoder plug-ins, Subsonic supports on-the-fly conversion and streaming of virtually any audio format, including WMA, FLAC, APE, Musepack, WavPack and Shorten.
If you have constrained bandwidth, you may set an upper limit for the bitrate of the music streams. Subsonic will then automatically resample the music to a suitable bitrate.
In addition to being a streaming media server, Subsonic works very well as a local jukebox. The intuitive web interface, as well as search and index facilities, are optimized for efficient browsing through large media libraries. Subsonic also comes with an integrated Podcast receiver, with many of the same features as you find in iTunes.”
Here is what I am doing, when I am home, I simply use the browser to access all my songs. As it re-sample the music files on-the-fly, I created an user that I use when I’m not home, re-sampling files to 128kbps. And when I accessing via my iPhone’s 3G network, it goes down to 64kbps (slow 3G!!!).
On my phone, I am using an App called iSub, you can configure different bit-rates if you are using Wireless or 3G, and it also caches all songs played. So I don’t need to sync songs with my iphone no more, I just listen to songs on Subsonic and then shuffle them when I on the road. I am impressed, you should check it out!
To have it up and running, there are plenty of information on the website!
Now you have some pictures of the server up and running:
If you enjoy this post, or has something to say,
just leave a commend below.
Thanks for reading 😉