Instructables

Ultimate Pi Home Server

FeaturedContest Winner
Picture of Ultimate Pi Home Server
100_2820.JPG
100_2900.JPG
100_2817.JPG
100_2816.JPG

Welcome reader.

First please note: This instructable can be done within a day, but a weekend is certainly recommended.

In this instructable I hope to teach you key skills involved with setting up and configuring a Linux Server. The knowledge used here can be applied to almost all PC architectures so if you don't own a Pi
(Why not dude?) or it's tied up in another project, any old or unused PC will work. In more detail the main skills taught will be:

  • Burning an ISO image to an SD for the Pi
  • Installing an OS
  • Setting up A web server
  • Setting up An SQL instance
  • Deploying a custom cloud network
  • Managing users for the cloud network
  • Setting up a SAMBA File sharing network, which will integrate into an established windows based home or office network
  • Controlling SAMBA users
  • Establishing a static IP whilst using a non-static IP internet connection
  • Using Webmin Console to install packages
  • Using Command line terminal to install packages
  • Carrying out basic commands such as rebooting (terminal)
  • Editing system files with Nano terminal based editor
  • Permanently mounting hard drives within the Linux file system table via webmin
  • Understanding the principal of the Port forwarding function on a home router
  • Setting up a web interfaced bit torrent manager
  • Being an overall IT nerd.

If you're interested then carry on reading. If not, give it a try; you may discover a new hobby.

As the above list demonstrates there's a lot to learn. I definitely feel this is a weekend project. I've followed this process several times and it takes a couple of days at least. Its good to take long breaks because your eyes may begin to become strained and you may suddenly become unenthusiastic about the whole thing.  This instructable offers functions of many different store purchasable products, such as:

The server we'll setup will cost far less than each of these services in the long run and only a fraction of the cost of the combined services. Setting up your own server is not only custom and cheap, its very rewarding. I will be a happy guy if somebody benefits from what this instructable contains or become inspired by what I have done. It took ages to plan and write this instructable. If you learn anything at all or feel this instructable is well written or well documented, please vote for me in the Weekend Projects Contest or the I could make that contest.

I would also like to point out that this is not a comprehensive tutorial on designing a server case. There are details of my case on step 3, however this guide is intended to be a comprehensive software tutorial. So if you get stuck or feel a step isn't too clear, just let me know and i'll be happy to help.

A few tips: Because this takes more than one day, don't just fall asleep and forget what you were planing on doing next. Instead have a pile f post-it notes. This way before you ZzZzzzz... you can jot down anything that needs doing during the next session. I had loads. All over the walls, floors, chairs, desks - you name it! Okay slight exaggeration, but on a serious note they do help. I did use a full stack.  Another tip would be to follow the steps on order. Don't just think "Hmm I like the sound of my own cloud network lets do that first!" The steps are in such an order that each before is most likely required for the current, if that makes sense. Just stick to the order, it'll make life easier. A final tip: don't be limited to what is taught here. Do Think of this as a base for inspiration. Adding more services such as those listed on the turnkey website is easily done using the search APT function within the Webmin Package manager.

Okay, Confused? Then let's learn...
 

 

 Caution! This instructable contains 30 steps. Proceed at your own risk. 

 
 
Remove these adsRemove these ads by Signing Up

I'm having difficulty booting with this image file. I've read that older software ( from before Sept. 2013) is problematic with newer boards . Has anyone successfully booted using this image file with a newer Raspi?

I'm seeing the single green LED blink described here:

http://elinux.org/R-Pi_Troubleshooting#Red_power_LED_is_on.2C_green_LED_does_not_flash.2C_nothing_on_display

I'm not sure if this causes problems later (as I'm having HD mounting problems now), but I was able to replace the boot files with these: https://github.com/raspberrypi/firmware/tree/master/boot

Yeah, I'm at the HD mount stage now and running into the next set of errors folks have encountered.

What you need is to fix the boot files before you put the card back into your pi. Download these: https://github.com/raspberrypi/firmware/tree/maste...
and drop them into the root folder replacing the other boot files.

Arizno10 days ago

Well done, you put a bunch of effort into it. Just finished mine. It only took me a week ;)

diy_bloke7 months ago
Really great instructabel.
Too bad though that at least for me it was not entirely without problems:
Near the end of the install of the OS when i had to chose for automatic setup of DHCP or manual Static IP, choseing the DHCP gave an error that it was refusinf to write to /etc/network/interfaces and that 'a header was missing' solved that by givint that file write access to everyone (on a different machine).
odd, that should not happen

Also the upgrade of Webmin was not without errors (PID 2457 drom file.... not valid) but that seems to be some webmin bug.

Got to love webmin though. Great tool
shmaic diy_bloke2 months ago

Could you please help me configuring the propper file permission? I can also reach that file from my other machine, but no permission edit did help. I also changed the permission on the whole folder. I have exactly the same problem - refusing to blabla.. and header missing blabla...

I don't quite get why it doesn't work on clean install. Maybe manual Interface file editing would help???

Thanks a lot in advance.

diy_bloke shmaic2 months ago

sure. what exactly seems to be the problem. what files/directories are we talking about

shmaic diy_bloke2 months ago

Hello. Thank you for response. Once I boot into installed Raspbian it says that networking is not yet configured, so i must choose either static ip or dhcp. But neither of them work, it says that it refuses to write to etc/network/interfaces and something about incorrect header. So I guessed it is permissions problem, but after switching everything to rwx on other machine it still says this error:(

diy_bloke shmaic2 months ago

Here are two screenshots that show my privileges. that may help you along. one is from the folder and the other for the file

Screenshot from 2014-02-13 19:07:52.pngScreenshot from 2014-02-13 19:05:59.png
shmaic diy_bloke2 months ago

I reproduced the error and made 3 pictures.

  1. selector of interface
  2. selector of dhcp/static
  3. the error itself, no matter on choices from prev steps.
IMG_20140214_102601.jpgIMG_20140214_102608.jpgIMG_20140214_102614.jpg
Arizno shmaic17 days ago
(removed by author or community request)
Arizno Arizno10 days ago

Make sure your /etc/network/interfaces file has the following words in the first line:

# UNCONFIGURED INTERFACES

could you send me a picture of what exactly you typed into /etc/network/interfaces ; becouse after i did what you eaid, igot an error saying : "non existing exitcode.." and so on

ARGH! Sorry Rob, please type the following.

# UNCONFIGURED INTERFACES (in the first line)

My phone must have spelled checked it since unconfigured is not really a word.

First of all thanks for the reply, but now i'm wondering why i didn't see it myself. ^^

No worries, thanks for asking the question. It mad me realize the error in spelling. Did it work for you at least?

Yeah that worked fine so far. But as i went on i got an error while trying to mount my HDD in webmin.
The error was this one:"Failed to save mount : Mount failed :
libkmod: ERROR ../libkmod/libkmod.c:554 kmod_search_moddep: could not open moddep file '/lib/modules/3.10.34+/modules.dep.bin'
fuse: device not found, try 'modprobe fuse' first"
diy_bloke shmaic2 months ago

you say you gave rwx to everything, but did you give it to everybody?

shmaic diy_bloke2 months ago

Bloke, thank you for your replies.

I send attached pictures of my config of those files.

Im having bad feeling this has something to do with something completely else. Would you kindly send your interfaces file with only automatic dhcp configured? Maybe this would show if the problem is in permissions. Also is there an option to skip this network test?

One last question - the author do not mention: When i set the networking (step 6), should i have the lan cable plugged into PI or not? I've tried it both ways.

Snímek obrazovky pořízený 2014-02-14 10:03:43.pngSnímek obrazovky pořízený 2014-02-14 10:02:48.pngSnímek obrazovky pořízený 2014-02-14 10:02:01.png
diy_bloke shmaic2 months ago

My Polish is a bit rusty so some of yr pics tell me little.

This is the content of my interface file:

auto lo
iface lo inet loopback

iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet manual

wpa-roam etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

I have left the cable plugged in

shmaic diy_bloke2 months ago

So right at the install phase the cable is plugged, right? I'll try to use this after weekend as i dont have hdmi at home at right now has the weekend landed:-) tahnks for support.

btw its czech :-)

diy_bloke shmaic2 months ago

yes that is how I did it :-)

Good luck
Czech? well that explains even more that I could not read it :-)

diy_bloke shmaic2 months ago

yes that is how I did it :-)

Good luck
Czech? well that explains even more that I could not read it :-)

Thought I'd add something to that diy_bloke for the benefit of others. The message "refusing to write to /etc/network/interfaces... header was missing" may also appear with physical network or adaptor problems. Check the send/receive LEDs are lit on the Pi. If not, make sure the network cable is known to be working and connected. If using DHCP, ensure you have enough addresses. If using static, check you have entered the right IP, Subnet Mask, etc. Also, make sure your router/firewall isn't filtering MAC addresses and such.
Thanks for adding. That was all in order, but as said, just giving some write access fixed it :-) and after sorting out some other problems it all worked perfectly
DrWilson (author)  diy_bloke6 months ago
Sometimes Linux can be a pain in the backside. You have to admit however, that is a great feeling once the problem has been self solved! (It was for me anyway)

Thanks
oh yes it does. I prefer linux server over windows server and the PI Home srever, once i sorted out the installation probs has been working 24/7 since
rjanssen26 months ago
I've got a problem. After configuring owncloud, i get an error message that states:
Data directory (/media/serhdd/cloud) is readable for other users

Please change the permissions to 0770 so that the directory cannot be listed by other users.

Changing nano /etc/fstab doesn't work and changing chown www-data:www-data also doesn't work.

You can't just simply change the permissions on an ntfs file system like you can with a unix based system. You will need to access the fstab file and make some changes to it. Here is a how to:

By default you can't set permissions on an NTFS formatted drive. You will need to do it with NTFS-3G by mounting it

1. Add permissions to /etc/fstab, the last line should look like this:

/dev/sda1 /media/serverhdd ntfs-3g defaults,permissions 0 0

2. Reboot your Raspberry Pi so that the drive get mounted with proper permissions:

sudo shutdown -r now

3.Now you are able to set permissions. For owncloud like this:

sudo chown -R www-data:www-data /media/serverhdd/cloud

i have the same problem can't find a solution
rikkkurd rikkkurd6 months ago
solved it:

By default you are not able to set permissions on NTFS formatted drives, but with NTFS-3G you can. Just enable it on mount.

Add permissions to the options in /etc/fstab/. It should look like this:
UUID=xxxxxxxxx /media/serverhdd/cloud ntfs-3g defaults,permissions 0 0

you can do this by typing "nano /etc/fstab" -enter

Reboot your Raspberry Pi so that the drive get mounted with permissions.
type: sudo shutdown -r now

Now you are able to set permissions. For owncloud like this:

sudo chown -R www-data:www-data /home/pi/media/owncloud/data

after this it works like a charm, but owncloud is a bit slow on a raspberyy..
hi there i tried the above steps and i am getting this error

chown: cannot access `/home/pi/media/owncloud/data': No such file or directory

do you what i am doing wrong
How to enable ntfs-3g at mount? Mine is mounted as ntfs, even tough I installed ntfs-3g.
this info is already in my previous comment:

you can do this by typing "nano /etc/fstab" -enter

Add permissions to the options in /etc/fstab/. It should look like this:
UUID=xxxxxxxxx /media/serverhdd/cloud ntfs-3g defaults,permissions 0 0

Reboot your Raspberry Pi so that the drive get mounted with permissions.
type: sudo shutdown -r now
Now you are able to set permissions. For owncloud like this:

sudo chown -R www-data:www-data /home/pi/media/owncloud/data

after this it works like a charm, but owncloud is a bit slow on a raspberyy..

too improve this you can use APC:

APC is an opcode accelerator that caches frequently used bits of PHP so it doesn't have to constantly recompile scripts (because PHP is an interpreted language). Install it with the following command and see if that helps.

sudo apt-get install php-apc -enter
DrWilson (author)  rjanssen26 months ago
That can be done in fstab (changing ntfs to ntfs-3g) via nano /etc/fstab
l0nghy4 months ago
I get error after "finish setup" showing:
Can't write into config directory 'config'
You can usually fix this by giving the webserver use write access to the config directory in owncloud

I even change the permison to 777 but still not work. What is the problem. please help

Thanks a lot
Arizno l0nghy10 days ago

are you sure your SD card partition is not full (or near full). You should check it by running the following comand in your shell in a box:

df -l

If your available space on "rootfs" or "/dev/root" is minimal you will get an error. If that is the case you will need to pug a monitor back into pi and go to Advance Menu. You should Quit out of the configuration console menu. You will then see a separate menu asking with a long list. Select the one asking you to fill the rest of your partition. This will expand the partition. Reboot.

You might need to delete owncloud and start fresh. I would also delete the user files that owncloud created just in case.

If you have additional issues please see my reply to rjansen2

colinkhalid20 days ago

You can solve the network config error by editing the /etc/network/interfaces file just after you copy the image to your SD card while it is still in the card reader attached to your PC. As root or administrator open the /etc/network/interfaces file and add the following the the top of the file # UNCONFIGURED INTERFACES

After this put the SD in the RPi and all should be well

information found here

https://github.com/turnkeylinux/confconsole/blob/master/ifutil.py

Abirboy26 days ago

this can't be helpful

aterz29 days ago

Hi,

great idea, Thanks!

I was wondering if I can use XBMC as a media server on the same installation togfheter with the webserver, the SAMBA server, the OwnCloud server....

Thank you so much!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!