您的位置:首页 > 其它

rTorrent + ruTorrent 安装和配置

2015-07-26 13:09 537 查看
原文地址:http://wangyan.org/blog/rtorrent-and-rutorrent-tutorial.htmlrTorrent 是一款非常简洁优秀的BT客户端,它完全基于文本并可以在Linux终端中运行。ruTorrent 是基于PHP的一个rTorrent前端,提供图形化的界面来管理 rTorrent。一、编译安装 libtorrent1.1 安装编译工具1.yum -y install gcc-c++ libtool2.yum -y install libsigc++20 libsigc++20-devel1.2 下载、编译、安装1.wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.9.tar.gz2.tar -zxf libtorrent-0.12.9.tar.gz3.cd libtorrent-0.12.94../configure5.make && make install二、编译安装 rtorrent2.1 安装依赖的软件包1.yum -y install gcc-c++ libtool2.yum -y install libsigc++20 libsigc++20-devel2.2 配置环境变量注:如果不先做这步,可能出现无法找到 libtorrent.so.5 等错误。1.echo "/usr/local/lib/" >> /etc/ld.so.conf2.ldconfig3.export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig2.3 安装 xmlrpc如果你想直接通过web界面管理rtorrent,则此步不能省。rtorrent 0.7.5 以后的版本web gui是通过xmlrpc来驱动。1.yum -y install xmlrpc-c-devel2.4 编译安装 rtorrent1.wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.9.tar.gz2.tar -zxf rtorrent-0.8.9.tar.gz3.cd rtorrent-0.8.94../configure --with-xmlrpc-c5.make && make install三、rTorrent 使用方法3.1 rtorrent 后台启动脚本该脚本用于管理rtorrent,包括启动、停止、重启操作,脚本内容见下面链接。
https://gist.github.com/1326099注:若不想以root身份运行该脚本,请修改替换rtorrent.sh中的root字符。1.wget http://wangyan.org/download/shell/rtorrent.sh2.mv rtorrent.sh /etc/init.d/rtorrent3.chmod a+x /etc/init.d/rtorrent3.2 rtorrent 运行方法方法一(推荐):使用上述管理脚本

方法二(推荐):通过Screen使用rTorrent,然后通过+A+D挂起、screen -r 恢复,详细快捷键见screen相关文档。

方法三:直接在终端运行,然后通过+Q 退出。详细快捷键见官方文档RTorrentUserGuide》1./usr/local/bin/rtorrent3.3 rtorrent 配置配置 rtorrent 是通过位于/home/username/.rtorrent.rc文件来完成。官方示例配置文件见rtorrent.rc example》

配置文件中文解释见下面链接,我不直接贴代码了,以免浪费文章篇幅。
https://gist.github.com/1325923注:配置文件里面所指定的目录要保证存在,否则启动rtorrent出错,可通过下面命令创建。
mkdir -p ~/rtorrent/{download, .session, .watch}四、ruTorrent 安装配置ruTorrent 是用来可视化管理 rtorrent的,它本身非常简洁,但可通过插件实现非常强大的功能。4.1 rtorrent xmlrpc-c 配置安装配置ruTorrent需保证,支持php和xmlrpc-c的Web环境已经配置好,否则出错。web套件可以是 lighttpd、apache、nginx。

xmlrpc-c 配置可参见官方文档Using XMLRPC with rtorrent》本文以Nginx为例来说明。

方法一:(官方不推荐)1.cat >>~/.rtorrent.rc<<-EOF2.scgi_port = localhost:50003.EOF方法二:(官方推荐)

注意:下面三行代码一行都不能少,先后顺序不能变,否则出现 "Could not prepare socket for listening: Address already inuse" 错误!1.cat >>~/.rtorrent.rc<<-EOF2.execute_nothrow=rm,/tmp/rpc.socket3.scgi_local = /tmp/rpc.socket4.schedule = chmod,0,0,"execute=chmod,777,/tmp/rpc.socket"5.EOF4.2 Nginx xmlrpc 配置修改nginx站点配置文件,在server字段加入下面内容。1.location /RPC2 {2.include scgi_params;3.#scgi_pass 127.0.0.1:5000;4.scgi_pass unix:///tmp/rpc.socket;5.}4.3 ruTorrent 安装配置ruTorrent 详细配置可查看官方文档ruTorrent Configuration》1.wget http://rutorrent.googlecode.com/files/rutorrent-3.3.tar.gz2.tar -zxf rutorrent-3.3.tar.gz3.mv rutorrent  /var/www4.chown -R www-data:www-data  /var/www/rutorrent/share/5.sed -i 's/\/\/ $scgi/$scgi/g' /var/www/rutorrent/conf/config.php6.sed -i 's/$scgi_port = 5000/\/\/ $scgi_port =5000/g'/var/www/rutorrent/conf/config.php7.sed -i 's/$scgi_host = "127/\/\/ $scgi_host ="127/g'/var/www/rutorrent/conf/config.php4.4 ruTorrent 访问密码保护创建密码文件1.htpasswd -b -c/var/www/rutorrent/.htpasswds username passwd修改nginx站点配置文件1.location /rtorrent {2.auth_basic "ruTorrentlogin";3.auth_basic_user_file/var/www/rtorrent/.htpasswds;4.}五、结束安装完成后,通过 http://youdomain/rutorrent 访问,然后输入帐号和密码即可看到以下界面。嗯,欢呼吧!混PT的小水管们。。。



参考资料:

1. http://libtorrent.rakshasa.no/wiki
2. https://wiki.archlinux.org/index.php/RTorrent
3. http://blog.45639.com/post-27.html
4. http://snowwolf725.blogspot.com/... 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: