FlyingPersian
Patron
- Joined
- Jan 27, 2014
- Messages
- 237
Hi
I personally don't like transmission too much and I've also stumbled upon many people using rtorrent (rutorrent) as their client. Since I spent some time on installing it properly I decided to share my findings here with you guys.
First off, most of my knowledge can be credited to the user/admin wonslung on rutorrent forums. I mostly followd his tutorial with a few adjustments to make it work (you can find the tutorial here). Thus my tutorial will be very similar to his. So, let us begin:
1. First we start by creating a jail, I myself chose a pluginjail without any particular reason. Keep the standard settings, give it a proper name such as "rutorrent" or "rtorrent". Enter the standard gateway, let the rest be and press ok.
2. SSH into the jail and do the following:
I know many people prefer pkgng, but I haven't tried that one out yet and I suppose that this will also do the job.
3. Then install rtorrent (I chose rtorrent)
Leave all the settings to standard and press enter any time the blue settings window appears.
4. Next we will install a webserver, in our case apache.
Again, default settings.
5. Then we'll install mod_scgi
6. Next php5. BUT this is where my problems started. Usually we're supposed to install php5 (the newest version I think), but the tutorial is a little older and it might have worked then, but not now. You have to select the Apache Module in the settings, but it won't be in php5. We have to install a slightly older version, but I don't know if there are any disadvantages such as security.
Again, only check the Apache Module, the rest can stay default.
7. Next we have to install php53-extensions. I Do not know precisely which ones you need, but I've collected the information of multiple sites and it works fine for me:
Check these to the already checked (some might be checked already)
This takes up the longest time and you've to confirm many settings.
8. Next we copy over a php.ini file
9. Next we have to enable php and mod_scgi in the Apache config. I use the standard text editor, you can choose whatever you like.
Find the modules section. There's a bunch of lines starting with LoadModule. Add this to the bottom:
Then search for "mime" (press ESC - - > search) and add this:
Save it.
10. Next we enable apache
11. Then start apache
It might give you some error regarding the server name, just ignore it, it doesn't do any harm
12. My source tutorial is written to support multiple users, so I'll just stick to it.
You can of course name "rutorrent-users" whatever you like.
Name USER1 to whatever you want.
13. Then download and extract rutorrent.
According to the tutorial you have to chmod 777 certain folders, but since the folder structure of rutorrent changed since the tutorial was written just chmod 777 the rutorrent folder.
Be aware that this might be insecure!
14. Next we install "screen" which we use to run rtorrent.
15. Every user needs his own account, so go ahead and create one for every user
Just create a random password. Do this for each user you have. Write down the password.
16. Next we create folders for rtorrent. You can put them wherever you like, but the user's folder makes sense.
17. Next we copy over and edit the .rtorrent.rc
Edit the file:
I've read that ports above 50.000 are common for the port range.
For the next user the last three lines would look like this:
If you can't find any of the lines just add them at the bottom of the file.
Also add the following if you're using private sites:
18. Next we do some stuff with apache for authentication.
Enter the password for USER1. If you do this for other users thereafter leave out the "-c":
19. Next we create a group with the name of USER1 and USER1 as a member:
20. Then we need alias' so that apache knows where the rutorrent files are.
It's important that you always name the right user, it doesn't always have to be USER1. I just don't want to write that all the time, but I assume that this is clear.
Enter this:
Here you have to replace the USER1 with your username AND you have to change the SCGIMount accordingly (USER1 --> RPC1, Port 5001, USER2 --> RPC2, Port 5002 etc)
Then restart apache
Again, you might get some error with the server name, just disregard that.
21. The command to start rtorrent is this:
But I had some issues with the .rtorrent.rc some times cuz it didn't use the one in my /USER1/rtorrent folder. So I added this to the command:
Done :) The URL to reach your rutorrent is
22.
Repeat this step for additional users
23. Fix unrar plugin
Have fun and enjoy. If you see any error or have any suggestions to make this even better, let me know.
I personally don't like transmission too much and I've also stumbled upon many people using rtorrent (rutorrent) as their client. Since I spent some time on installing it properly I decided to share my findings here with you guys.
First off, most of my knowledge can be credited to the user/admin wonslung on rutorrent forums. I mostly followd his tutorial with a few adjustments to make it work (you can find the tutorial here). Thus my tutorial will be very similar to his. So, let us begin:
1. First we start by creating a jail, I myself chose a pluginjail without any particular reason. Keep the standard settings, give it a proper name such as "rutorrent" or "rtorrent". Enter the standard gateway, let the rest be and press ok.
2. SSH into the jail and do the following:
Code:
portsnap fetch portsnap extract pkg update pkg upgrade cd /usr/ports/ports-mgmt/portmaster make install clean echo 'WITH_PKGNG=yes' >> /etc/make.conf pkg2ng portmaster -avB <accept all of the defaults>
I know many people prefer pkgng, but I haven't tried that one out yet and I suppose that this will also do the job.
3. Then install rtorrent (I chose rtorrent)
Code:
cd /usr/ports/net-p2p/rtorrent-devel --or-- cd /usr/ports/net-p2p/rtorrent make install clean
Leave all the settings to standard and press enter any time the blue settings window appears.
4. Next we will install a webserver, in our case apache.
Code:
cd /usr/ports/www/apache22 make install clean echo DEFAULT_VERSIONS=apache=2.2 >> /etc/make.conf
Again, default settings.
5. Then we'll install mod_scgi
Code:
cd /usr/ports/www/mod_scgi make install clean
6. Next php5. BUT this is where my problems started. Usually we're supposed to install php5 (the newest version I think), but the tutorial is a little older and it might have worked then, but not now. You have to select the Apache Module in the settings, but it won't be in php5. We have to install a slightly older version, but I don't know if there are any disadvantages such as security.
Code:
cd /usr/ports/lang/php53 make install clean
Again, only check the Apache Module, the rest can stay default.
7. Next we have to install php53-extensions. I Do not know precisely which ones you need, but I've collected the information of multiple sites and it works fine for me:
Code:
cd /usr/ports/lang/php53-extensions make install clean
Check these to the already checked (some might be checked already)
Code:
BZ2, CTYPE, CURL, DOM, FILEINFO, FILTER, GD, HASH, ICONV, JSON, MBSTRING, MBCRYPT, MYSQL, MYSQLI MHASH, OPENSSL, PCRE, PDO, PDO_SQLITE, POSIX, SESSION, SIMPLEXML, SOCKETS, SPL, SQLITE, TOLKENIZER, XML, XMLREADER, XMLRPC, XMLWRITER, ZIP
This takes up the longest time and you've to confirm many settings.
8. Next we copy over a php.ini file
Code:
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
9. Next we have to enable php and mod_scgi in the Apache config. I use the standard text editor, you can choose whatever you like.
Code:
ee /usr/local/etc/apache22/httpd.conf
Find the modules section. There's a bunch of lines starting with LoadModule. Add this to the bottom:
Code:
LoadModule scgi_module libexec/apache22/mod_scgi.so LoadModule php5_module libexec/apache22/libphp5.so
Then search for "mime" (press ESC - - > search) and add this:
Code:
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
Save it.
10. Next we enable apache
Code:
ee /etc/rc.conf --add this-- apache22_enable="YES" --save--
11. Then start apache
Code:
/usr/local/etc/rc.d/apache22 start
It might give you some error regarding the server name, just ignore it, it doesn't do any harm
12. My source tutorial is written to support multiple users, so I'll just stick to it.
Code:
mkdir -p /usr/local/www/rutorrent-users cd /usr/local/www/rutorrent-users mkdir USER1 cd USER1
You can of course name "rutorrent-users" whatever you like.
Name USER1 to whatever you want.
13. Then download and extract rutorrent.
Code:
wget http://dl.bintray.com/novik65/generic/rutorrent-3.6.tar.gz tar xfvz rutorrent-3.6.tar.gz wget http://dl.bintray.com/novik65/generic/plugins-3.6.tar.gz tar xfvz plugins-3.6.tar.gz mv -r plugins/* rutorrent/plugins/ rmdir plugins
According to the tutorial you have to chmod 777 certain folders, but since the folder structure of rutorrent changed since the tutorial was written just chmod 777 the rutorrent folder.
Code:
chmod 777 rutorrent
Be aware that this might be insecure!
14. Next we install "screen" which we use to run rtorrent.
Code:
cd /usr/ports/sysutils/screen make install clean
15. Every user needs his own account, so go ahead and create one for every user
Code:
adduser --set USER1 as the username-- --set the home dir to /USER1/--
Just create a random password. Do this for each user you have. Write down the password.
16. Next we create folders for rtorrent. You can put them wherever you like, but the user's folder makes sense.
Code:
cd /home/USER1 mkdir -p rtorrent/download mkdir -p rtorrent/.session chown -R USER1:USER1 rtorrent/
17. Next we copy over and edit the .rtorrent.rc
Code:
cp /usr/local/share/examples/rtorrent/rtorrent.rc /home/USER1/.rtorrent.rc chmod 644 /home/USER1/.rtorrent.rc
Edit the file:
Code:
ee .rtorrent.rc --remove the hash tags in front of every setting you want to change. Most of the stuff should be clear. - - --find "directory =" - - directory = /USER1/rtorrent/download/ --find "session =" - - session = USER1/rtorrent/.session/ --find "port_range =", "scgi_port =" and "dht_port=" - - port_range = 50001-50001 dht_port = 25001 scgi_port = 127.0.0.1:5001
I've read that ports above 50.000 are common for the port range.
For the next user the last three lines would look like this:
Code:
port_range = 50002-50002 dht_port = 25002 scgi_port = 127.0.0.1:5002
If you can't find any of the lines just add them at the bottom of the file.
Also add the following if you're using private sites:
Code:
dht=disable
18. Next we do some stuff with apache for authentication.
Code:
mkdir -p /usr/local/www/private/ htpasswd -c /usr/local/www/private/.htpasswd USER1
Enter the password for USER1. If you do this for other users thereafter leave out the "-c":
Code:
htpasswd /usr/local/www/private/.htpasswd USER2
19. Next we create a group with the name of USER1 and USER1 as a member:
Code:
ee /usr/local/www/private/.htgroups --enter this:-- USER1: USER1
20. Then we need alias' so that apache knows where the rutorrent files are.
Code:
ee /usr/local/etc/apache22/Includes/USER1.conf
It's important that you always name the right user, it doesn't always have to be USER1. I just don't want to write that all the time, but I assume that this is clear.
Enter this:
Code:
Alias /USER1 /usr/local/www/rutorrent-users/USER1/ <Directory /usr/local/www/rutorrent-users/USER1> Options Indexes FollowSymLinks AllowOverride AuthConfig Order allow,deny Allow from all </Directory> SCGIMount /RPC1 127.0.0.1:5001 <Location /RPC1> AuthName "Private" AuthType Basic AuthBasicProvider file AuthUserFile /usr/local/www/private/.htpasswd AuthGroupFile /usr/local/www/private/.htgroups Require group USER1 </Location>
Here you have to replace the USER1 with your username AND you have to change the SCGIMount accordingly (USER1 --> RPC1, Port 5001, USER2 --> RPC2, Port 5002 etc)
Then restart apache
Code:
/usr/local/etc/rc.d/apache22 restart
Again, you might get some error with the server name, just disregard that.
21. The command to start rtorrent is this:
Code:
screen rtorrent
But I had some issues with the .rtorrent.rc some times cuz it didn't use the one in my /USER1/rtorrent folder. So I added this to the command:
Code:
screen rtorrent -n -o import=/USER1/.rtorrent.rc
Done :) The URL to reach your rutorrent is
Code:
http//IP.to.jail/USER1/rutorrent/
22.
Code:
ee /usr/local/www/rutorrent-users/USER1/rutorrent/conf/config.php change $scgi_port = 5000; to $scgi_port = 5001;
Repeat this step for additional users
23. Fix unrar plugin
Code:
cd /usr/ports/archivers/unrar make install clean
Have fun and enjoy. If you see any error or have any suggestions to make this even better, let me know.
Last edited: