BDMV.INFO

 Retrieve Password
 register now
Search
Hot: #
!show!: 51205|Reply: 1
Print Prev. thread Next thread

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

Rank: 9Rank: 9Rank: 9

Jump to a specific floor
樓主
Post time 2011-12-11 18:23:54 |Show the author posts only |Descending
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.
  1. sudo apt-get update
  2. 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 proftpd
Copy the Code
Be 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.
  1. 2011-11-20 13:50:00: (network.c.358) can't bind to port:  80 Address already in  use [fail]
Copy the Code
We can double check the situation  of binding to port.
  1. sudo netstat -lpn
  2. tcp        0      0 0.0.0.0:80            0.0.0.0:*               LISTEN      1440/apache2
Copy the Code
remove the apache2
  1. sudo /etc/init.d/apache2 stop
  2. sudo apt-get remove apache2
  3. sudo /etc/init.d/lighttpd restart
Copy the Code
Then, we can chkconfig for Ubuntu and stop the apache2 all the services.
  1. sudo apt-get update
  2. sudo apt-get install sysv-rc-conf
  3. sudo sysv-rc-conf
Copy the Code
In addation to install lighttpd and proftpd, other softwares will be use to rtorrent、rutorrent or wtorrent.

B-------------------------------------------------------------proftpd script-------------------------------------------------------------
  1. sudo vi /etc/proftpd/proftpd.conf
Copy the Code
add
  1. AllowForeignAddress             on
  2. RootLogin                                 on
  3. <IfModule mod_facts.c>
  4.     FactsAdvertise                      off
  5. </IfModule>
  6. AllowRetrieveRestart              on
  7. AllowOverwrite                        on
  8. AllowStoreRestart                   on                    
Copy the Code
Besides, I suggest the reader change  different with 22 port inavoid stranger attach.
Then,restart...
  1. sudo /etc/init.d/proftpd restart
Copy the Code
If 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.
  1. sudo vi /etc/ftpusers
Copy the Code
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.
  1. sudo adduser rt                               //add  user 'rt' on ubuntu platform                                 
  2. sudo chown rt:users /home/rt  
Copy the Code
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. 1 rt:for download files                     
  2. 2 rt-torrents:for torrents  
  3. 3 rt-session:for session  
Copy the Code
Make the folders and change the premission.
  1. cd ~
  2. mkdir rt rt-torrents rt-session
  3. sudo chown -R rt:www-data rt-torrents rt-session rt
  4. sudo chmod -R 770 rt-torrents rt-session rt
Copy the Code
Ps: 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.
  1. mkdir code && cd ~/code
  2. sudo apt-get install wget     

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

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

  13. wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.9.tar.gz
  14. tar zxvf rtorrent-0.8.9.tar.gz
  15. cd rtorrent-0.8.9
  16. sudo ./configure --with-xmlrpc-c&&sudo make&&sudo make install
  17.    
  18. sudo ldconfig
Copy the Code
Below is the steps  installing new version libtorrent/rtorrent(libtorrent0.13.2/rtorrent0.9.2).
  1. wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.13.2.tar.gz
  2. tar xzvf libtorrent-0.13.2.tar.gz
  3. cd libtorrent-0.13.2
  4. ./configure && make && sudo make install
  5. cd ..

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

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

  14. sudo ldconfig
Copy the Code
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-------------------------------------------------------------
  1. screen -S rt
  2. rtorrent
Copy the Code


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.
  1. /etc/lighttpd/lighttpd.conf
Copy the Code
Search '#change your server IP' to change the server IP yo match yours and change the owner to 'root'
  1. -rw-r--r--   1 root root  8281 2011-12-05 07:50 lighttpd.conf
Copy the Code
A 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.
  1. #rutorrent:password                                          
  2. #server.modules += ( "mod_auth" )                          
  3. #auth.backend = "htdigest"                                 
  4. #auth.backend.htdigest.userfile = "/etc/lighttpd/.auth"   
  5. #auth.debug = 2                                            
  6. #auth.require = ( "/rutorrent/" =>                        
  7. #(                                                         
  8. #"method" => "digest",                                    
  9. #"realm" => "Authorized users only",                       
  10. #"require" => "valid-user"                                 
  11. #)                                                         
  12. #)                                                         
  13.                                                            
  14. #rutorrent:ssl                                             
  15. #$SERVER["socket"] == ":443" {                             
  16. #ssl.engine = "enable"                                    
  17. #ssl.pemfile = "/etc/lighttpd/certs/lighttpd.pem"         
  18. #}
Copy the Code
Install the below softwares.
  1. sudo apt-get update
  2. sudo apt-get install p7zip-full
  3. sudo apt-get install php5-common php5-sqlite php5-xmlrpc libxmlrpc-c3 sqlite unzip php5-cgi php5-curl
  4. (ubuntu 64bits os: to change install libxmlrpc-c3 to libxmlrpc-c3-o)
Copy the Code
Download and Move wtorrent_official_upgrade_20111119.7z to /var/www/
  1. sudo 7z x wtorrent_official_upgrade_20111119.7z
  2. (sudo tar xzvf wtorrent.tar.gz)(if use wtorrent.tar.gz, see below content)
  3. sudo chown -R www-data:www-data wtorrent
  4. sudo /etc/init.d/lighttpd restart
Copy the Code
link to your home page
  1. http://host/wtorrent/install.php
Copy the Code
Reader must write the four items of this page especially the point 2 and 3.
  1. 1.Language
  2. 2.Folder to save uploaded torrents
  3. 3.Default folder to save torrent data
  4. 4.User
  5. 5.Password
Copy the Code

If reader create the same folder name as befor and use the account rt to run rtorrent, then...
  1. Folder to save uploaded torrents: /home/rt/rt-torrents/
  2. Default folder to save torrent data: /home/rt/rt/
Copy the Code
After fix the information, reader must try configuration and save configuration.Then reader can use the wtorent webui.
  1. http://host/wtorrent
Copy the Code
BTW, 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.




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.
  1. wget http://rutorrent.googlecode.com/files/rutorrent-3.3.tar.gz http://rutorrent.googlecode.com/files/plugins-3.3.tar.gz
  2. tar xzvf rutorrent-3.3.tar.gz&&sudo tar xzvf plugins-3.3.tar.gz
  3. sudo mv -f plugins rutorrent/
Copy the Code
  1. wget http://rutorrent.googlecode.com/files/rutorrent-3.4.tar.gz http://rutorrent.googlecode.com/files/plugins-3.4.tar.gz
  2. tar xzvf rutorrent-3.4.tar.gz&&sudo tar xzvf plugins-3.4.tar.gz
  3. sudo mv -f plugins rutorrent/
Copy the Code

fix the premissions
  1. sudo chmod -R 770 rutorrent/share/settings rutorrent/share/torrents rutorrent/share/users
  2. sudo chown -R rt:www-data rutorrent/share/settings rutorrent/share/torrents rutorrent/share/users
Copy the Code
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 lighttpd
  1. sudo /etc/init.d/lighttpd restart
  2. sudo ldconfig
Copy the Code
  1. http://host/rutorrent
Copy the Code
We 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.
  1. [19.11.2011 15:04:17] WebUI started. <tell us xmlrpc-c and rtorrent complier/make install successfully、libtorrent and rutorrent run ok>
  2. [19.11.2011 15:04:25] rss: Some functionality will be unavailable. Web-server user can't access external program (curl).
  3. [19.11.2011 15:04:25] mediainfo: Plugin will not work. Web-server user can't access external program (mediainfo).
  4. [19.11.2011 15:04:25] autotools: Plugin will not work. rTorrent's user can't access external program (php).
  5. [19.11.2011 15:04:25] create: Plugin will not work. rTorrent's user can't access external program (php).
  6. [19.11.2011 15:04:25] unpack: Plugin will not work. rTorrent's user can't access external program (php).
  7. [19.11.2011 15:04:25] rss: Plugin will not work. rTorrent's user can't access external program (php).
  8. [19.11.2011 15:04:25] retrackers: Plugin will not work. rTorrent's user can't access external program (php).
  9. [19.11.2011 15:04:25] trafic: Plugin will not work. rTorrent's user can't access external program (php).
  10. [19.11.2011 15:04:25] ratio: Some functionality will be unavailable. rTorrent's user can't access external program (php).
  11. [19.11.2011 15:04:25] scheduler: Plugin will not work. rTorrent's user can't access external program (php).
  12. [19.11.2011 15:04:25] rss: Some functionality will be unavailable. rTorrent's user can't access external program (curl).
  13. [19.11.2011 15:04:27] DataDir plugin: rTorrent's user can't access php interpreter. Plugin will not work.
  14. [19.11.2011 15:04:28] Unpack plugin: rTorrent's user can't access unrar program.
  15. [19.11.2011 15:09:18] torrent <tell us torrent files can be uploaded by rutorrent web user  interface>
Copy the Code
I-------------------------------------------------------------implement password and ssl for rutorrent-------------------------------------------------------------
Cancel the line 98 to line 115 mark of lighttpd script.
rt is user name.
  1. sudo htdigest -c /etc/lighttpd/.auth 'Authorized users only' rt
Copy the Code
add ssl
  1. sudo mkdir /etc/lighttpd/certs
  2. sudo openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout lighttpd.pem -out lighttpd.pem
Copy the Code
Than, we  add password and ssl to protect the transmission and use rtorrent client by rutorrent webui.
  1. https://host/rutorrent
Copy the Code
If there is a  warning of https ssl certicicate happened and it like below screen, ignore it and continue to enter the webui is ok.


J-------------------------------------------------------------install other sofewares-------------------------------------------------------------
We use PPA to install mediainfo
  1. sudo vi /etc/apt/sources.list
Copy the Code
Add mediainfo sources in sources.list(for example:ubuntu 10.04 desktop,other os please refer o the mediainfo official website
  1. deb http://ppa.launchpad.net/shiki/mediainfo/ubuntu lucid main
  2. deb-src http://ppa.launchpad.net/shiki/mediainfo/ubuntu lucid main
Copy the Code
  1. sudo add-apt-repository ppa:shiki/mediainfo
  2. sudo apt-get update
  3. sudo apt-get update
  4. apt-cache search mediainfo <double check databese list the mediainfo>
  5. sudo apt-get install mediainfo curl php5-cli unrar ffmpeg
  6. sudo apt-get install php5-geoip
  7. (Some system may need install unrar-free  to instead of unrar)
  8. (debain user need use dpkg to install mediainfo)
Copy the Code
Go to rutorrent/plugins and download the filemanager,then change the owner and group name.
  1. svn co http://svn.rutorrent.org/svn/filemanager/trunk/filemanager
Copy the Code
Because of some achieved tools combine with filemanager, we need install some lost software.
  1. wget http://www.rarlab.com/rar/rarlinux-x64-4.2.0.tar.gz
  2. tar xzvf rarlinux-x64-4.2.0.tar.gz
  3. cd rar
  4. sudo make install
  5. sudo apt-get install zip
Copy the Code
Config the filemanager  at rutorrent/plugins/filemanager/conf.php
  1. $pathToExternals['rar'] = '/usr/local/bin/rar';
Copy the Code
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




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.






###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.


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 script
  1. if [ -e /etc/lighttpd/conf-available/10-fastcgi-php5.conf ]; then
  2. sudo /usr/sbin/lighty-enable-mod fastcgi-php5                     
  3. else                                                              
  4. sudo /usr/sbin/lighty-enable-mod fastcgi                          
  5. fi
Copy the Code
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

Rank: 9Rank: 9Rank: 9

沙發
Post time 2011-12-15 01:12:00 |Show the author posts only
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.

Use magic Report

You have to log in before you can reply Login | register now

Archiver|Cell Phone|BDMV.INFO

GMT+8, 2024-12-22 16:21 , Processed in 0.018363 second(s), 7 queries , Xcache On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

Top