HowtoForge

Ubuntu 10.10 LAN Torrent Seedbox With Avalanche-rt, Lighttpd, Rtorrent, Vsftpd And Samba - Page 2

Webinterface

Get it and untar it:

wget "http://avalanche-rt.googlecode.com/files/avalanche_rt_0_9_RC2.tar.gz"
mkdir avalanche
tar xzvf avalanche_rt_0_9_RC2.tar.gz -C avalanche/

Next, we move the content of the directory to our desired location (e.g. /var/www/webui or directly into the http-root):

sudo mv avalanche/* /var/www/

Now we need to edit the settings.php:

sudo nano /var/www/settings.php

Since we don't use a user/pw combination for RPC-mount we can delete these two lines. Change the torrents_folder to the earlier created directory (/home/torrent/torrent-files to stay in the example). The server-port is not 5001! In most of the cases it is port 80 (everybody who needs another knows what he is doing).

Now we need to set the ownership and file right rights:

cd /var/www/
sudo chmod -R 775 torrents/
sudo chmod 664 prefs.json
sudo chown -R www-data:www-data *

Basically we're done. We've set up rtorrent for xmlrpc, lighttpd for xmlrpc, and the web interface.

Next start a new screen...

screen

and execute rtorrent:

rtorrent

You can detach the screen window now (strg + a + d). rtorrent is now running in the background. You can get back into your screen with:

screen -RD

Next restart lighttpd:

sudo /etc/init.d/lighttpd restart

(This step might not be necessary, but I made the experience that this often helps when rtorrent and lighttpd can't communicate, so it doesn't hurt if you do it.)

Now you should be able to log in the avalanche-rt web interface via your web-browser.

If everything is running fine and avalanche-rt is not giving you an error message, try a torrent (e.g.http://releases.ubuntu.com/maverick/ubuntu-10.10-server-i386.iso.torrent) - it should download now.

If you get an error, avalanche-rt has a good common-errors-list available at http://code.google.com/p/avalanche-rt/wiki/CommonErrors, but if you followed these steps, none should occur.

Basically we are done. Now it's time for some rtorrent tuning, which is all done in the .rtorrent.rc. You can e.g. set a watch-folder in which you can upload torrents which will started automatically through rtorrent, set the port for your incoming bittorrent connections (if you use just one port write it nevertheless in port range style, e.g. 12345-12345 will open just port 12345), enable / disable dht and pex, set download limits, etc. rtorrent is very powerful.

After you saved your settings, restart rtorrent and afterwards lighttpd one last time.

Next we need a way to access the data stored on our seedbox.

Therefore we install vsftpd, a secure and simple ftp-daemon.

 

VSFTPD

sudo apt-get install vsftpd
sudo nano /etc/vsftpd.conf

We just need to uncomment / change the following lines:

locale_enable=yes
write_enable=yes
chroot_local_user=yes

Now we are able to upload torrents to our watch-folder via ftp. We can also access all needed directories via ftp, since they are all located in the home-dir of the user (the ftp user is our user we are logged in with at the server). For an Internet setup you might consider a different, more secure user-management (ftp-user without login-shell) with additional encryption of the connection.

When finished, save and exit the file and restart vsftpd:

sudo restart vsftpd

That's it for the ftp part.

To be able to access the downloads via a Windows machine we install Samba. We configure Samba readonly so we can't accidentally delete files.

 

Samba

sudo apt-get install samba

Edit config:

sudo nano /etc/samba/smb.conf

Comment out the printers section if you want and create your share:

[incoming]
path = /home/torrent/downloads
guest ok = no
writeable = no

Restart samba-daemon:

sudo restart smbd

Now we're adding a user without login and shell for the samba-login:

sudo adduser --no-create-home --disabled-login --shell /bin/false username

Add the samba-user (both usernames have to be the same):

sudo smbpasswd -a username

Set a password:

sudo smbpasswd share

You are now able to access you seedbox via Windows network with the username/password you set.

Enjoy your new torrent-seedbox.

Ubuntu 10.10 LAN Torrent Seedbox With Avalanche-rt, Lighttpd, Rtorrent, Vsftpd And Samba - Page 2