Setting up rTorrent + ruTorrent (WebUI) on QNAP NAS

shwetha17

Member
May 24, 2018
785
0
16
Hi! I recently became an owner of QNAP TS-409 Pro Turbo and, as soon as I powered it up, I started to explore the possibilities it offers to customize the NAS the way I want it to run (though the firmware QNAP provides is quite good itself).
One of the reasons I bought this NAS was to use it as torrent download station so I wouldn't need to run my PC 24/7 anymore. After searching around the net, I found the ruTorrent, which is almost identical by the looks as my beloved uTorrent, so my task was to set up the rTorrent + ruTorrent, which I almost managed to do, but I ran into a problem (which seems quite trivial, but I can't find the solution for it), which I will describe further and hopefully someone can give me a hint on how to solve it.
Just for the note - I also tried the Transmission and I managed to set it up within less than half an hour with no problems whatsoever, so I could just give up on ruTorrent, but I still wanted to set it up and at least compare the two and decide which is better by running some tests.

Now, here's what I did to set up rTorrent:
- basically I followed the instructions found on the QNAP forum:
  • installed the rTorrent package
  • installed additional useful packages like screen, mc, nano
  • set up rTorrent by creating necessary folders and assigning necessary permissions
  • started rTorrent and checked if everything working fine - SUCCESS so far - after placing .torrent file in watch folder it started downloading without any problems
The next step was to set up a web server that uses scgi module, so it can communicate with rTorrent. As the Apache web server that is included with QNAP is v1.3.41 it doesn't support this module I decided to set up the lighttpd web server (which has scgi module already included) to act as a gateway between rTorrent and the Apache web server where the ruTorrent will be running. No problems setting up lighttpd as well, but the last step - setting up ruTorrent was not successful. These are the steps I did:
  • installed lighttpd package
  • changed the lighttpd configuration file as described here
  • added strings to the rTorrent configuration file:
Code:
scgi_port = :5000
encoding_list = UTF-8
  • checked lighttpd - it's running on localhost port 8081 and the /RPC2 is working as well
  • copied the ruTorrent files to the Apache web server web directory
  • opened the link http://<NAS-IP-address>:8080/rutorrent in my browser
And here I get to my problem - browser displays the ruTorrent web interface, but under logger it shows:
Quote
[13.11.2009 18:18:23] WebUI started.
[13.11.2009 18:18:23] Bad response: (404) <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested URL /RPC2 was not found on this server.<P><HR><ADDRESS>Apache/1.3.41 Server at <NAS-IP-address Port 8080</ADDRESS></BODY></HTML>​


And no torrents are diplayed in the main window although the running rTorrent has some. As far as I understand, the problem is - ruTorrent is looking for /RPC2 on the Apache server instead of the lighttpd where the real /RPC2 is. So far, I was unable to find where to change this in ruTorrent so it would connect to the correct /RPC2.
Also, what confuses me the most - when I tried to add a new .torrent file using ruTorrent through "Add torrent..." it worked just fine - rTorrent started the download almost immediately after pressing the "Add file" button (same case with "Add URL").
Quote
[13.11.2009 18:20:02] torrent is succesfully passed to rTorrent​


So it feels like I'm almost there, just a little configuration issue. I would be very thankful, if someone could tell me, how to fix this.

P.S. If I will be able to get it running, then based on my current experience, I can also post a detailed description about how to set it up under the 'How To' section of this forum.
 

dsouvik215

Member
May 25, 2018
896
0
16
you need to use the same webserver to do rpc as you display the page with. try using the rpc plugin instead if this is a problem.


basically, you can't do the rpc on one port and the page on another. They need to be on the SAME server.
 

shwetha17

Member
May 24, 2018
785
0
16
Thank you for the prompt answer!

I tried the RPC plugin you mentioned and it worked, no more messages about the missing /RPC2. What concerns me is the use of this plug-in, as mentioned here:
Quote
... implementation of this functional on php leads to additional (in comparison with "the native" module of a web server) server processor loading. Therefore usage of the given plug-in is not recommended for routers and various embedded systems.​


Unfortunately, from my observations with using this plug-in, seems to be my case - CPU load does increase significantly.

Based on the QNAP forum topic I mentioned before, where the case was using lighttpd as a RPC gateway for rTorrent <-> rtgui and wTorrent, I was hoping to do the same set up with ruTorrent - seems that it's not the case.

I also tried the second option - to compile the mod_scgi module with my Apache version, so I could use it as a gateway and host ruTorrent at the same time as you mentioned, but to no avail.
 

shwetha17

Member
May 24, 2018
785
0
16
It's even more trouble doing it the other way around, cause with lighttpd you need to set up PHP as well and it's not as configurable and secure as Apache.
 

dsouvik215

Member
May 25, 2018
896
0
16
ok, well this is what you need to do.

set up lighttpd or cherokee..

If you use port 8080 on lighttpd or cherokee for the scgi port, then also connect with that port. do you understand?
 

shwetha17

Member
May 24, 2018
785
0
16
Yes, I've also tried it with cherokee, but I had some problems with setting up the PHP using the wizard.

Anyways, today I found a remote GUI for the Transmission BT client which seems to be working fine (and looks like uTorrent as well).
Taking into consideration that Transmission is a lot easier to set up and, from what I've observed so far, it's more stable and issue free than rTorrent, and also has it's own integrated web UI called Clutch, I don't see any good reason why to go through all the trouble by setting up the second web server (in addition to the Apache server included with the firmware) just to get the web UI running. In my opinion, this solution has no efficiency resource (server) and time (admin) wise, so for now I'm gonna stick with Transmission.

Anyway, ruTorrent seems to be a promising project and if the set up process rTorrent + ruTorrent would be simplier, more people would be likely to use it.
 

das329717

Member
May 25, 2018
928
0
16
Glad you found something that works for you best.

What i can't understand is what QNAP has done to rtorrent that you are having such a bad impression about it. Of course the setup takes a few minutes longer than µtorrent or alike but i also need more time to setup apache than setting up lighttp or cherokee. With respect to the degress of automation that i can reach with rtorrent i consider it the swiss army knifes among torrent clients. Concerning the stability, i have had rtorrent running for up to 10 months 24/7 until i did restart the server for other maintenance purposes.

I guess every solution has its benefits and users.
 

dsouvik215

Member
May 25, 2018
896
0
16
rtorrent is much better than transmission and it's really not hard to set up. I'd be glad to helpt you if you need it, pehaps via IM. I've used every single *nix client out there and for stability and load rtorrent is BY FAR the best.

If you want to only download 1 or 2 at a time, tranmission or bitornado are fine.

If you want to get the most out of your system, you need rtorrent.


as far as setting up a second webserver....theres no NEED to do that if you set up the first one correctly.

I'm not familar with the qnap's config but if you tell me the DEFAULT webserver it has, and perhaps post your default config file i can help you get what you need out of it.

As far as cherokee goes, it's an amazing webserver, the wizards are pretty much self explanitory but again, i'd be glad to help you.
 

shwetha17

Member
May 24, 2018
785
0
16
Thank you all for your help, I really appreciate it!
I have a very limited experience with Linux OS (mostly with Ubuntu) and that doesn't help me at all (although I'm interested in learning stuff in the process) while trying to set up the QNAP which runs an adapted version of Linux (something like a BusyBox used on WD MyBook World Edition) that contains the basic Linux commands. So the process of setting things up, like adding new Apache modules and setting up Cherokee webserver are like pain in the ass smiley.gif just simply cause there are many packages missing that are required in the process (and even installing all of them doesn't guarantee that everything will be working afterwards) and otherwise would be already there in a normal Linux version.

Well, if speaking about setting up rTorrent, indeed there were not much problems there - as I mentioned before, I managed to get it working just fine, just the web UI part was the one I couldn't set up entirely. And also, I'm not saying that rTorrent is a bad BT client, just that after doing some reading (mostly on QNAP forum), I saw many people having some issues with running it on their machines. Maybe it's technical or firmware related, I really don't know. As for the Transmission, I didn't see as many complaints, perhaps cause it's newer and not so widely used.
As I see, there may be also some technical reasons why Transmission and rTorrent act differently on different QNAP models, as from my observations, rTorrent used slightly more memory than Transmission. Actually the strange part was that when adding more torrents to Transmission (10 or more) some memory freed up instead of using more.

I also tried setting up the Cherokee webserver, which seemed to be more user friendly than Apache in the means of configuring it, but the problem was, when I tried to add PHP (using the wizard) to my Virtual server which was supposed to run ruTorrent, I got the error:


And I didn't find any useful info about how to deal with such a problem. If you have any ideas what could be the solution for this, I'm willing to give Cherokee a try otherwise, without PHP, there's nothing much that can be done on a webserver.
 

dsouvik215

Member
May 25, 2018
896
0
16
you need to install php5-cgi

you can compile from source if you have to, but you need a working php5-cgi install before cherokee with be of much use.