using xmlrpc with rtorrent && ntorrent install
时间:2009-07-17 来源:marksman201

- 利用源码包安装rtorrent(0.7.5 or later),编译时加上编译选项--with-xmlrpc-c
- 安装lighttpd:sudo apt-get install lighttpd
- 安装xmlrpc-c
- 在rtorrent的配置文件.rtorrent.rc中添加一行:
scgi_port = localhost:5000 |
5. 在/etc/lighttpd/lighttpd.conf中添加以下几行:
# ipkg update |
重启lighttpd:sudo /etc/init.d/lighttpd restart
打开rtorrent软件:rtorrent
在终端中执行:xmlrpc localhost system.listMethods
会显示如下内容:
Index 0 String: 'system.listMethods' |
这就表明xmlrpc可以连上rtorrent了。
下面该安装ntorrent了,下载ntorrent:http://code.google.com/p/ntorrent/downloads/list
ntorrent是基于java开发的,所以在运行ntorrent之前得先配置好java环境:
http://forum.ubuntu.org.cn/viewtopic.php?t=119815
如果要在windows下配置java环境的话,自己g一下吧。
现在直接运行ntorrent:sh nTorrent.sh
经过简单配置就可以了。
同样,利用apache2服务器进行xmlrpc命令的转发也行,不过apache2默认是没有scgi模块的(Lighttpd should have this built-in),得自己动手链接这个模块。
- sudo apt-get install libapache2-mod-scgi 这样在/etc/apache2/mods-avalable目录下就会多一个scgi.load文件。
- 创建这个文件的软连接,放在/etc/apache2/mods-enable目录下:ln -s /etc/apache2/mods-avalable/scgi.load /etc/apache2/mods-enable/scgi.load 这样apache2就加载上scgi模块了。
- 重启apache2:sudo /etc/init.d/apache2 restart
在apache的配置文件/etc/apache2/httpd.conf中添加一行:
SCGIMount /RPC2 127.0.0.1:5000 |
同样在.rtorrent.rc中添加一行:
scgi_port = localhost:5000 |
然后开启rtorrent,在终端中试试这条命令:xmlrpc localhost system.listMethods
如果输出同上,表明xmlrpc和rtorrent连接正常。
以后下载ntorrent、配置java环境等步骤同上面所讲。
参考资料:
RtorrentWithRemoteGUI:http://www.nslu2-linux.org/wiki/HowTo/RtorrentWithRemoteGUI
Using XMLRPC with rtorrent:http://libtorrent.rakshasa.no/wiki/RTorrentXMLRPCGuide
ubuntu下java开发环境搭建:http://forum.ubuntu.org.cn/viewtopic.php?t=119815