Intro
This guide covers how to set-up an Ubuntu based media download server. it includes the ability to download podcasts and and torrents, runs without an native GUI and is based on management through web interface. This guide is Written in noobs in mind so it is built as a step by step tutorial.
note: In this tutorial I don’t try to achieve a secure server (hence the liberal use of chmod 777) and the smb.conf file is much to be desired but it works and it is the simplest way I found to do this.
Installation and set up of Ubuntu server
Install Ubuntu server, for better performance when partitioning disks choose:
guided - use??entire disk
And at the question about encrypting the home directory choose NO.
After the system finished installing log in and enter the following (when prompted enter password) :
sudo apt-get??update
This will update the list of packages.
sudo apt-get??upgrade
This will update the Ubuntu.
Install OpenSSH server:
sudo apt-get install ssh
You can now control the server from any computer on your network through SSH(using terminal on linux1 or a software like PuTTY on windows). you can also access and edit the files from another computer by logging in through SFTP using the connect to server feature in ubuntu (Places -> connect to server -> set service type to SSH and fill out the IP address of the server and and the appropriate username) and in Windows by using FileZilla. It is also recommended to reserve the IP address for the server in your router.
Now install the LAMP stack by typing:
sudo tasksel install lamp-server
When prompted for mySQL password choose a password (it will be used as the password for mySQL root user). And then install
phpmyadmin by typing:
sudo apt-get install phpmyadmin
When prompted for server choose apache, at the first password prompt enter the mySQL password you chose earlier and the second password prompt choose an password for phpmyadmin.
Prepare folders
A few folder needed to be prepared before the application could be installed. prepare an files folder in you user
directory by typing (and replacing username the actual username):
mkdir??/home/username/files
And the permissions of the folder needs to be changed by typing:
sudo chmod 777??-R /home/username/files
File manager installation
The file manager for this server will be File Thingie. First of all download it, go the file thingie web site at this address: http://www.solitude.dk/filethingie/ and hit the download button select personal use and fill out your information, an link to download the software will be sent to your email. When received hit the link please notice that an webpage will open and the file might start to download automatically – ignore this instead put your cursor on the link that says “click here to start the download manually” and write down the link that appears in the status-bar.
Now go to the server and type:
sudo chmod 777 /var/www
cd /var/www
sudo apt-get install unzip
wget (the URL you wrote down)
ls
you should have an list of files, one of them is a long series of numbers and letters, write them down and type:
unzip (the filename you wrote down)
rm (the filename you wrote down)
now you should have a ft2.php file in your www directory.
sudo chmod 777 -R /var/www
sudo nano ft2.php
go to the lines that say:
define(“USERNAME”, “”); // Your default username.
define(“PASSWORD”, “”); // Your default password.
and define a username and password for file thingie by entering them in the empty brackets.
Also edit the line that says:
$ft[“settings”][“DIR”] = “.”; // Your default directory. Do NOT include a trailing slash!
and change the “.” to “/home/username/files”. edit the rest of the file to your needs and when finished hit Ctrl X you will be asked “change modified buffer?” hit Y and then Enter.
login from a browser to http://IPofserver/ft2.php to confirm the file manager works.
Install Podget podcatcher
Podget is a podcatcher that is optimized for running as a scheduled background job.
type:
cd /home/username
sudo apt-get install podget
podget
podget will start to download files as a self test, wait until all files finished downloading or abort the process by hitting Ctrl C. to configure Podget type:
cd .podget
mkdir /home/username/files/podcast
sudo chmod 777 -R /home/username/files
sudo nano podgetrc
change the value of “dir_library=” to /home/username/files/podcast
change the value of “most_recent=: to 1 – this change make so only the one most recent file will be downloaded.
change the value of “cleanup=” to 1 – makes so every time podget runs it deletes old files.
change the value of “cleanup_days=” to what ever number you want -this value tells podget for how many days to keep a file before it considered an old file.
hit Ctrl X.
to configure the list of podcasts type:
sudo nano serverlist
Delete everything under line 9 (not including) and edit the file, the instruction to how to edit it are written in the file itself, but basically put one URL to the RSS feed of a podcast (audio or video) per line.
hit Ctrl X
Now we need to install an monitor for Podeget (so you will be able to see what files are downloaded). To do that type:
cd /home/username
mkdir /home/username/temp
cd temp
wget http://downloads.sourceforge.net/project/getid3/getID3%28%29%201.x/1.7.9/getid3-1.7.9.zip
unzip getid3-1.7.9.zip
mkdir /home/username/files/getid3
cd getid3
cp getid3.php /home/username/files/getid3
sudo chmod 777 -R /home/username/files
cd /var/www
wget??http://downloads.sourceforge.net/project/phpppl/PHP%20Podget%20Podcast%20Lister/PHPPPL%200.2/podcastList-0.2.php
sudo nano podcastlist-0.2.php
make sure the value of $dir = is set to “.”
edit the value of $getID3path = to “/home/username/files/getid3/getid3.php”;
hit Ctrl X
To monitor podcasts a simlink needs to be created so type:
cd /var/www
ln -s /home/username/files/podcast /var/www/podcast
The last thing you need to do is set up Podget to autostart using cron. In this example we will set it to run every hour at the top of the hour, if you want to set it differently consult with the Ubuntu documentation about cron at this link:https://help.ubuntu.com/community/CronHowto and Cron job script calculator.
To set cron type:
crontab -e
select 2 (will select nano editor)
edit as follows:
# m h dom mon dow command
* 6 * * * /usr/bin/podget -s
hit Ctrl x.
Install qBittorrent
qBittorrent is an open source Bittorrent client that mimics the functionality of uTorrent closly and can be run without an GUI, control over the software achieved through a feature rich web interface. To install and set up qBittorrent type:
cd /home/username
mkdir /home/username/files/torrents
chmod 777 -R /home/username/files
sudo apt-get install qbittorrent-nox
Now if you want you can set up so qBittorent will download torrents automaticlly through rss. type:
cd .podget
sudo nano serverlist
and add the URL’s to the torrent RSS feeds and set their category as torrents without giving each URL an separate name.
hit Ctrl X to save and then type:
qbittorrent-nox
read the disclaimer and hit Y
login to http://IPofserver:8080 with username “admin” and password “adminadmin”, go to options -> prefrences and in the Web UI tab change the username and password to something different. In the Downloads tab in the watched folder text box enter /home/username/podcast/torrents. Edit the rest of the options as needed.
The next step is to make qBittorrent auto start, for that type:
cd /home/username/temp
wget??http://launchpadlibrarian.net/38905385/qbittorrent
sudo nano qbittorrent
edit the line that says USER=[USERNAME] to USER=[your actual username]
cp qbittorrent qbittorrent-nox-daemon
sudo cp qbittorrent-nox-daemon /etc/init.d
sudo chmod 755 /etc/init.d/qbittorrent-nox-daemon
sudo update-rc.d qbittorrent-nox-daemon defaults
Install SAMBA sharing
Samba is a piece of software that allows computers to share files and printers between them.
It implements the SMB protocol in UNIX and UNIX like systems and originally is used for Microsoft file and printer sharing. To set up SAMBA type:
sudo apt-get install samba
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak -this
command creates an backup of the smb.conf file
sudo nano -w /etc/samba/smb.conf
delete everything and enter the following:
[global]
encrypt passwords = yes
netbios name = the name of the server
workgroup = WORKGROUP
server string = media server
security = share
dns proxy = no
# Settings to enhance performance:
use sendfile = yes
strict locking = no
read raw = yes
write raw = yes
oplocks = yes
max xmit = 65535
deadtime = 15
getwd cache = yes
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=16384 SO_RCVBUF=16384
# Everything below this point are network shares, if you want to share more than one folder
# add than copy and paste the section below and edit accordingly
[the name of the share]
comments = put comment here
path = path to the folder you want to share (Example:/home/shaul/files/podcast)
writable = yes
guest ok = yes
The parts in Bold are the parts you want to edit,
hit Ctrl X to save
Now restart SAMBA by typing:
sudo /etc/init.d/samba reload
If the first command doesn’t works try:
sudo smbd reload
If you can’t see the shared folder try changing the line workgroup = WORKGROUP to workgroup = MSHOME
Install UPNP server
A UPNP is a protocol that allows compatible devices to connect to each other simply.
To give our server this functionality an UPNP server called MediaTomb will be installed by typing:
sudo apt-get
install mediatomb
You can access the management interface of mediatomb by going to http://IPofserver:49152
when there click on filesystem on the top right find your’s /home/username/files folder and then click the plus with arrows button, set the scan mode to timed the scan level to basic and mark the recursive option hit set and wait for the server to finish updating. You can see all the files being shared by the server by clicking the database link on the top right.
And thats it now you have an working server that will automatically download your podcast and torrent files and share them on your network. enjoy.