rtorrent-0.8.6+libtorrent-0.12.6+apache2+php5+ruTorrent-2.8 on GNU/Linux Debian Lenny

Для начала нужно грохнуть из системы установленный ранее rtorrent, библиотеки libxmlrpc-c3, libtorrent11 и стянуть необходимые для сборки libcurl3-dev, libsigc++-2.0-0c2a, libsigc++-2.0-dev (про make, gcc, g++, autoconf, libncurses5-dev и др. я молчу — и так понятно, что без них никуда).
Подготовка к сборке заключается в получении свежего xmlrpc из SVN по адресу http://xmlrpc-c.svn.sourceforge.net/viewvc/xmlrpc-c/advanced/ (внизу страницы есть линк "Download GNU Tarball"), а также исходников rtorrent и libtorrent с сайта http://libtorrent.rakshasa.no/downloads/.

Опции ./configure для xmlrpc и libtorrent стандартные, могут возникнуть некоторые проблемы:
1) xmlrpc сфейлит при make install.
Fix: chmod +x install-sh (непонятно, почему его сразу исполняемым не сделали).

2) При компиляции libtorrent <0.12.6 может вылетать с ошибкой "file_list_iterator.h:64: error: 'abs' is not a member of 'std'".
Fix: patch -p1 http://libtorrent.rakshasa.no/attachment/ticket/1266/libtorrent-gcc43-v2.patch, внизу страницы линк на Original Format.

3) Собственно сам rtorrent нужно собирать с опцией --with-xmlrpc-c. При компиляции rtorrent <0.8.6 может вылетать с ошибкой "text_element_value.cc:117: error: ‘gmtime’ is not a member of ‘std’".
Fix: patch -p1 http://libtorrent.rakshasa.no/attachment/ticket/1267/rtorrent-gcc43.patch, внизу страницы линк на Original Format.

4) echo "include /usr/local/lib" >> /etc/ld.so.conf, иначе будет ругаться на отсутствие библиотек.

.rtorrent.rc:
min_peers = 1
max_peers = 200
download_rate = 200
upload_rate = 200
directory = /mnt/torrent/download
session = /mnt/torrent/session
port_range = 40893-40893
port_random = no
check_hash = no
encoding_list = cp1251
use_udp_trackers = no
session_save = yes
scgi_port=127.0.0.1:5000
encoding_list = UTF-8;CP1251;KOI8-R
Apache2:
Необходимые пакеты: apache2, libapache2-mod-php5, php5, php-cli, libapache2-mod-scgi. В sites-available создается файл rtorrent.domainname.ru:
<VirtualHost xx.xx.xx.xx:80>
    ServerAdmin webadmin@domainname.ru
    ServerName rtorrent.domainname.ru
    ServerAlias rtorrent.domainname.ru
    DocumentRoot /var/www/vhosts/rtorrent.domainname.ru/

    Options FollowSymLinks
    AllowOverride None

    ErrorLog /var/log/apache2/rtorrent.domainname.ru-error.log

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

    CustomLog /var/log/apache2/rtorrent.domainname.ru-access.log common
    ServerSignature On
</VirtualHost>

В /etc/apache2/apache2.conf в конец конфига добавить:
<Location "/RPC2">
    SetHandler scgi-handler
    SCGIServer 127.0.0.1:5000
    SCGIHandler On
    Options -Multiviews
    AuthName "RPC2 Restricted Area"
    AuthType Basic
    AuthBasicProvider file
    AuthUserFile /root/htpasswd/.rutorrent
    Require valid-user
</Location>


SCGIMount /RPC2 127.0.0.1:5000
В конфиге указано кого попало не пускать к веб-морде, AuthType Basic для меня вполне достаточно, апач доступен только из внутренних серых подсетей:

# htpasswd -c ~/htpasswd/.rutorrent admin
# chown www-data:www-data ~/htpasswd -R
# a2enmod scgi
# a2ensite /etc/apache2/sites-available/rtorrent.domainname.ru
# /etc/init.d/apache2 restart
# tail -f /var/log/apache2/error.log
 [Sun Mar 14 06:25:03 2010] [notice] Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny6 with Suhosin-Patch mod_scgi/1.12 configured -- resuming normal operations

rutorrent-2.8:
Проект обновляется достаточно часто и старые версии быстро перестают поддерживаться девелоперами, но не думаю, что установка будет в корне отличаться:

# cd ~ && wget http://rutorrent.googlecode.com/files/rutorrent-2.8.tar.gz
# extract rutorrent-2.8.tar.gz; mv ~/rtorrent/* /var/www/vhosts/rtorrent.domainname.ru/; chown www-data:www-data /var/www/ -R; rm -rf ~/rtorrent; mv ~/rutorrent-2.8.tar.gz /mnt/nas/dist/soft/

No comments:

Post a Comment