View Single Post
Old 11-15-2009, 08:23 PM   #1 (permalink)
puroi
Extreme User
 
puroi's Avatar
 
Join Date: Oct 2007
Location: near me
Posts: 2,724
Thanks: 54
Thanked 173 Times in 113 Posts
Rep Power: 5
puroi is on a distinguished road
Points: 4,858, Level: 29
Points: 4,858, Level: 29 Points: 4,858, Level: 29 Points: 4,858, Level: 29
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
Default Make your own seedbox

This guide is currently a work in progress. If you notice any errors, inaccuracies or know a better way of accomplishing what I am trying to explain please PM me or comment below.

Things to Fix

- Grammar
- ...


Index
01. Credits
02. Initial Configuration
03. libtorrent, rTorrent & xmlrpc-c
04. rutorrent
05. Updating & Patching
06. rutorrent Plugins
07. apache
08. vnStat & PHP Frontend
09. vsftpd
10. Security
11. Troubleshooting


I need to credit various sources on the internet for giving me the knowlegde I needed to write this. A few months ago I knew nothing about configuring a server and everything I have learned has been from these people/sources. Thanks go to naq, EmEyKeYwAy & scribe. I have also used Google and all of the software developers websites as well as lots of patient IRC dwellers' help.


Initial Configuration

This guide assumes you know a small amount about Linux and using the command line. Having said this nothing we will do is very hard and I will make every effort to explain each step.



I assume you will begin with a stock standard Debian server install but pretty much any version of Debian and its derivatives (Ubuntu etc...) will work just fine.

The principles of what I am doing will apply to any distribution of Linux although the commands and file locations will differ.

At the end of this guide you will have a server running the latest version of rTorrent with apache serving the latest version of rutorrent. I'll also provide instructions for compiling vsftpd, a light and secure FTP server. This guide will also cover some basic security measures you can take to harden your server against bots and hackers.

You will need root access to your server, be it at home or somewhere else. We will do most of what follows as root. Be careful as you can cause mayhem!

I will assume you are interfacing with your seedbox using PuTTY (above) or a similar SSH client. I have placed the commands you need to input in [ quote] [ /quote] tags. You can literally copy and paste these into PuTTY. Note that the '#' or '$' preceding each command are not part of the command. '#' denotes that the command is done as root and '$' means it is executed as a normal user. Don't include it when you copy and paste!

Each command has its own set of tags so you don't get confused and try to run two commands at once.

Handy Hint: The default 'paste' command in PuTTY is right click. Ctrl V will not work.

First off lets make sure we are up to date.

Quote:
# apt-get update




Quote:
# apt-get upgrade
Next up we'll install the required packages for our compiling and installing what we need.

Quote:
apt-get install apache2.2-common apache2-utils autoconf automake autotools-dev binutils build-essential bzip2 ca-certificates comerr-dev cpp cpp-4.1 dpkg-dev file g g -4.1 gawk gcc gcc-4.1 libapache2-mod-php5 libapache2-mod-scgi libapr1 libaprutil1 libc6-dev libcurl3 libcurl4-openssl-dev libexpat1 libidn11 libidn11-dev libkadm55 libkrb5-dev libmagic1 libncurses5-dev libneon26 libpcre3 libpq5 libsigc -2.0-dev libsqlite0 libsqlite3-0 libssl-dev libssp0-dev libstdc 6-4.1-dev libsvn1 libtool libxml2 lynx m4 make mime-support ntp ntpdate openssl patch perl perl-modules php5 php5-cgi php5-common php5-sqlite pkg-config postfix postfix-mysql screen sqlite subversion sudo ucf zlib1g-dev


You will need to agree to any dependancies these packages may have and depending on the server's connection to the internet installation may take several minutes.

If you have no users on your system you will need to create a new one to run rTorrent. A note on rTorrent and rutorrent; they are both designed as single user systems which means that if you are setting up a box to resell or even just to share you will need to either run multiple instances or rTorrent and rutorrent (one per user) or simply have everyone use the same instance and make use of rutorrent's labelling system.

I believe the latter is better for conserving system resources but the downside is that each user will be able to see what the other is downloading and the WebUI can become quite cluttered depending on the number of users. I will provide a guide detailing how to configure a single user system which multiple users can use. If demand is high, I will add an example of how to setup a server running multiple instances of rTorrent and different versions of rutorrent for each user.

Quote:
# adduser USERNAME


You will be asked for some random information about your user. You can add whatever information you'd like. Now we'll create the needed directories.

Quote:
# mkdir /home/USERNAME/downloads
Quote:
# mkdir /home/USERNAME/watch
Quote:
# mkdir /home/USERNAME/.rtorrent
Quote:
# mkdir /home/USERNAME/.rtorrent/session
Lets give the correct permissions to our user.

Quote:
# chown USERNAME -R /home/USERNAME/


You're now ready to install rTorrent.


libtorrent, rTorrent & xmlrpc-c

Now we will compile the latest versions of libtorrent and rTorrent. rTorrent can also make use of xmlrpc-c as well so we'll compile it too. I usually compile software in /usr/local/src/ but where you compile source is up to you.

xmlrpc-c

Quote:
# cd /usr/local/src/


Quote:
# mkdir xmlrpc-c
Quote:
# cd xmlrpc-c/
Quote:
# cd stable
Quote:
# ./configure --disable-cplusplus
Quote:
# make
Quote:
# make install
Quote:
# cd /usr/local/src/
libtorrent

Quote:
# svn co svn://rakshasa.no/libtorrent/trunk/libtorrent


Quote:
# cd libtorrent/
Quote:
# ./autogen.sh
Quote:
# ./configure
Quote:
# make
Quote:
# make install
Quote:
# cd ..
rTorrent

Quote:
# svn co svn://rakshasa.no/libtorrent/trunk/rtorrent
Quote:
# cd rtorrent/
Quote:
# ./autogen.sh


Quote:
# ./configure --with-xmlrpc-c
Quote:
# make
Quote:
# make install
These programs can take some time to compile depending on your hardware.

After all that we should update some shared libraries:

Quote:
# nano /etc/ld.so.conf
Add the text "include /usr/local/lib/" to the file (without the quotation marks) and save and exit. To save in nano is Ctrl O and to exit is Ctrl X.



Update the system libraries.

Quote:
# ldconfig
Congratulations! Assuming all went well you now have a brand new rTorrent installation. Lets configure it.

Quote:
# nano /home/USERNAME/.rtorrent.rc


There are several dozen options you can play with in rTorrent. Take a look over here for the full list.

Here is an example rTorrent configuration file. You can copy and paste it into nano if you'd like.

[quote]# SCGI Settings

scgi_port = 127.0.0.1:7001
__________________
Oi! Oi! Oi!


Last edited by puroi; 11-15-2009 at 08:27 PM.
puroi is offline   Reply With Quote