軟體的設定重點只有兩步:
1. 主機 IP 位址
2. 與 torrent 溝通使用的 SCGI 名稱:通常是 RPC2
在 Server 上與這個參數有關的地方共兩處:
(a) web server 裡面 scgi 設定項目
(b) .rtorrent.rc 檔內的 scgi_port 參數
在 Server 上與這個參數有關的地方共兩處:
(a) web server 裡面 scgi 設定項目
(b) .rtorrent.rc 檔內的 scgi_port 參數
User / Browser -->Web Server-->rutorrent--scgi:5000--> rtorrent一、安裝 web server、php、rtorrent、screen
前端叫:rutorrent (這是 php 寫成的網頁)
後端叫:rtorrent (兩者差一個"u"字 別搞錯了)
使用者用瀏覽器操作 UI 介面,訊號透過 SCGI 傳到後端的 rtorrent 程式。
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
lighttpd php5-cgi php5-common rtorrent spawn-fcgi
After this operation, 23.4 MB of additional disk space will be used.
server.modules += ( "mod_fastcgi" )
fastcgi.server += ( ".php" =>
((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/var/run/lighttpd/php.socket",
"max-procs" => 1,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "0",
"PHP_FCGI_MAX_REQUESTS" => "10000"
),
"bin-copy-environment" => (
"PATH", "SHELL", "USER"
),
"broken-scriptfilename" => "enable"
))
)
server.modules += ( "mod_scgi" ) scgi.server = ( "/RPC2"=> ( "127.0.0.1" => ( "host" => "127.0.0.1", "port" => 5000, "check-local" => "disable" ) ) )
* Stopping web server lighttpd [ OK ] * Starting web server lighttpd [ OK ]
# Maximum and minimum number of peers to connect to per torrent. min_peers = 20 max_peers = 60 # Same as above but for seeding completed torrents min_peers_seed = 1 max_peers_seed = 1 # Maximum number of simultanious uploads per torrent. max_uploads = 1 # Global upload and download rate in KiB. "0" for unlimited. download_rate = 1500 upload_rate = 1 # Default directory to save the downloaded torrents. directory = ./ # Default session directory. session = ./session # For Web UI (Rutorrent @ SCGI port 5000) scgi_port = localhost:5000 encoding_list = UTF-8 # Watch a directory for new torrents schedule = watch_directory,5,5, "load_start=./*.torrent, d.set_custom1=./../tmp" system.method.set_key = event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,$d.get_custom1=;" # Enable DHT. dht = on dht_port = 6778 # Enable peer exchange peer_exchange = yes
(a) 透過網頁 http://x.x.x.x/jack/rutorrent/ 進行種子上傳。九、請記得:rtorrent 一定要在 screen 裡面執行,才能確保 torrent 運作不中斷。
(b) 透過 FTP 將種子上傳到 ~/bt/ 目錄下。
/usr/bin/rtorrent那何不先裝新版的 rTorrent 後,再抽換舊版的執行檔?反正關鍵程式只有一個。
/usr/share/doc/rtorrent/NEWS.Debian.gz
/usr/share/doc/rtorrent/changelog.Debian.gz
/usr/share/doc/rtorrent/copyright
/usr/share/doc/rtorrent/examples/fixSession080.py.gz
/usr/share/man/man1/rtorrent.1.gz
# apt-get install rtorrent2. 取得舊版 v0.8.6 的 rTorrent 及其相依套件:
# dpkg -i libssl0.9.8_0.9.8o-4squeeze14_i386.deb3. 最後把舊版的 rTorrent 拷到 /usr/bin/ 目錄下面。整個大功告成。
# dpkg -i libtorrent11_0.12.6-2_i386.deb
# ar x rtorrent_0.8.6-1_i386.deb ( 然後再解開 data.tar.gz 可取得執行檔 )
# rtorrent (version 0.9.X) # directory tree [~/bt/session] && [~/bt/unfinished] && [~/done] # Maximum and minimum number of peers to connect to per torrent. throttle.min_peers.normal.set = 20 throttle.max_peers.normal.set = 70 # Same as above but for seeding completed torrents (-1 = same as downloading) throttle.min_peers.seed.set = 1 throttle.max_peers.seed.set = 1 # Maximum number of simultanious uploads per torrent. throttle.max_uploads.set = 1 # Global upload and download rate in KiB. "0" for unlimited. download_rate = 2048 upload_rate = 1 # Default directory to save the downloaded torrents. directory.default.set = ~/bt/unfinished # Default session directory. Make sure you don't run multiple instance session.path.set = ~/bt/session schedule2 = watch_directory,5,5,load.start=~/bt/*.torrent # Move finished file to [done] directory method.insert = d.get_finished_dir, simple, "cat=~/done/,$d.custom1=" method.insert = d.data_path, simple, "if=(d.is_multi_file), (cat,(d.directory),/), (cat,(d.directory),/,(d.name))" method.insert = d.move_to_complete, simple, "d.directory.set=$argument.1=; execute=mkdir,-p,$argument.1=; execute=mv,-u,$argument.0=,$argument.1=; d.save_full_session=" method.set_key = event.download.finished,move_complete,"d.move_to_complete=$d.data_path=,$d.get_finished_dir=" # Close torrents when disk-space less than 1000M. schedule2 = low_diskspace,5,60,close_low_diskspace=1000M # For web UI -- rutorrent encoding_list = UTF-8 scgi_port = 127.0.0.1:5000
# Maximum and minimum number of peers to connect to per torrent. min_peers = 20 max_peers = 70 # Same as above but for seeding completed torrents min_peers_seed = 1 max_peers_seed = 1 # Maximum number of simultanious uploads per torrent. max_uploads = 1 # Global upload and download rate in KiB. "0" for unlimited. download_rate = 700 upload_rate = 2 # Default directory to save the downloaded torrents. directory = ./ # Default session directory. session = ./session # Watch a directory for new torrents. schedule = watch_directory,5,5, "load_start=./*.torrent, d.set_custom1=./../Download" # Move completed files to Directory [custom1] system.method.set_key = event.download.finished,move_complete, "execute=mv,-u,$d.get_base_path=,$d.get_custom1=;" # Enable DHT support for trackerless torrents. dht = on dht_port = 6778 # Enable peer exchange (for torrents not marked private) peer_exchange = yes
server.modules += ( "mod_scgi" )2. 設定 rtorrent.rc ,其中 scgi 的 port 要與 RPC1 對到
scgi.server = (
"/RPC1"=>
(
"127.0.0.1" =>
(
"host" => "127.0.0.1",
"port" => 5000,
"check-local" => "disable"
)
),
"/RPC2"=>
(
"127.0.0.1" =>
(
"host" => "127.0.0.1",
"port" => 5001,
"check-local" => "disable"
),
)
)
scgi_port = localhost:50003. 解開 rutorrent 的 tar 壓縮,設定 [share] 目錄權限encoding_list = UTF-8
on_erase = rm_files,"execute=rm,-rf,$d.get_base_path="
directory = ~/bt