Tuesday, 6 November 2012

Setting up my Home Server

Setting up my Home Server


I do not accept responsibility for any issues arising while using information provided below. There may be errors in what I have typed. If you get stuck, google can help you find solutions, or check out linux forums. These notes are mostly for myself but I am happy to share them with others wanting to try running their own home server.

If you have software raid hard-drives, remove them before installing the operating system – when rebuilding my system, I kept having a very annoying error – the operating system wouldn’t run, until I removed the raid drives and reinstalled the operating system.


  • HP ProLiant N36L MicroServer AMD 1.3GHz CPU, 1GB RAM, 250GB HDD  $250 from Megabuy
  • 2x Western Digital WDC WD20EARX-00P  2 TB hard-drives (this was set up in a raid 1 array using software raid – basically mirroring each other in case of one drive failing)
  • surge protector ($30)
  • Lan cat 5 cable (Jaycar $20)
  • Existing router


Operating System

1.             Get your operating system image and create a usb boot disk (as the server didn’t have a disk drive)

2.             for UserOS, install third party software and download updates while installing if connected to the internet (UserOS can be upgraded, but don’t allow partial upgrades as it will cause problems)

3.             set timezone, keyboard (mine is US). Set it to log in automatically. Do not allow ‘encrypt home folder’

4.             Wait for install to finish

5.             Unplug usb boot drive, and reboot (force if necessary)

Set up VNC

(for local remote access – not to be used over the internet without tunnelling through SSH as passwords are sent unencrypted)

a)      Applications, settings, remote desktop setup

b)      Set ‘allow other users to access’

c)      Untick ‘you must confirm each access’

d)      Require the user to enter password, then close

e)      Settings, launch remote desktop server.

f)        Add to Applications, settings, settings manager, startup-> “/usr/lib/vino/vino-server &” (without quotes)

g)      reboot

Attempt access to server from another computer on the network using tightVNC (this is assuming you know your server’s IP address – I set up my router to provide a ‘static’ address for my server so it stays the same)

Installing Raid drives

(assuming that they have been already formatted correctly)

1.      Shutdown and install raid drives, reboot. Drives should be autodetected if they’ve been setup previously.

2.      Set raid to automount on boot. From a terminal window->  #sudo leafpad /etc/fstab

3.      The raid on my device was /dev/md127 so I added the line to fstab
/dev/md127   /media/raid   auto   user  0  0

Desktop Preferences

If desktop preferences disappear, remove line ‘only show in GNOME.unity’ from:  #sudo leafpad /usr/share/applications/vino-preferences.desktop   and add line Name=Remote Desktop Setup

Sharing folders

To share a folder (samba is required to share folders with Windows computers), right click on the folder and select ‘sharing options (eg, I allow guest access to my raid drive. May need to type #sudo nautilus into a terminal window to get enough privileges

Lock on boot

(screensaver setup). Applications, settings, settings manager, screensaver. Tick ‘lock screen after 0mins’, set screensaver to kick in after a few minutes of non use. Then Sessions & Startup, Add to application on autostart   “xscreensaver –nosplash”  without the quotes and “xscreensaver-command –lock” 

Power off button

To switch off when power button is pressed, in Session & Startup, ensure ‘log off required’ is unticked. Also in Settings Manager, Power Manager, click the down arrow next to ‘when power button is pressed’ to show ‘shutdown’


1.      BackupPC used to automatically back up other computers documents. Default location is accessed via LAN internet browser pointing to http://server-ip-address/backuppc  where server-ip-address is the local address of your server. Username is backuppc and password is backuppc (this can be changed)

2.      If backup (using backuppc) already exists on another drive, set up a soft link from /var/lib/backuppc after renaming the existing backuppc folder to backuppc-old (backuppc server needs to be stopped first though)

3.      #sudo /etc/init.d/backuppc stop

4.      #sudo cp –dpR /var/lib/backuppc/. /media/raid/backuppc (or wherever you have your backup files – this copies the required files from the existing backuppc folder)
#sudo mv /var/lib/backuppc  /var/lib/backuppc.orig  (rename the existing backuppc folder)
#sudo ln –s /media/raid/backuppc  /var/lib/backuppc  (link from the backuppc folder to your backup on another drive)

5.      Create a non-admin user called backuppc on the computer you want to allow backups from. Create a password for the account. You can hide the account from other users – just google ‘disable or enable user account in Vista’ (or whatever your operating system. Vista64 has a good tutorial for Vista users.

6.      Share the folder that you want to backup and add backuppc as a user with access permissions.

7.      Then at http://your-server-ip/backuppc   create a host at the IP address of the computer you want to have backed up (I set up my computers with a static IP address using the settings in my router). Edit the config for the host. Click on xfer. Change smbshare name to the name of folder on the pc that you shared and want to backup.

8.      Change SmbShareName to backuppc and passwd to the password you want it to use to access the share (what you set up on the pc)

9.      Change schedule if you want – period is in days. Click on name links for more info. Click Save to keep any changed settings.


(irrigation controller program available from quicksmart.com )

  1. To set up Optirain, a LAMP server is required. Specifics are:
    1. PHP 5.25+
    2. PDO support
    3. PDO driver for sqlite3 enabled
    4. Sqlite support enabled
    5. Sockets support enabled
  2. to test if your server is set up correctly, create a file called phpinfo.php and place in your /var/www folder. In the file, type in “” without the quotes. Access the file using an internet browser, pointed to http://your-server-ip/phpinfo.php
  3. If it is not, type #sudo apt-get install php5-sqlite
  4. Copy the Optirain files to your /var/www folder
  5. set ownership on the folder #sudo chown –R www-data:www-data /var/www
  6. set permissions #cd /var/www     then
    #sudo find . –type f –exec chmod 664 {} \;
    #sudo find . –type d –exec chmod 775 {} \;
  7. Access via http://your-server-ip/   You should be presented with the Optirain window. If not, check your server settings and file locations.
  8. Click ‘continue’. Setup EtherRain (edit device) – it should automatically appear if it is found on your network. Try rebooting the device if Optirain can’t find it). Select the device. Password is pw
  9. Give each zone a name (if you leave a zone with a blank name, it will ignore any after it)
  10. Submit, and test with a Quick Cycle
  11. Setup weather using codes found at weather.yahoo.com – the code is found on the rss link. The code for Ellendale was ASXX0329 – and uses the weather station info at Bushy Park – not exactly local, but local enough.
  12. Setup schedules from Home – show schedule, setup.


(UPnP MediaServer): setup is at http://your-server-ip:49152 

Mail setup

(any cron jobs having problems will be emailed to you)

  1. #sudo apt-get install ssmtp
  2. #sudo leafpad /etc/ssmtp/ssmtp.conf
  3. type in: 
    mailhob=smtp.mailserver.com:465 (whatever your smtp mailserver is eg bigpond or gmail)
    rewrite domain=address.com  (gmail, etc)
    Authuser = username (your username for email)
    Authpass = password (your password for email)
  4. test your email (see https://wiki.archlinux.org/index.php/SSMTP )

Some useful linux commands using a terminal window

sudo command --- where command is the action you want, sudo elevates the command to root user for elevated privileges (for when the command requires it)

ps aux | less ---- displays all running processes
leafpad --- a text editor (there are several – use in place of nano)

nautilus --- file manager (type in sudo nautilus from the command line to get root privileges on the file manager)

sudo su  --- all commands are now elevated to root user. Can be dangerous if you don’t know what you are doing.

sudo !!  --- gives root permission to the previously entered (and denied) command

ls --- list files in a directory

No comments: