-
How to install rTorrent 0.8.2 and rtgui 0.2.5 linstation ls2
hzjackboy 发布于 2008-11-12 21:05:20
- 1. 首先安裝必要的 web server 及 php 相關元件,並且在安裝完成後建立一個 phpinfo.php 檔案來測試 php 是否 work
$ sudo apt-get autoremove
$ sudo apt-get install apache2-mpm-prefork php5 php5-xmlrpc libapache2-mod-scgi
$sudo vi /var/www/phpinfo.php< ?php
phpinfo();
?>- 2. 安裝 rtorrent 並執行 rtorrent 來測試是否能啟動,不過剛安裝完的狀況會如下圖所示,缺少 .rtorrent.rc 檔案
$ sudo apt-get install rtorrent
$ rtorrent- 3. 建立並編輯一個 .rtorrent.rc 檔案在您的家目錄中,若您要以 root 權限執行 rtorrent 則將此檔案放到 root 目錄中,以下紅色標註部份內容請修改為符合自己環境
$ vi .rtorrent.rc
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.# Maximum and minimum number of peers to connect to per torrent.
min_peers = 50
max_peers = 500# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 10
max_peers_seed = 50# Maximum number of simultanious uploads per torrent.
max_uploads = 3encoding_list = UTF-8
# Global upload and download rate in KiB. “0″ for unlimited.
download_rate = 0
upload_rate = 5# Default directory to save the downloaded torrents.
directory = /data/file# Default session directory. Make sure you don’t run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /data/session# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/data/file/*.torrent
#schedule = untied_directory,5,5,stop_untied=# Close torrents when diskspace is low.
#schedule = low_diskspace,5,60,close_low_diskspace=100M# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,”stop_on_ratio=200,200M,2000″# The ip address reported to the tracker.
ip = 127.0.0.1
#ip = rakshasa.no# The ip address the listening socket and outgoing connections is
# bound to.
#bind = *# Port range to use for listening.
port_range = 6890-6999# Start opening ports at a random position within the port range.
#port_random = no# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
check_hash = yes# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes# Alternative calls to bind and ip that should handle dynamic ip’s.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,enable_retry,prefer_plaintext# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to “disable” (completely disable DHT), “off” (do not start DHT),
# “auto” (start and stop DHT as needed), or “on” (start DHT immediately).
# The default is “off”. For DHT to work, a session directory must be defined.
#
dht = on# UDP port to use for DHT.
#
dht_port = 19000# Enable peer exchange (for torrents not marked private)
#
peer_exchange = yes#
# Do not modify the following parameters unless you know what you’re doing.
## Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10# Interval between attempts to check the hash, in milliseconds.
hash_interval = 150# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 10umask = 0000
scgi_port = 127.0.0.1:5000- 4. 編輯 apache 設定檔
$ sudo vi /etc/apache2/sites-enabled/000-default
LoadModule scgi_module /usr/lib/apache2/modules/mod_scgi.so
SCGIMount /RPC2 127.0.0.1:5000- 5. 下載 rtgui 並且解壓縮到您的 web server 預設目錄中
$ wget http://rtgui.googlecode.com/files/rtgui-0.2.5.tgz
$ tar -zxvf rtgui-0.2.5.tgz
$ mv rtgui-0.2.5 rtgui
$ sudo mv -f rtgui /var/www/- 6. 編輯 config.php 檔案中的目錄路徑內容為符合您的需求
$ sudo vi /var/www/rtgui/config.php
< ?php
//
// rtGui - Simon Hall 2007-2008
//
// http://rtgui.googlecode.com/
//// Connect string for your local RPC/rTorrent connection:
$rpc_connect="http://localhost/RPC2";// rtorrent 'watch' directory (used for upload torrent)
$watchdir=”/data/file/”;// Path to report disk usage
$downloaddir=”/data/file”;// Time between ajax calls - default 5000 (5 secs). Disable with 0
$defaultrefresh=5000;// Display tracker URL for each torrent on main page - you might want to disable this if you run lots (ie 30+ ?) torrents - To get the tracker URL requires another RPC call for every torrent displayed. If it’s disabled, it only requires one RPC call to list all the torrents.
$displaytrackerurl=TRUE;// URL to your rtGui installation (used in RSS feed). Include trailing slash.
$rtguiurl=”http://fry/rtgui/”;// Speeds for the download cap settings dialog.
$defspeeds=array(5,10,15,20,30,40,50,60,70,80,90,100,125,150,200,250,300,400,500,750,1000);// Enable debug tabs
$debugtab=FALSE;// Tracker hilighting…
// Format is array(hexcolour, URL, URL, …) The URL is a string to match identifiy tracker URL
$tracker_hilite_default=”#900″; // Default colour
$tracker_hilite[]=array(”#990000″,”ibiblio.org”,”etree.org”);
$tracker_hilite[]=array(”#006699″,”another.com”,”mytracker.net”,”mytracker.com”);
$tracker_hilite[]=array(”#996600″,”moretrackers.com”);
?>- 7. 修改完成後執行 rtorrent 並開啟瀏覽器並瀏覽您的 rtgui 目錄,此時您將可以看到如下圖:
$ rtorrent
- 1. 首先安裝必要的 web server 及 php 相關元件,並且在安裝完成後建立一個 phpinfo.php 檔案來測試 php 是否 work




