As prices on VPSes and dedicated servers continue to drop, more and more people in the torrenting community are getting seedboxes. While there are many managed options out there, often the best deals are managing your own server. Setting up a seedbox is easier than ever before with how much info is freely available. All one really needs is the ability to reasonably navigate command line interface, DuckDuckGo, and patience. It also helps to get involved in a community that can help you (IRC or forum).
This is a guide to setup rtorrent with ruTorrent as a webui frontend on Ubuntu. It has been tested on 11.04 (Natty Narwhal) both Desktop and Server additions, and will be still compatible with all future versions of ubuntu. It can be easily adapted onto any distribution as well. We will also setup SSL (https), password protection using realms, and user host directories (so non-root users can host files), and I will include how to make this a multi-user setup.
SSH into your new box as root. If you need an SSH client, I would suggest KiTTY. It’s a fork from PuTTY that adds very useful features like reconnect on wake-up and transparency (true transparency, not the fake copy your background stuff).
A few possibly not so obvious things for beginners. Lines that start with pound signs (#) are comments. If they appear in the midst of commands, don’t actually paste them in the terminal, they are just instructions. However, paste them into the text documents as they are very helpful in the future. Last, make sure you replace things like <user> with the actual user name.
Let’s begin. Start off by charging your password to something you can remember
Now let’s get the system up to date
Install all the prerequisites and other useful programs
Lets setup Apache
Open up /etc/apache2/apache2.conf and scroll to the bottom and add the following. You need an SCGIMount for each user. I like to make mine be /RPCBOB (instead of RPC2/3/4) if the username is bob instead of numbers so I can remember them. You do not need one for root.
And restart it so it accepts the new changes:
Check Apache by putting “http://serverIP” into your browser
Setup Apache for SSL (HTTPS). The openssl command will ask you lots of questions about the certificate. Just put fake info in or leave everything default.
Now lets setup our virtual hosting by opening up /etc/apache2/sites-available/default
Now restart Apache again:
and verify SSL works by loading “https://serverIP” in your browser. You’ll get a warning about the certificate which is fine. (Because it is self signed.
Users
This is where I diverge from many as I like to use host folders for each individual user instead of just putting everything at /var/www/. There are many benefits to this. First, each user gets a separate copy of ruTorrent. This is a big deal as I’ve had users break their ruTorrents beyond recovery. If everyone is on the same ruTorrent, this causes a huge problem. Also, this way each user can also host files instead of only root. To setup individual user host directories just enable the module.
Now we create the apache configuration for the user’s directories: vi /etc/apache2/conf.d/userdirs
Well check that later once we have made the user account.
Now to compile xmlrpc, libtorrent, and rtorrent:
Add your users:
If you want any of your users to have root privileges (I’d definitely suggest you have your user account have sudo) do this:
Now login to one of your new user and finish setting up the user host directories:
Now in your browser load https://IP/~user1. It should browse the ~/www directory which should have the test.txt we just made in it. Open it up. The problem here is we don’t actually want our user’s home directory browsable. To fix this:
Add the following to a new file index.html
Load the same url again and have a laugh.
Now to get rtorrent finished up:
Make sure you replace the three with the actual username. Also make sure you change the toward the bottom to the correct SCGIMount port of the user.
~/.rtorrent.rc
Now to add some aliases to make things easier.
To start rtorrent the first time, simply run rtorrent. Hopefully it will open up without errors. Assuming it does, close it by hitting CTRL + Q (For future reference, becareful not to do it twice. Doing it twice force quits rtorrent which can cause some problems. It may take some time to shutdown). From now on, we want to run rtorrent in screen (so that it runs in the background). To do this, run rstart. This will start rtorrent in a screen session detached in the background. To re-attach it, run rt. This should bring up rtorrent looking like it did the first time. To detach the screen and keep rtorrent running, press CTRL+A, release, then press D. If you ever forget what your aliases are, simply type alias to get a list.
To setup ruTorrent:
To test it out, load https://IP/~user/rutorrent (keep the tilda ~). Hopefully it will load with no errors.
Now you and all your friends can use the seedbox to its full potential.
I suggest heading over to the Ubuntu site, and downloading the latest ISO just to see how fast it is. Who knows, I might end up connecting too you ;)