Meta

Month: February 2014

I’ve been using one of my PI’s as a torrent server for some time. Recently I decided to refresh the entire system. This will NOT go into the legalities of downloading anything, I expect everyone to only be using this for downloading raspberry images 🙂

# Enable DHT support for trackerless torrents or when all trackers are down.# May be set to "disable" (completely disable DHT), "off" (do not start DHT),# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).# The default is "off". For DHT to work, a session directory must be defined.## dht = autodht = off

## Do not modify the following parameters unless you know what you're doing.#

# Hash read-ahead controls how many MB to request the kernel to read# ahead. If the value is too low the disk may not be fully utilized,# while if too high the kernel might not be able to keep the read# pages in memory thus end up trashing.#hash_read_ahead = 10

# Interval between attempts to check the hash, in milliseconds.#hash_interval = 100

# Number of attempts to check the hash while using the mincore status,# before forcing. Overworked systems might need lower values to get a# decent hash checking rate.#hash_max_tries = 10

# Start The Plugins when Rtorrent Starts not when the page is first opened. If apache service is restart separately the plugins are likely to be stopped. Only really needed for RSS feeds.execute = {sh,-c,/usr/bin/php /var/www/php/initplugins.php &}

Save and Exit (ctrl+x then y then enter)We now need to perform a test run of rtorrent.

rtorrent

It should start without any problems. You may get a few warnings inside rtorrent, but it should still be running. To Exit press ctrl+q.You should now exit the rtorrent user.

exit

Finally we’re going to setup rtorrent to automatically start when the PI is powered up.

nano -w /etc/init.d/rtorrent

Copy and Paste the Following:-

#!/bin/bash

# To start the script automatically at bootup type the following command# update-rc.d torrent defaults 99

And that’s it. You could now start rtorrent using “/etc/init.d/rtorrent start”, but it’s just as easy to reboot and test that the startup scripts runs. Once you’ve reboot or started rtorrent you can access the webpage at http://{ip-address or name} Notes:-

This setup is meant to run internally, as such there is no security on the apache setup.

Personally I forward ports 51515-51520 on the router onto the PI, this makes a difference in download speed (much quicker) but as it's opening ports it's a security risk so you'll have to decided whether or not to.

I run this setup behind a vpn using ipredator.se, if there's any demand I'll write up another guide on how to configure that and ensure your traffic is locked to only go over the vpn.