pancakelizard

set up a HP Microserver with Ubuntu and everything you need

Posted on February 17, 2012

this isnt the final version of this, but it has been sat here for a while, so figured i should at least share my initial progress on it

So i bought a HP microserver. loaded it full of drives and stuck ubuntu server on it. below is a bit of a HOWTO/build script. DO NOT RUN IT AS A SCRIPT. it will not work. instead read through it and do it by hand in chunks. you WILL need to change some stuff.

but it should give you a good start into building your own with sabnzbd, sick beard, squeezebox server, and loads more. Since doing this, i have moved from greyhole to GLUSTER as my JBOD filesystem as well as installing AFP as samba performance on my mac was poor. I'll get round to finishing it off at some point...

enjoy!

 

################################################ ubuntu 11.04 server setup:

select region/keyboard settings as needed
enter servername. in this case i am using "microserver"
disk setup as appropriate (i used guided with lvm) and
set up username/password (in my case i used "wanye" and dont encrypt your home folder
enter proxy information if necessary
select "install security updates automatically"
select "OpenSSH server" from the list of server modules to install (we will install the rest later as we need them)
remove cd/usb and reboot when completed
log in and find the ip address of the server (in my case 192.168.1.238)
config files needed:
/etc/lighttpd/lighttpd.conf
/root/.rtorrent.rc
/var/www/rutorrent/conf/config.php
/etc/default/sabnzbdplus
/home/wanye/rtorrentInit.sh

(optional) binary files needed:
squeezeboxserver_7.6.1_all.deb (or latest version from mysqueezebox.com)

(optional) web server frontend link page:
index.html
icon-webmin.png
pixel.png
rtorrent.png
rutorrent.png
sabnzbd.png
sickbeard.png
squeezebox.png
(to be copied to /var/www once completed)
################################################ network config and initial setup

#set up static IP address instead of DHCP and add hosts entries
sudo nano /etc/hosts
-------------------
127.0.0.1 localhost microserver
192.168.1.250 microserver
192.168.1.10 nas #This is optional and depends on your personal setup
-------------------

sudo nano /etc/network/interfaces
-------------------
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.250
netmask 255.255.255.0
gateway 192.168.1.1

-------------------

sudo nano /etc/resolv.conf
-------------------
### ensure your DNS servers are listed
192.168.1.1
194.168.4.100
194.168.8.100
-------------------

################################################ reboot
sudo shutdown -r now
################################################ install additional modules needed for things
sudo apt-get install git-core python smbfs subversion libncurses5-dev libsigc++-2.0-dev libcurl4-openssl-dev build-essential screen wget unzip unrar php5 pkg-config libperl-dev libterm-readline-gnu-perl php5-cgi php5-curl php5-cli ffmpeg

################################################ mount samba share on NAS/server
sudo mkdir /mnt/nas
sudo nano /etc/fstab

##### add in the following
//nas/share /mnt/nas cifs guest,uid=1000,iocharset=utf8,codepage=unicode,unicode 0 0

sudo mount -a
################################################ install webmin
sudo nano /etc/apt/sources.list

add the following to the bottom:
-------------------
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
-------------------

wget http://www.webmin.com/jcameron-key.asc

sudo apt-key add jcameron-key.asc
sudo apt-get update
sudo apt-get install webmin

sudo nano /etc/webmin/miniserv.users
##### add your username to list
sudo /etc/init.d/webmin restart

try logging into https://192.168.1.250:10000/ as your user

################################################ install rtorrent and gui
sudo apt-get install lighttpd
sudo nano /etc/lighttpd/lighttpd.conf
OR
sudo cp /home/wanye/lighttpd.conf /etc/lighttpd/lighttpd.conf
sudo /etc/init.d/lighttpd restart
##### add settings as required for rtorrent

# create download directory for rtorrent
sudo mkdir /data /data/torrentdownloads /data/torrentdownloads/.session

### compile libtorrent from source
cd /tmp
sudo wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.9.tar.gz
sudo tar zxfv libtorrent-0.12.9.tar.gz
cd libtorrent-0.12.9
sudo ./configure
sudo make
sudo make install
### compile xmlrpc-c from source
cd /tmp
sudo svn checkout http://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable xmlrpc-c
cd xmlrpc-c/
sudo ./configure
sudo make
sudo make install
### compile rtorrent from source
cd /tmp
sudo wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.9.tar.gz
sudo tar zxfv rtorrent-0.8.9.tar.gz
cd rtorrent-0.8.9
sudo ./configure --with-xmlrpc-c
sudo make
sudo make install

sudo ldconfig

### install rutorrent and plugins from svn

cd /var/www/
sudo svn co http://rutorrent.googlecode.com/svn/trunk/rutorrent
sudo svn up
### plugins dl
cd /var/www/rutorrent/
sudo rm -rf plugins/
sudo svn co http://rutorrent.googlecode.com/svn/trunk/plugins/
sudo svn up

### configure rtorrent
sudo nano /root/.rtorrent.rc
OR
sudo cp /home/wanye/.rtorrent.rc /root/.rtorrent.rc

sudo nano /var/www/rutorrent/conf/config.php
OR
sudo cp /home/wanye/config.php /var/www/rutorrent/conf/config.php
sudo chmod -R 747 /var/www/rutorrent/
sudo chown -R www-data:www-data /var/www/rutorrent/share/
sudo /etc/init.d/lighttpd restart

#### set it to autostart on reboot
sudo cp /home/wanye/rtorrentInit.sh /etc/init.d/rtorrent
sudo chmod +rx /etc/init.d/rtorrent
sudo update-rc.d rtorrent defaults

#### install mediainfo module for rutorrent plugin
sudo apt-get install --reinstall python-software-properties && sudo dpkg-reconfigure python-software-properties
sudo add-apt-repository ppa:shiki/mediainfo
sudo apt-get update
sudo apt-get install mediainfo

################################################ reboot and test rtorrent autostarts ok
sudo shutdown -r now
################################################ install sabnzbd, sickbeard, couchpotato and usenet tools

# install sabnzbd
echo "deb http://ppa.launchpad.net/jcfp/ppa/ubuntu $(lsb_release -c -s) main" | sudo tee -a /etc/apt/sources.list && sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:11371 --recv-keys 0x98703123E0F52B2BE16D586EF13930B14BB9F05F
sudo apt-get update
sudo apt-get install sabnzbdplus
sudo nano /etc/default/sabnzbdplus
##### set up sab config

/etc/init.d/sabnzbdplus start

------------------------------
# [required] user or uid of account to run the program as:
USER=wanye

# [optional] full path to the configuration file of your choice;
# otherwise, the default location (in $USER's home
# directory) is used:
CONFIG=

# [optional] hostname/ip and port number to listen on:
HOST=192.168.1.250
PORT=8080
-------------------------------

####### point your web browser at http://192.168.1.250:8080 and follow setup instructions
# install couchpotato movie grabber
cd /usr/local/sbin
sudo git clone http://github.com/RuudBurger/CouchPotato.git
sudo mv CouchPotato couchpotato
cd couchpotato
sudo python CouchPotato.py -d
cd /usr/local/sbin/couchpotato
sudo cp initd /etc/init.d/couchpotato
sudo chmod a+x /etc/init.d/couchpotato
sudo update-rc.d couchpotato defaults
sudo /etc/init.d/couchpotato start

####### point your web browser at http://192.168.1.250:5001 and follow setup instructions

# install sickbeard tv grabber
sudo apt-get install python-cheetah
git clone git://github.com/midgetspy/Sick-Beard.git my-sickbeard-install
python SickBeard.py

################################################ install squeezebox server
sudo dpkg -i squeezeboxserver_7.6.1_all.deb

####### point your web browser at http://192.168.1.250:9000 and follow setup instructions
################################################ install greyhole for later use
wget https://github.com/downloads/gboudreau/Greyhole/greyhole-0.9.12-1.amd64.deb
sudo apt-get install samba
sudo apt-get -f install
sudo dpkg -i greyhole-0.9.12-1.amd64.deb

################################################ reboot
sudo shutdown -r now

copy web frontend links to /var/www - index.html and shortcut icons
point web browser at http://192.168.1.250 and ensure tall the links work ok.