Advertisement
Guest User

Untitled

a guest
Aug 15th, 2012
1,736
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.00 KB | None | 0 0
  1. Setup
  2. Linux
  3.  
  4. Torrent auto uploader by Janhouse can probably be used on any Linux distribution (and it has been tested on CentOS, various Debian and Ubuntu versions and ArchLinux) but this guide explains setup on Debian based distributions (Debian and Ubuntu). If you are experienced enough, you can probably set it up on other distributions as well.
  5. Dependencies
  6.  
  7. While the Torrent Uploader (Tuper) depends on Perl and various Perl modules, some bittorrent client is needed for actual downloading and uploading, and web server with PHP is required to use Web panel and browser plugin. Uploader is made to work better with rTorrent bittorrent client. And for the sake of simpleness of the setup, Apache2 will be used as the web server.
  8.  
  9. If you are on a freshly installed box, make sure you first install sudo as user root.
  10.  
  11. apt-get update
  12. apt-get install sudo
  13.  
  14. Then install other dependencies that will be needed to compile rtorrent and perl modules.
  15.  
  16. If some of the following packages doesn't exist (e.g. mktorrent or rar, you can remove them from the list and continue on, they are needed only for auto extract feature). While all of them should be there for later Ubuntu versions, Debian needs to have non-free and contrib repositories enabled. You can Google how to do it, or use this How To .
  17.  
  18. If you are on older Debian version, like Debian Lenny, PHP 5.3 won't be in the package list. In this case you can use Dotdeb repository. Insturctions on adding it are here .
  19.  
  20. sudo apt-get update
  21. sudo apt-get install subversion build-essential libtool automake openssl libsigc++-2.0-dev libncurses5-dev libncursesw5-dev libcurl4-openssl-dev libcppunit-dev irssi screen apache2 libapache2-mod-php5 php5 php5-sqlite libapache2-mod-scgi php5-xmlrpc git-core rar mktorrent libxml-parser-perl libexpat1-dev unzip
  22.  
  23. Install Perl modules using cpan.
  24.  
  25. Uploader needs these Perl modules: Config::Tiny Convert::Bencode Date:arse DBI DBD::SQLite Digest::SHA1 HTML::Strip IO::Async IO::Async::SSL JSON::XS Net::BitTorrent::File PAR URI::Escape WWW::Curl XML::RPC XML::Simple String::CRC32 Encode LWP LWP::UserAgent LWP:rotocol::https HTTP::Cookies HTTP::Cookies::Netscape HTTP::Request HTTP::Request::Common URI Net::RTorrent::Socket XML:arser
  26.  
  27. First time starting cpan it will ask if you want it to configure automatically. Just press enter to accept default value (yes).
  28.  
  29. cpan
  30.  
  31. After it successfully configures cpan, cpan shell will open.
  32.  
  33. cpan[1]>
  34.  
  35. In it, execute the following command. It will keep asking if it should connect to the internet or install some additional modules. Just accept the default values by pressing enter.
  36.  
  37. force install Config::Tiny Convert::Bencode Date:arse DBI DBD::SQLite Digest::SHA1 HTML::Strip IO::Async IO::Async::SSL JSON::XS Net::BitTorrent::File PAR URI::Escape WWW::Curl XML::RPC XML::Simple String::CRC32 Encode LWP LWP::UserAgent LWP:rotocol::https HTTP::Cookies HTTP::Cookies::Netscape HTTP::Request HTTP::Request::Common URI Net::RTorrent::Socket
  38.  
  39.  
  40. To quit cpan shell, after everything is installed, use "quit" command.
  41.  
  42. Compiling rTorrent
  43.  
  44. Let's make source directory
  45.  
  46. cd ~/
  47. mkdir src
  48.  
  49. Following are instructions for compiling rTorrent with xmlrpc-c from SVN.
  50. If errors come up during the setup, instead of SVN version, try using the stable version that can be downloaded from rTorrent web page .
  51. Or you could use pyroscope setup script that will get all the dependencies and install rTorrent with some additional patches for the user that executes the script. (This could help for older outdated distribution versions). Guide can be found here .
  52.  
  53. Installing stable rTorrent:
  54.  
  55. Install libtorrent
  56.  
  57. wget http://libtorrent.rakshasa.no/...orrent-0.12.9.tar.gz
  58. tar zxvf libtorrent-0.12.9.tar.gz
  59. cd libtorrent-0.12.9
  60. ./autogen.sh
  61. ./configure
  62. make
  63. sudo make install
  64. cd ../
  65.  
  66. Install xmlrpc-c
  67.  
  68. svn co https://xmlrpc-c.svn.sourcefor...oot/xmlrpc-c/stable/ xmlrpc-c-svn
  69. cd xmlrpc-c-svn
  70. ./configure --disable-cplusplus
  71. make
  72. sudo make install
  73. cd ../
  74.  
  75. Install rtorrent with xmlrpc-c support
  76.  
  77. wget http://libtorrent.rakshasa.no/...torrent-0.8.9.tar.gz
  78. tar zxvf rtorrent-0.8.9.tar.gz
  79. cd rtorrent-0.8.9
  80. ./autogen.sh
  81. ./configure --with-xmlrpc-c
  82. make
  83. sudo make install
  84. echo "include /usr/local/lib" | sudo tee -a /etc/ld.so.conf
  85. sudo ldconfig
  86. cd ../
  87.  
  88. Apache (web panel)
  89.  
  90. Enable mod_scgi by executing following command.
  91.  
  92. sudo a2enmod scgi
  93.  
  94. Add SGCI mounts to /etc/apache2/httpd.conf
  95.  
  96. SCGIMount /rt1 127.0.0.1:5000
  97. SCGIMount /rt2 127.0.0.1:5001
  98.  
  99. Create user that will be running Tuper and rTorrent. You can use whatever username and home directory you like but default configuration files use user "tup" with home directory /home/tup/ .
  100.  
  101. sudo adduser tup
  102.  
  103. Add Apache alias to default virtualhost by editing /etc/apache2/sites-available/default .
  104. Web files will be located in /home/tup/www/ directory.
  105. Add the following lines after "DocumentRoot" line.
  106.  
  107. Alias /auto/ "/home/tup/www/"
  108. <Directory "/home/tup/www/">
  109. Options Indexes MultiViews FollowSymLinks
  110. AllowOverride All
  111. Order allow,deny
  112. Allow from all
  113. </Directory>
  114.  
  115. Create the web directory and set up permissions. Since Apache2 on Debian and Ubuntu runs from user www-data, chown it to that user.
  116.  
  117. sudo mkdir -p /home/tup/www
  118. sudo chown www-data:tup /home/tup/www
  119. sudo chmod g+rxw /home/tup/www
  120.  
  121. Restart Apache2. See if any errors come up. If there are errors, fix them and repeat the command.
  122.  
  123. sudo /etc/init.d/apache2 restart
  124.  
  125. If you now navigate to http://YOUR_HOST/auto/ , you should see empty directory index.
  126.  
  127. Edit /etc/sudoers file, to allow www-data to execute rTorrent and Tuper status scripts as user tup without entering password.
  128.  
  129. www-data ALL=(tup) NOPASSWD: /home/tup/tuper/status.sh, /home/tup/tuper/start-screen.sh
  130.  
  131. Getting Tuper from SVN
  132.  
  133. Login as user tup (you can switch to it quickly by doing "sudo -i -u tup").
  134.  
  135. Check out tuper, web_panel and browse_plugin folders from SVN.
  136. SVN client will ask for password for user "tup". Do not enter it and press enter, it will then ask for different username. Enter your SVN username and password.
  137.  
  138. cd /home/tup
  139. svn co https://svn.janhouse.lv/repos/tuper-v3/trunk/tuper/ tuper/
  140. svn co https://svn.janhouse.lv/repos/tuper-v3/trunk/web_panel/ www/web_panel/
  141. svn co https://svn.janhouse.lv/repos/tuper-v3/trunk/browser_plugin/ www/browser_plugin/
  142.  
  143. Configuring Tuper
  144.  
  145. Create needed directories and configuration files.
  146.  
  147. For Tuper to store .torrent files, .nfo, database and cookiejar:
  148.  
  149. mkdir -p storage/store
  150.  
  151. Session directories for rtorrent, downloads and watch directories:
  152.  
  153. mkdir .session1
  154. mkdir .session2
  155. mkdir downloads
  156. mkdir storage/watch1
  157. mkdir storage/watch2
  158.  
  159. ... must finish.
  160.  
  161. cd tuper
  162. mv default.tuper.conf tuper.conf
  163. mv default.tuper.db ../storage/tuper.db
  164. mv default.tuper.filter.conf tuper.filter.conf
  165.  
  166. cd ../www/web_panel
  167. mv default.config.inc.php config.inc.php
  168.  
  169. cd ../browser_plugin
  170. mv default.upload_plugin_config.php upload_plugin_config.php
  171.  
  172. Add username and key in /home/tup/tuper/tuper.conf and you should be able to run it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement