rTorrent + ruTorrent guide

simur612

Member
May 25, 2018
879
0
16
Hi! Ofc! wink.gif

Code:
sudo sh redtorrent.sh trutka
Please specify a valid user.
Exiting with status code 1.
and cat /etc/passwd

Code:
cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
bind:x:101:104::/var/cache/bind:/bin/false
sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
trutka:x:1000:1000:Sebastian Dukla,,,:/home/trutka:/bin/bash
OS is Debian Wheezy 7.5 64bit
 

Attachments

randac56

Member
May 25, 2018
915
0
16
When using the exact same passwd file on the exact same OS, it works perfectly when passing "trutka" as an argument here. Please remove your version of redtorrent.sh and copy-paste my script again to ensure that this isn't about a typo which you accidentally made yourself.

And please run this script with "trutka" as an argument (e.g.: "sh test.sh trutka") and post the output here
Code:
#!/bin/sh

USER="$1"
UID=$(awk -F ":" "/^${USER}:/ {print \$3}" /etc/passwd)

printf "UID: $UID"

if [ -z "$UID" -o "$UID" = "0" ]; then printf "failure"; fi

printf "\n"
 

lisas4567

Member
May 25, 2018
773
0
16
I think I know the problem, stupid of me to ignore/not think of this before: UID is used a system var for the current user id and I should not have used that name in my script to avoid things like this.

Try the test script again but with the following code:
Code:
#!/bin/sh

user="$1"
user_id=$(awk -F ":" "/^${USER}:/ {print \$3}" /etc/passwd)

printf "UID: $user_id"

if [ -z "$user_id" -o "$user_id" = "0" ]; then printf "failure"; fi

printf "\n"

If it outputs "UID: 1000", replace your redtorrent.sh again and it should work now (I just corrected the script)
 

simur612

Member
May 25, 2018
879
0
16
This is just to share my late experience.

Yesterday I decided to upgrade my Ubuntu server from 12.04 to 14.04.

After that, rutorrent stoped working saying that the url (myserver/rutorrent) wasn't found.

I found out that the Apache version that comes with Ubuntu 14.04 (Apache 2.4.7/built on 2014/04/03) doesn't point to /var/www but /var/www/html, so I had to move rutorrent directory to /var/www/html.

After that, rutorrent began to show the main page, but an empty page, without all the torrents already in place, and the following error message:

Quote
The requested URL /RPC2 was not found on this server​


Again, this has to do with the new Apache version, which seem to ignore anything on the /etc/apache2/conf.d.

In my case, I had followed your guide before and choose to create a new conf file specifically aimed to gather any Apache settings related to rutorrent.

Since now Apache was ignoring the /conf.d directory, I copied the content in that file and added it to the main Apache conf file, apache2.conf, and everything started working.

So, maybe it would interesting to add a note to your guide regarding those two points whenever one uses this version of Apache: the /var/www/html location and the correct place where to put the settings.
 

peshua19

Member
May 25, 2018
897
0
16
Hi,

I am a massive unix noob so apologies in advance!
I have a kimsufi server with a fresh build of ubuntu 12.04 x64
I have copied your script into the root folder and tried to run it but i get this:

Code:
root:~# sudo sh redtorrent.sh user
redtorrent.sh: line 2: $'\r': command not found
redtorrent.sh: line 14: $'\r': command not found
redtorrent.sh: line 15: $'\r': command not found
redtorrent.sh: line 18: $'\r': command not found
redtorrent.sh: line 63: $'\r': command not found
redtorrent.sh: line 64: $'\r': command not found
redtorrent.sh: line 66: $'\r': command not found
: invalid optionine 67: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]

This is a fresh build so I am wondering if i need to first create a user and disable root, and do updates?
 

lisas4567

Member
May 25, 2018
773
0
16
These things are not related to your problem, your problem is that you created your script with a Windows application and Windows handles newlines differently as Linux. The simplest solution is probably to install a small program which will convert the line endings for you (that way you can continue to use Windows to write files for your Linux server).
Open up terminal, navigate to the directory which contains the redtorrent.sh file (if needed) and enter the following:
Code:
sudo aptitude install dos2unix
dos2unix redtorrent.sh
line endings have now been converted and everything will work now smiley.gif
 

Attachments

saroos1

Member
May 25, 2018
718
0
16
I just wanted to say a MASSIVE THANK you for this script and your help with making the windows file readable in unix.
I must have followed 5 or 6 guides and got rtorrent working on all but rutorrent would never connect.
Now i have everything running perfectly using a kimsufi server with ubuntu 12.04 x64.

Thanks again for this.

EDIT

Can you show me how I can have a password on my rutorrent access and using https please?
I tried following some of the steps here - http://forums.rutorrent.org/?topic=256.0 under configure apache but when i go to restart the apache2 service i get:

Code: [Select]
user:~$ sudo /etc/init.d/apache2 restart
Syntax error on line 27 of /etc/apache2/sites-enabled/000-default:
Invalid command 'AuthDigestDomain', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!

OK got it all workin now!

For anyone else who is new to unix(!!) i followed a few guides.
Start off here - http://forums.rutorrent.org/?topic=256.0
Do everything up to Install necessary basic packages (don't do this bit). This will mean that you have created a new user and disabled root access.
Now follow kabeleon's guide here (remember if you have copied the script from windows then you need to run the dos2unix script:

Code: [Select]
sudo aptitude install dos2unix
dos2unix redtorrent.sh

Now run kabeleon's script

Code: [Select]
sudo sh redtorrent.sh <rtorrent-user>

This will take quite some time. When done you should configure the rtorrent.rc file.

Code: [Select]
sudo nano .rtorrent.rc

I only use one user for rutorrent so I have left most things unchanged except:

Quote
upload_rate = 0
download_rate = 0​


Control + o to save and Control + x to quit

Now you need to create a username and password for rutorrent or anyone can log onto it. I have managed to do mine by using various guides but a lot of this is taken from subvertbeats guide.

Code: [Select]
sudo openssl req -new -x509 -days 365 -nodes -newkey rsa:2048 -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem
chmod 600 /etc/apache2/apache.pem

Code: [Select]
sudo htdigest -c /etc/apache2/htpasswd rutorrent <username>

Code: [Select]
sudo nano /etc/apache2/sites-available/default

Now copy the following and paste to replace the contents of the file we're editing.
Then replace both instances of <servername or IP> with your real servername or IP address

Quote
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

<Location /rutorrent>
AuthType Digest
AuthName "rutorrent"
AuthDigestDomain /var/www/rutorrent/ http://<servername or IP>/rutorrent

AuthDigestProvider file
AuthUserFile /etc/apache2/htpasswd
Require valid-user
SetEnv R_ENV "/var/www/rutorrent"
</Location>

</VirtualHost>

<VirtualHost *:443>
ServerAdmin webmaster@localhost

SSLEngine on
SSLCertificateFile /etc/apache2/apache.pem

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
<Location /rutorrent>
AuthType Digest
AuthName "rutorrent"
AuthDigestDomain /var/www/rutorrent/ http://<servername or IP>/rutorrent

AuthDigestProvider file
AuthUserFile /etc/apache2/htpasswd
Require valid-user
SetEnv R_ENV "/var/www/rutorrent"
</Location>
</VirtualHost>​


Code: [Select]
sudo a2ensite default-ssl

Code: [Select]
sudo nano /etc/apache2/ports.conf

Replace the contents of that file with the text below

Quote
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
NameVirtualHost *:443
Listen 443
</IfModule>

<IfModule mod_gnutls.c>
Listen 443
</IfModule>​


Code:
sudo a2enmod auth_digest

Code:
sudo a2enmod ssl

Code:
sudo /etc/init.d/apache2 restart

That's it!! The very last thing to do is to run rtorrent in screen mode so that it continues to run when you quit your ssh session.

Code:
screen -d -m -S rtorrent rtorrent

I hope this helps people!
Credits go to subvertbeats and kabeleon
 

simur612

Member
May 25, 2018
879
0
16
showstopper do you leave the < > around the domain name or IP address when you replace it?

I left them and works so thanks for the detailed instructions guys.
 

randac56

Member
May 25, 2018
915
0
16
hello bro ...

need help ....

Code:
configure: error: c-ares library defective or too old
[root@vps curl-7.38.0]#
i use Centos and gcc 4.4.7-4

:::EDIT:::

solve the problem by install the latest c-ares v 1.10.

for Centos, need to install manually libssh2, libxml2.

i will update any package that need to be install manually.
 

peshua19

Member
May 25, 2018
897
0
16
I am running rtorrent 0.9.2 with libtorrent 0.13.2 on a Seagate Dockstar. Wonder if the Dockstar has enough memory to run 0.9.4 or 0.9.3 is a better choice? The main reason for upgrade is I can't get maget link to work with rtorrent 0.9.2. If not 0.9.4, do I build 0.9.3 with libtorrent 0.13.4?
Thanks.
 

lisas4567

Member
May 25, 2018
773
0
16
Quote
Wonder if the Dockstar has enough memory to run 0.9.4 or 0.9.3 is a better choice?​

depends on how many torrents it needs to handle but I'd stay with 0.9.3 in your case

Quote
If not 0.9.4, do I build 0.9.3 with libtorrent 0.13.4?​

no, you should use rTorrent 0.9.3 with libtorrent 0.13.3
 

saroos1

Member
May 25, 2018
718
0
16
smiley.gif Thanks for your nice guide!
I have a error when run your auto-cript,it is shown that "Please specify a valid user."
and would you please make an guide to add third-part autodl-irssi plusin, I try many times but failed.
thank again.
 

Attachments

peshua19

Member
May 25, 2018
897
0
16
Off-topic. I thought the author of rtorrent used to have a wiki/tutorial about how to do some common stuff by including commands in .rtorrent.rc . Does anyone know where it has been moved?
 

simur612

Member
May 25, 2018
879
0
16
I have a error when run your auto-cript,it is shown that "Please specify a valid user."
Euh... the error clearly says what's missing
if you're sure you're passing a valid username, you'll need to give me more info but I doubt that's the case
would you please make an guide to add third-part autodl-irssi plusin
you'll have to figure that one out on your own or ask help to someone else (mabye bittorrent related IRC channels?)
Off-topic. I thought the author of rtorrent used to have a wiki/tutorial about how to do some common stuff by including commands in .rtorrent.rc . Does anyone know where it has been moved?
since the project moved to GitHub, the old Trac has been taken offline although you can still find it via the wayback machine: https://web.archive.org/web/20140213003955/http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks
you're probably better of looking at the community wiki started by the pyroscope guy though: http://wiki.rtorrent.org/ConfigurationCookbook
 

randac56

Member
May 25, 2018
915
0
16
Thank you for your great guide! Best guide I've found yet and also the most up to date.
I'm getting these annoying rss errors though

Code:
rss: Some functionality will be unavailable. rTorrent user can't access external program (curl).Getting error loading feed every time it updates but feeds load regardless.
Have installed curl and php5 and set all the permissions.
 

peshua19

Member
May 25, 2018
897
0
16
Hi,

do you think it is possible to use this script to install Rtorrent and Rutorrent on a Seagate 4 NAS?
It uses the NAS OS, from my research it is debian based. I can use SSH.
If it is possible how should I copy the sh file to the NAS 4 and than run the script?
 

lisas4567

Member
May 25, 2018
773
0
16
Hey guys,

I firstly followed this tutorial: https://my.vps6.net/knowledgebase/64/How-to-Install-rTorrentorruTorrent-Seedbox-on-Ubuntu-VPS.html

but i Failed to complete it.

Afterwards I found this great script and successfully installed it.

But i have now an issue:

Code:
[11.11.2014 14:46:52] WebUI started.
[11.11.2014 14:46:53] No connection to rTorrent. Check if it is really running. Check $scgi_port and $scgi_host settings in config.php and scgi_port in rTorrent configuration file.
I already check here for this issue and google it.

when i want to start rtorrent in SSH:
Code:
:~# rtorrent
rtorrent: Could not lock session directory: "/home/seeder1/rtorrent/.session/", No such file or directory
It seem that its mixed up with the other tutorial.

I think I also have to delete the lock file? But i can't find it.

Would be awesome if someone can help me to fix this issue.