Publish time 2011-12-11 18:23:54

[2011.12.15] How to Install the BT Client rtorrent And Webui rutorrent/wtorrent into Ubuntu Linux

Test OS:ubunt 10.04 desktop 32bits、11.04 server 32 bits and 11.10 server 64bits
Conclusion:The processure of installation is  successful until now and work ok.

A-------------------------------------------------------------preassemble-------------------------------------------------------------
First to remind the reader, when you try to install the webui, this tutorial suggest reader use the lighttpd http server.
If you must use the apache2, please ignore the part of installing webui.
After install the lighttpd, reader need pay attention the proftpd.
If you had already installed other ftp client and had not wanted to install other clients, you can stop to install other ftp client.
And if reader use the OpenVZ 64bits VPS(ex ubuntu 11.04 server 64bits ), I suggest you stop use apt-get to install proftpd.
When the system config the proftpd, the error may happn.
If you want to use proftpd on the 64bits platform, I suggest the reader complier the proftpd source code and  make install the source code.sudo apt-get update
sudo apt-get install build-essential pkg-config libcurl4-openssl-dev libsigc++-2.0-dev libncurses5-dev lighttpd nano screen subversion libterm-readline-gnu-perl php5-cgi apache2-utils proftpdBe attention, if reader use the ubuntu 12.04 os, I suggest guy install the proftpd by the source code, or i may be happened somthing wrong.

If the reader had already installed the apache2. It must to be warning when you install lighttpd.2011-11-20 13:50:00: (network.c.358) can't bind to port:  80 Address already in  use We can double check the situation  of binding to port.sudo netstat -lpn
tcp        0      0 0.0.0.0:80            0.0.0.0:*               LISTEN      1440/apache2remove the apache2sudo /etc/init.d/apache2 stop
sudo apt-get remove apache2
sudo /etc/init.d/lighttpd restart
Then, we can chkconfig for Ubuntu and stop the apache2 all the services.sudo apt-get update
sudo apt-get install sysv-rc-conf
sudo sysv-rc-confIn addation to install lighttpd and proftpd, other softwares will be use to rtorrent、rutorrent or wtorrent.

B-------------------------------------------------------------proftpd script-------------------------------------------------------------sudo vi /etc/proftpd/proftpd.confaddAllowForeignAddress             on
RootLogin                                 on
<IfModule mod_facts.c>
    FactsAdvertise                      off
</IfModule>
AllowRetrieveRestart              on
AllowOverwrite                        on
AllowStoreRestart                   on                    
Besides, I suggest the reader change  different with 22 port inavoid stranger attach.
Then,restart...sudo /etc/init.d/proftpd restartIf reader need the root login premission, you can delet the word root in ftpusers file
If you open the premission to be root login please  pay attention your system security.sudo vi /etc/ftpusers C-------------------------------------------------------------adduser-------------------------------------------------------------
Consider the security of the system, we can add a new user and let the user can't invoke the root premission, only use to rtorrent and webui.
This step is not necessary.Actually, if the reader use this new user can't invike the root premission to implement rtorrent or webui,
you may think not convient when you want to invoke root premission by sudo comment temporarily.sudo adduser rt                               //add  user 'rt' on ubuntu platform                                 
sudo chown rt:users /home/rt  
If reader use other linux system (like centos...etc), the commend is a little different .please google...

D-------------------------------------------------------------create folder-------------------------------------------------------------
If you use the user, rt , to use rtorrent, you need create three folders under 'home'.1 rt:for download files                     
2 rt-torrents:for torrents  
3 rt-session:for session  Make the folders and change the premission.cd ~
mkdir rt rt-torrents rt-session
sudo chown -R rt:www-data rt-torrents rt-session rt
sudo chmod -R 770 rt-torrents rt-session rtPs: I don't add the temorary folder save the unfinished files, so all the finished or unfinished files locate in rt folder.
              
E-------------------------------------------------------------install rtorrent client-------------------------------------------------------------                                 

Reader need log in a account can invoke root premission to finish the process of rtorrent installation.
I used to create a folder 'code' to download the source code and tar decompress the packet to install these sofeware.
Below I will complier and make/install the source.Reader can refer my command and inference about other cases from one instance.

Install libtorrent/rtorrent(old version libtorrent0.12.9/rtorrent0.8.9)
If user want to install the new version libtorrent/rtorrent, you can see the next block.
mkdir code && cd ~/code
sudo apt-get install wget     

wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.9.tar.gz
tar zxvf libtorrent-0.12.9.tar.gz
cd libtorrent-0.12.9
//sudo apt-get build-dep libtorrent | tee.build-dep.libtorrent.log
sudo ./configure&&sudo make&&sudo make install
cd ..

sudo svn checkout http://svn.code.sf.net/p/xmlrpc-c/code/advanced xmlrpc-c
cd xmlrpc-c
sudo ./configure&&sudo make&&sudo make install
cd ..

wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.9.tar.gz
tar zxvf rtorrent-0.8.9.tar.gz
cd rtorrent-0.8.9
sudo ./configure --with-xmlrpc-c&&sudo make&&sudo make install
   
sudo ldconfig
Below is the steps  installing new version libtorrent/rtorrent(libtorrent0.13.2/rtorrent0.9.2).
wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.13.2.tar.gz
tar xzvf libtorrent-0.13.2.tar.gz
cd libtorrent-0.13.2
./configure && make && sudo make install
cd ..

svn checkout http://svn.code.sf.net/p/xmlrpc-c/code/advanced xmlrpc-c
cd xmlrpc-c
./configure && make && sudo make install
cd ..

wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.9.2.tar.gz
tar xzvf rtorrent-0.9.2.tar.gz
cd rtorrent-0.9.2
./configure --with-xmlrpc-c&&sudo make&&sudo make install

sudo ldconfig
Put the .rtorrent.rc file under the home folder and change the server IP and relative folder locations to match your server.
Please refer this .rtorrent.rc or this script past
Or reader can refer the official homepage to write the script yourself.

F-------------------------------------------------------------tset rtorrent-------------------------------------------------------------screen -S rt
rtorrenthttp://blessing.bdmv.info/tutorial/rt01.png

G-------------------------------------------------------------install wtorrent(ubuntu 12.04 may not work fine,Debian is no problem)-------------------------------------------------------------
No matter the webui client is wtorrent or urtorrent,it can use the scgi:socket or scgi:port type to link  rtorrent.
Below I will try to talk about the sdgi:port method.

Move the lighttpd.conf or  this script to this locate./etc/lighttpd/lighttpd.confSearch '#change your server IP' to change the server IP yo match yours and change the owner to 'root'-rw-r--r--   1 root root  8281 2011-12-05 07:50 lighttpd.confA part of the lighttpd script is using by rutorrent.At this moment we must mark these content to prove the wtorrent running success.
Search '#rutorrent:password'and'#rutorrent:ssl' and mark these two block script.#rutorrent:password                                          
#server.modules += ( "mod_auth" )                          
#auth.backend = "htdigest"                                 
#auth.backend.htdigest.userfile = "/etc/lighttpd/.auth"   
#auth.debug = 2                                            
#auth.require = ( "/rutorrent/" =>                        
#(                                                         
#"method" => "digest",                                    
#"realm" => "Authorized users only",                       
#"require" => "valid-user"                                 
#)                                                         
#)                                                         
                                                           
#rutorrent:ssl                                             
#$SERVER["socket"] == ":443" {                             
#ssl.engine = "enable"                                    
#ssl.pemfile = "/etc/lighttpd/certs/lighttpd.pem"         
#} Install the below softwares.sudo apt-get update
sudo apt-get install p7zip-full
sudo apt-get install php5-common php5-sqlite php5-xmlrpc libxmlrpc-c3 sqlite unzip php5-cgi php5-curl
(ubuntu 64bits os: to change install libxmlrpc-c3 to libxmlrpc-c3-o)Download and Move wtorrent_official_upgrade_20111119.7z to /var/www/sudo 7z x wtorrent_official_upgrade_20111119.7z
(sudo tar xzvf wtorrent.tar.gz)(if use wtorrent.tar.gz, see below content)
sudo chown -R www-data:www-data wtorrent
sudo /etc/init.d/lighttpd restartlink to your home pagehttp://host/wtorrent/install.phpReader must write the four items of this page especially the point 2 and 3.1.Language
2.Folder to save uploaded torrents
3.Default folder to save torrent data
4.User
5.Passwordhttp://blessing.bdmv.info/tutorial/rt02.png
If reader create the same folder name as befor and use the account rt to run rtorrent, then...Folder to save uploaded torrents: /home/rt/rt-torrents/
Default folder to save torrent data: /home/rt/rt/After fix the information, reader must try configuration and save configuration.Then reader can use the wtorent webui.http://host/wtorrentBTW, I suggest reader use the  wtorrent_official_upgrade_20111119.7z compress pack I create, because I fix a few bug.
If reader persist use official wtorrent,
you can change to decompress the wtorrent.tar.gz file replace  wtorrent_official_upgrade_20111119.7z.
Unofficial organization also provide their wtorrent_plus_final.zip
and I also fix some issue and compress it myself wtorrent_plus_final_unofficial_upgrade_20111119.7z.
Reader can select one of these four version wtorrent.
The below pictures are the official wtorrent interface and unofficial wtorrent interface.
http://blessing.bdmv.info/tutorial/rt03.png

http://blessing.bdmv.info/tutorial/rt04.png

H-------------------------------------------------------------install rutorrent-------------------------------------------------------------
( If the step J excute after the step H , the plugin error message may still keep and warn the user forever.
The user can select to do the setp J first or after executing the step finish then install the rutorrent again.
Because of user will find the error message after executing the rutorrent  at the first time, this tutorial still keep the normal setp in turn).

The same as the step G ,download and locate the files to '/var/www'.
Below rutorrent is old version.
wget http://rutorrent.googlecode.com/files/rutorrent-3.3.tar.gz http://rutorrent.googlecode.com/files/plugins-3.3.tar.gz
tar xzvf rutorrent-3.3.tar.gz&&sudo tar xzvf plugins-3.3.tar.gz
sudo mv -f plugins rutorrent/

wget http://rutorrent.googlecode.com/files/rutorrent-3.4.tar.gz http://rutorrent.googlecode.com/files/plugins-3.4.tar.gz
tar xzvf rutorrent-3.4.tar.gz&&sudo tar xzvf plugins-3.4.tar.gz
sudo mv -f plugins rutorrent/

fix the premissionssudo chmod -R 770 rutorrent/share/settings rutorrent/share/torrents rutorrent/share/users
sudo chown -R rt:www-data rutorrent/share/settings rutorrent/share/torrents rutorrent/share/users
If the links were dead, reader need get the links of the last version rutorrent yourself from the official website.
Because of we stilldon't set the password and ssl encryption,
mark the above lighttpd script line 98 to line 115 to let me check to rutorrent can run successfully.
restart the lighttpdsudo /etc/init.d/lighttpd restart
sudo ldconfig
http://host/rutorrentWe still don't install some softwares, so some rutorrent plugins can't use and descript in record liking below warning information.
After the password and ssl set ok, I will tell reader how to active this plugins. WebUI started. <tell us xmlrpc-c and rtorrent complier/make install successfully、libtorrent and rutorrent run ok>
rss: Some functionality will be unavailable. Web-server user can't access external program (curl).
mediainfo: Plugin will not work. Web-server user can't access external program (mediainfo).
autotools: Plugin will not work. rTorrent's user can't access external program (php).
create: Plugin will not work. rTorrent's user can't access external program (php).
unpack: Plugin will not work. rTorrent's user can't access external program (php).
rss: Plugin will not work. rTorrent's user can't access external program (php).
retrackers: Plugin will not work. rTorrent's user can't access external program (php).
trafic: Plugin will not work. rTorrent's user can't access external program (php).
ratio: Some functionality will be unavailable. rTorrent's user can't access external program (php).
scheduler: Plugin will not work. rTorrent's user can't access external program (php).
rss: Some functionality will be unavailable. rTorrent's user can't access external program (curl).
DataDir plugin: rTorrent's user can't access php interpreter. Plugin will not work.
Unpack plugin: rTorrent's user can't access unrar program.
torrent <tell us torrent files can be uploaded by rutorrent web user  interface>
I-------------------------------------------------------------implement password and ssl for rutorrent-------------------------------------------------------------
Cancel the line 98 to line 115 mark of lighttpd script.
rt is user name.sudo htdigest -c /etc/lighttpd/.auth 'Authorized users only' rt
add sslsudo mkdir /etc/lighttpd/certs
sudo openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout lighttpd.pem -out lighttpd.pem
Than, we  add password and ssl to protect the transmission and use rtorrent client by rutorrent webui.https://host/rutorrentIf there is a  warning of https ssl certicicate happened and it like below screen, ignore it and continue to enter the webui is ok.
http://blessing.bdmv.info/tutorial/rt05.png

J-------------------------------------------------------------install other sofewares-------------------------------------------------------------
We use PPA to install mediainfosudo vi /etc/apt/sources.listAdd mediainfo sources in sources.list(for example:ubuntu 10.04 desktop,other os please refer o the mediainfo official websitedeb http://ppa.launchpad.net/shiki/mediainfo/ubuntu lucid main
deb-src http://ppa.launchpad.net/shiki/mediainfo/ubuntu lucid main
sudo add-apt-repository ppa:shiki/mediainfo
sudo apt-get update
sudo apt-get update
apt-cache search mediainfo <double check databese list the mediainfo>
sudo apt-get install mediainfo curl php5-cli unrar ffmpeg
sudo apt-get install php5-geoip
(Some system may need install unrar-free  to instead of unrar)
(debain user need use dpkg to install mediainfo)
Go to rutorrent/plugins and download the filemanager,then change the owner and group name.svn co http://svn.rutorrent.org/svn/filemanager/trunk/filemanagerBecause of some achieved tools combine with filemanager, we need install some lost software.wget http://www.rarlab.com/rar/rarlinux-x64-4.2.0.tar.gz
tar xzvf rarlinux-x64-4.2.0.tar.gz
cd rar
sudo make install
sudo apt-get install zip
Config the filemanager  at rutorrent/plugins/filemanager/conf.php$pathToExternals['rar'] = '/usr/local/bin/rar';If the usr give up to download the filemanager plugin, the rutorrent recorder can't show the sentance " FILE MANAGER ignited".

The rutorrent interface like below screen.
V3.3
http://blessing.bdmv.info/tutorial/rt06.png

http://blessing.bdmv.info/tutorial/rt07.png

V3.4
Because of I add the new plugin "filemanager", when user open rutorrent gui, the information will show "FILE MANAGER ignited"  at the begain.
http://blessing.bdmv.info/tutorial/rt09.png

http://blessing.bdmv.info/tutorial/rt10.png

http://blessing.bdmv.info/tutorial/rt11.png

###THE END###

PS1----------------------------------------------------------------------------------------------------------------------------------------------                                        Because of the wtorrent often use scgi:port mode,the above installation step  use scgi:port mode.
If reader want to change to use th scgi:socket,you need rtorrent.rc、lighttpd.conf、config.php(rutorrent) at the same time
Besides, the wtorrent and rutorrent must user the smae method(If these two  methods can seperate for two webui,tell me how to do, please.)
Reader can refer the 'rutorrent/confconfig.php' line 30 and lighttpd.conf line 90 and rtorrent.rc script line 64 to fix these script description.
      
PS2----------------------------------------------------------------------------------------------------------------------------------------------                                        Although the rutorent and wtorrent webui can install and use for rtorrent at the same time,
rutorrent  can  interfere the wtorrent interface
If you upload torrents by rutorrent webui then the worrent interface will in disorder though it fuction is correct.      
BTW,the wtorrent delet function only can delet the list item and it can't delet the files in our hard disk.
If you use wtorrent to delet rtorrent item, you also need use ftp to delet hd files when you want to delet these files credibly.
http://blessing.bdmv.info/tutorial/rt08.png

PS3----------------------------------------------------------------------------------------------------------------------------------------------
In step G I provide  some kinds of wtorrent and give some fixed version of wtorrent.
I seriously suggest the reader use the wtorrent I fixed, because some issue can effect you to use the wtorrent function.

PS4----------------------------------------------------------------------------------------------------------------------------------------------
In other website provide another method to invode fastcgi scriptif [ -e /etc/lighttpd/conf-available/10-fastcgi-php5.conf ]; then
sudo /usr/sbin/lighty-enable-mod fastcgi-php5                     
else                                                              
sudo /usr/sbin/lighty-enable-mod fastcgi                          
fi Because I find we may not use the method in newer lighttpd, I stop use this method.
If reader is interested in this method, you can try yourself and mark lighttpd script line 55.
(search lighttpd.conf '#fastcgi (low lighttpd version?)' to get more information)

PS5----------------------------------------------------------------------------------------------------------------------------------------------
I provide two fastcgi script and list in lighttpd line 56 to 79.
(search lighttpd.conf '#fastcgi another script slection' to get more information)
Reader can select one of these two script, they are both can run successfully.                                                              
                                                                  
-------------------------------------------------------------REFERENCE-------------------------------------------------------------         
http://www.bdtorrents.com/forums/showthread.php/146-How-To-Install-rTorrent-amp-                                                                             
http://libtorrent.rakshasa.no/wiki/Install                                                                                                                    
http://www.polarhome.com/svn/SOURCE                                                                                                                          
http://code.google.com/p/wtorrent/                                                                                                                           
http://code.google.com/p/rutorrent/                                                                                                                           
https://www.d0z.net/archives/1005/                                                                                                                             
http://forums.gentoo.org/viewtopic-t-790918-start-0.html                                                                                                     
https://launchpad.net/~shiki/+archive/mediainfo                                                                                                               
http://corvuslee.blogspot.com/2011/03/update-rtorrent-087-with-wtorrent.html                                                                                   
http://petonline.dyndns.org/node/56                                                                                                                             
http://slashzeroconf.wordpress.com/2008/02/16/chkconfig-for-ubuntu-sysv-rc-conf/
http://forums.rutorrent.org/index.php?topic=1405.0
http://www.torrent-invites.com/seedbox-tutorials/42583-debian-ubuntu-dedicated-server-setup-17.html
十步安裝和配置完畢rTorrent   ruTorrent 服務端 http://flag.blog.hexun.com/84569399_d.html
請問rtorrent要支援ipv6要怎麼做? http://u2.dmhy.org/forums.php?ac ... 7060&page=last#last

Publish time 2011-12-15 01:12:00

There may some grammar or vocabulary problem in this tutorial.
If you want to give me some suggestion, just speak out what is in your mind.:$
Pages: [1]
View full version: [2011.12.15] How to Install the BT Client rtorrent And Webui rutorrent/wtorrent into Ubuntu Linux