星期一, 7月 26, 2010

rTorrent + Rutorrent 安裝- RUtorrent 部份

接續前一篇安裝 rtorrent 的部份,

接下來安裝 Web UI 的部份

(1) rtorrent 的設定檔(~/.rtorrent.rc)中加入下面這兩行
scgi_local = /tmp/rpc.socket
schedule = chmod,0,0,"execute=chmod,777,/tmp/rpc.socket"

(2) 切換成 root

su root

(3) 修改 /etc/lighttpd/lighttpd.conf

vi /etc/lighttpd/lighttpd.conf

將檔案內容改成下面這樣, 比較要修改的是 IP 和主機名稱

=====================

server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_compress",
"mod_scgi",
"mod_fastcgi"
)
server.document-root = "/var/www/"
server.errorlog = "/var/log/lighttpd/error.log"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )
accesslog.filename = "/var/log/lighttpd/access.log"
url.access-deny = ( "~", ".inc",".db", ".tpl.php", ".cls.php" )
server.pid-file = "/var/run/lighttpd.pid"
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"
server.username = "www-data"
server.groupname = "www-data"
$HTTP["remoteip"] =~ "127.0.0.1" {
alias.url += (
"/doc/" => "/usr/share/doc/",
"/images/" => "/usr/share/images/"
)
$HTTP["url"] =~ "^/doc/|^/images/" {
dir-listing.activate = "enable"
}
}
$HTTP["host"] == "ks0000.kimsufi.com" {
server.document-root = "/var/www/"
server.errorlog = "/var/log/lighttpd/error.log"
accesslog.filename = "/var/log/lighttpd/access.log"
server.error-handler-404 = "/error-handler.php"
}
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/tmp/php.socket"
)))

scgi.server = (
"/RPC2" =>
( "127.0.0.1" =>
(
"socket" => "/tmp/rpc.socket",
"check-local" => "disable",
"disable-time" => 0, # don't disable scgi if connection fails
)
)
)

=====================

(4) 安裝 rutorrent

cd /var/www/

wget http://rutorrent.googlecode.com/files/rutorrent-3.1.tar.gz

tar zxfv rutorrent-3.1.tar.gz

cd rutorrent/

wget http://rutorrent.googlecode.com/files/plugins-3.1.tar.gz
tar zxfv plugins-3.1.tar.gz

(5) 修改 config.php

vi conf/config.php

找到下面兩行

==============

$scgi_port = 5000;
$scgi_host = "127.0.0.1";

==============

改成

==============

$scgi_port = 0;
$scgi_host = "unix:///tmp/rpc.socket";

==============

(6) 設定權限

chown –R www-data:www-data /var/www/rutorrent/

(7) 測試

啟動 rtorrent

/etc/init.d/rtorrent.sh restart

打開瀏覽器輸入 http://你的主機ip/rutorrent/

成功應該會看到下面的畫面

image

沒有留言: