Dlink NAS DNS-323 + Debian chroot + rTorrent + wTorrent
EDIT #2: I have written an expanded and up to date (Jan 2010) guide on the setup of a DNS-323 with Transmission. This has been written as a series of posts and can be found http://blog.markstahler.ca/series/dns-323-ultimate-setup/
EDIT: I no longer use the rTorrent + wTorrent combination, there were fatal bugs in rTorrent which caused it to crash after a short period of time (5 hrs – several days??). I use Transmission + .NET Remote + Transmission Web Interface. If you want a guide for this one (using Debian and built from source; a Funplug installer is currently available here), let me know in the comments.
This is a quick guide to getting rTorrent running on your 323 with the wTorrent web interface.
There are several ways that one could get this working in theory but this is the only method that worked properly. The fun_plug custom rtorrent package did not work properly at all nor did the ipkg one work with xmlrpc enabled (which is required for wTorrent).
To run rTorrent with wTorrent, you must install Debian Linux on your 323. This takes 5-10 minutes and there is a fun plug package that automates all of the work for you. Debian is installed in a chroot environment which means it is completely seperated and self contained from the rest of the 323 software.
If you (like I was) were running Fonz’s Fun Plug you will first have to remove it. This is done by deleting the funplug directory in /mnt/HD_a2/fun_plug. It is possible it can be done via Windows Explorer (or whatever) if you changed its permissions/owner, otherwise do it from the command line.
(Please be careful using rm -rf, you can destroy a Linux system with one wrong delete)
rm -rf /mnt/HD_a2/fun_plug
chmod -R 777 /mnt/HD_a2/ffp
rm -rf /mnt/HD_a2/Nas_prog
Reboot the NAS and delete the /mnt/HD_a2/ffp directory.
You are now ready to install Debian. This is very simple using the Debnas fun plug package. You can find it at http://sourceforge.net/projects/debnas/. At the time of this writing 0.5 is the latest version.
Download and extract the package to Volume_1 of the 323 (tar -jxf in /mnt/HD_a2/). There should now be linux.tar and the fun_plug in the root of the drive now.
Reboot the 323 and Debian will install, this will take several minutes. SSH will be enabled when the device boots. SSH to the 323, the default root password is 12345678. Change the password immediately with the passwd command.
Now you have a full Linux environment on the 323 with all the repository packages at your disposal. The first step is to upgrade to Debian Lenny, a newer stable version of the operating system. Edit /etc/apt/sources.list.d/etch.list, replacing the word etch with lenny. I also changed the mirror url to a North American mirror rather than the German one by removing the de. in the url. You may also rename the filename from etch.list to lenny.list if you feel so inclined.
Now we need to update the repository packages listing and upgrade to lenny. You may have GPG issues which you can resolve by following the guide here :
This will take a while to download and then upgrade. When it is done reboot Debian. I had to reboot using the command ‘reboot -f’. When Debian comes back up, it will be running Lenny. When it comes back up, update to make sure everything is current.
Now we have a reasonably current Linux system to play with. Time to install rTorrent, lighttpd, wTorrent and all the dependencies.
apt-get install <package name>
Apt-get should resolve and install all the package dependencies for you.
List of Packages:
// Packages I dont think are required but installed anyways
Dont worry about lighttp complaining that it cant be started because port 80 is in use, we will change it.
First we will modify the rTorrent settings. One thing that I do that you may also like is that I store my rtorrent settings on the NAS volume 1 and link it to /home/<user>/.rtorrent.rc
Add the following line to your .rtorrent.rc
scgi_port = localhost:5000
usually this line is already in the config and just needs to be uncommented. For this option to work, rTorrent needs to have RPC support built into the program. The rTorrent available from apt does but it is an older version.
Now edit /etc/lighttpd/lighttpd.conf
Under the server.modules section, add the following lines at the end before the ).
Change where the server stores webpages:
server.document-root = “/mnt/HD_a2/www/pages/”
You also need to change the port the webserver runs on. 80 is used by the dlink admin page:
server.port = 8080
Add the following section to the config:
## php support
fastcgi.server = ( “.php” => ((
“bin-path” => “/usr/bin/php-cgi”,
“socket” => “/tmp/php-cgi.socket”,
“max-procs” => 2
## enable communication between lighttp and rtorrent
scgi.server = (
“/RPC2” => # RT_DIR
( “127.0.0.1” =>
“host” => “127.0.0.1”, # Ip where rtorrent is listening
“port” => 5000, # Port specified in .rtorrent.rc
“check-local” => “disable”
NOTE: You can change the other settings to your hearts content. I changed the directories for my logs etc, I leave this up to you.
Now lighttp and php are configured properly. Lets make the web home on your 323 volume.
echo “<html><body>TEST<?php phpinfo( ); ?></body></html>” > /mnt/HD_a2/www/pages/index.php
Start up the web server by:
Enter the URL including the correct IP for you 323 and you should see the PHP info version page
If everything works all you need to do is setup nstall wTorrent into a directory under your webserver home.
Download wTorrent from http://www.wtorrent-project.org/trac/ch … ormat=zip. Unzip the archive and move the /wtorrent/ directory to /mnt/HD_a2/www/pages/wtorrent. chmod -R 777 wtorrent.
Point your browser to http://<nas ip>:8080/wtorrent/install.php and follow the prompts. After installation is complete, start rTorrent and browse to http://<nas ip>:8080/wtorrent/.