找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 26658|回复: 35

【原创】rtorrent脱机下载,rutorrent和rtwi实现web控制的傻瓜式完美教程之二

[复制链接]
本帖最后由 hjshjs 于 2009-9-6 21:49 编辑

三、安装samba3

(一)下载SAMBA 3最新版
下载地址:http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable,请在里面找文件名为samba_*.*.**-*_mipsel.ipk的文件
下载后用winscp传至usb硬盘的jffs目录
(二)安装SAMBA3
输入mount -o bind /jffs/opt /opt
输入opt/bin/ipkg update
注意,opt前面没有斜杠。后面涉及ipkg命令,请都务必输入opt/bin/ipkg ***

输入opt/bin/ipkg install samba_3.2.14-1_mipsel.ipk

在按照SAMBA的过程中,IPKG会自动安装相应的依赖包,并在最后提示你,原来samba2的配置文件已经不能再用了,请配置新的smb.conf.
(三)设置SAMBA3
1、用winscp打开opt/etc/samba/smb.conf,没有这个文件就自己建一个。
提示,如果没看见samba目录,要按ctrl+r刷新一下。
参考设置如下:
[global]
bind interfaces only = yes
interfaces = 192.168.2.1/24
workgroup = Workgroup
server string = Linksys WRT600N
guest account = root
security = share
load printers = no
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE
netbios name = Linksys WRT600N
browseable = yes
dns proxy = no
guest ok = yes
guest only = no
log level = 1
max log size = 100
encrypt passwords = yes
preserve case = yes
short preserve case = yes
dos charset = UTF-8
unix charset = UTF-8
display charset = UTF-8
wins support = yes
time server = yes
os level = 255
local master = yes
domain master = yes
preferred master = yes
hosts allow = 192.168.2.1/24

[Share]
path = /opt/share
browseable = yes
writable = yes

[USB]
path = /tmp/mnt/disc1
browseable = yes
writable = yes

[Downloads]
path = /mmc/downloads
browseable = yes
writable = yes
以上红色部分请根据自己路由器的情况设定,用方括号括起来的那些内容,是以后用网上邻居访问时默认会显示的文件夹。
注意:[Downloads]一节,是为后面BT下载资料的保存地点,请现用winscpmmc文件夹下先新建downloads文件夹。

2、用winscp打开opt/etc/init.d/S08samba文件
samba_active=0 改成 samba_active=1
保存退出
这样SAMBA就设置好了。
(四)启动SAMBA3
输入opt/etc/init.d/S08samba
系统提示:
Starting nmbd:
Starting smbd:
这样samba就启动了。

进入网上邻居,你就可以看到你的移动硬盘了。

四、安装rTorrent和Screen
1、输入opt/bin/ipkg install rtorrent


2、输入opt/bin/ipkg install screen


Screen安装完不用设置。
3、设置rTorrent
用winscp打开/jffs/opt/etc/rtorrent.conf文件,里面内容很多,很多不用管它,参照我的设置就行了。把原来的内容全部删掉,直接把下面内容复制后贴进去。


scgi_port = :5000 #这行不要动
min_peers = 10
max_peers = 50
max_uploads = 5
port_range = 51777-51780 #这个是bt端口
use_udp_trackers = yes
safe_sync = yes
dht = on #打开dht
dht_port = 6885 #dht端口
umask = 0000 #这行不要动
peer_exchange = yes
download_rate = 0 #下载限速,0表示不限速
upload_rate = 60 #上传限速
check_hash = no #下载完毕不hash
hash_read_ahead = 5
hash_max_tries = 5
hash_interval = 10
encryption = allow_incoming,enable_retry,prefer_plaintext
directory = /mmc/downloads #bt文件下载目录,知道在SAMBA哪里设置时的提示了吧
session = /mmc/downloads/torrent/session #这个是rTorrent的缓存文件夹
schedule = watch_directory,5,5,load_start=/mmc/downloads/torrent/*.torrent #监控目录,只要把种子丢进这个文件夹,rTorrent就会自动下载
schedule = untied_directory,5,5,stop_untied=
schedule = untied_directory,5,5,close_untied=
schedule = untied_directory,5,5,remove_untied=
schedule = low_diskspace,5,60,close_low_diskspace=50M
encoding_list = UTF-8 #这样设置听说不会乱码
4、启动rTorrent
把rtorrent.conf复制到/opt/root目录(没有这个目录就自己建一个),并更名为.rtorrent.rc。注意,前面有个点。
然后
输入/opt/bin/screen -d -m /opt/bin/rtorrent -n -o import=/opt/root/.rtorrent.rc
rTorrent就启动了。
如要实现开机即bt下载,可以将该命令加到路由器的启动命令中。
为了达到更好的下载效果,需要dd的管理-命令中,添加防火墙命令:
iptables -I INPUT -p tcp --dport 6885 -j ACCEPT
iptables -I INPUT -p udp --dport 6885 -j ACCEPT
iptables -I INPUT -p tcp --dport 51777:51780 -j ACCEPT
iptables -I INPUT -p udp --dport 51777:51780 -j ACCEPT

上面的端口,请与rtorrent.conf文件保持一致


五、安装lighttpd和php支持
WEB界面控制必须得到lighttpd和php的支持
1、输入opt/bin/ipkg install lighttpd


2、设置lighttpd
用winscp打开/jffs/opt/etc/lighttpd.conf
在server.modules段,去掉"mod_fastcgi",前面的#号
然后在后面加上"mod_scgi"。看下图:


然后,在最后面加上:
scgi.server = ( "/RPC2" =>
                   ( "127.0.0.1" =>
                     (
                       "host" => "127.0.0.1",
                       "port" => 5000,
                       "check-local" => "disable"
                     )
                   )
                )
保存退出。Lighttpd设置完毕。
输入opt/etc/init.d/S80lighttpd
Lihttpd就启动了,在浏览器地址栏输入http://ip地址:8081/。提示lighttpd server is running.
说明lighttpd已经在运行了。
要实现lighttpd和rtorrent的开机自动运行,请在DD的管理-命令中添加如下启动命令:
opt/bin/screen -d -m /opt/bin/rtorrent -n -o import=/opt/root/.rtorrent.rc
opt/etc/init.d/S80lighttpd restart
效果如下图:



3、安装PHP
注意,这里是折腾了一晚上才搞定的地方。
(1)安装PHP
输入opt/bin/ipkg install php


提示有个bzip2没有安装完成,与busybox-links冲突。
就是这个地方我没注意,导致lighttpd一直得不到php的支持,也导致web控制界面打不开。
经查证,这是许多网友不能实现web控制的主要原因。
解决办法如下:
既然与busybox冲突,那就移掉它
输入opt/bin/ipkg remove busybox
再输入opt/bin/ipkg remove busybox-links


然后再输入opt/bin/ipkg install php

看,顺利完成

(2)安装PHP-fcgi
PHP安装完了还得装PHP-fcgi。别忘了
输入opt/bin/ipkg install php-fcgi


至此。PHP安装结束。
(3)检验
编辑一个文件名为info.php文件,内容为<?php phpinfo(); ?>
放到/jffs/opt/share/www目录,然后再浏览器中输入http://ip地址:8081/info.php

大功即将告成。

六、实现WEB控制
(一)rutorrent控制界面
http://code.google.com/p/rutorrent/,下载rtorrent-2.6.tar,在页面右边。
在电脑上用winrar解压后,把rtorrent文件夹放到/jffs/opt/share/www目录。放进去即可,不需要什么设置


然后再浏览器输入http://路由器ip地址:8081/rtorrent,rutorrent控制界面就打开了

注意:打开rutorrent界面前,请确保rtorrent已经运行,并建议将lighttpd重启一次。重启命令为:opt/etc/init.d/S80lighttpd restart

RTWI控制在下一篇文章:【原创】rtorrent脱机下载,rutorrent和rtwi实现web控制的傻瓜式完美教程之三

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
楼主,没有‘/opt/root’这个目录呀!?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
2# ztcom
没有就自己建一个
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

不错的文章,更新了rtorrent webui到最新版

LZ能不能把transmission的安装和远程管理详细说明一下?我用MSS,rtorrent下载要分割为小于2G的文件,正在考虑是不是换transmission
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
4# lilihust


把硬盘存放文件的那个区格式化为ext3,就肯定能支持大于4G的文件。我刚刚下载了一个28G的1080P电影,嘿嘿。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

就是不想格式化为Ext3 分区,另外,顺便把rutorrent的语言文件修改了一下,能翻译过来的都翻译了
还有两处请大家看看怎么翻译为好

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

楼主,为什么我到“
至此。PHP安装结束。
(3)检验
编辑一个文件名为info.php文件,内容为<?php phpinfo(); ?>
放到/jffs/opt/share/www目录,然后再浏览器中输入http://ip地址:8081/info.php
”这一步显示的是
“403 - Forbidden”
我做的一步都不差呀!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

机子放了一个晚上,正常了。怪哉...
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
8# ztcom


lighttpd要重启一下。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

玩来玩去,最终放弃
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
你刷的DD是什么版本?在菜单的服务-usb里有没有吧ext2勾选?如果勾选的话应该没问题的啊。
对了,挂在U盘的命令是mount /dev/scsi/host0/bus0/target0/lun0/part1 /jffs
opt/bin/ipkg update显示not found,是因为u盘没有挂在,找不到/jffs/opt/bin目录下的ipkg命令。
而直接输入ipkg update,用的是DD自带的ipkg包。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

我也出现了楼上那位的情况,如果要同时实现ftp http的下载那怎么弄啊
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
今天又试了,做到这一步 3、安装PHP
注意,这里是折腾了一晚上才搞定的地方。
(1)安装PHP
输入opt/bin/ipkg install php
显示Input/output error ,怎么回事?u盘灯长亮

root@DD-WRT:~# cd /jffs
root@DD- ...
merrykid 发表于 2009-9-23 13:15



尽量不要用U盘,不稳定。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
启动然后再浏览器输入http://路由器ip地址:8081/rtorrent,rutorrent控制界面就打开了显示下面的信息,怎么办
[23.09.2009 13:53:36] WebUI started.
[23.09.2009 13:53:36] Bad link to rTorrent. Check if it is ...
merrykid 发表于 2009-9-23 13:56


ps看看,rtorrent启动了没有。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

本帖最后由 parasol 于 2009-9-30 23:21 编辑

17# hjshjs


我也遇到了这个问题,教程仔细检查过,没有问题,而且重新执行了一次。
现在发现一些问题,不知道是不是导致不能下载的原因:
1,运行rtorrent——/opt/bin/screen -d -m /opt/bin/rtorrent -n -o import=/opt/root/.rtorrent.rc,没有任何反应

2,运行opt/bin/rtorrent -o import=/opt/root/.rtorrent.rc,提示

3,运行opt/bin/rtorren,提示


另外,rutorrent能运行,但有错误提示,而且不能添加Torrent,提示如下:

WebUI started.
Bad link to rTorrent.Check if it is really running.Check$scgi_port and $scgi_host setting in config.php and scgi_port in rTorrent configuration file.
Bad response: (404)<?xml version="1.0"encoding="iso8859-1"?><!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"xml:lang="en"lang="en"><head><title>404-Not Found</title></head><body><h1>404-Not Found</h1></body></html>
不能设置,点击设置按钮再次出现Bad response: 行错误提示

添加Torrent没有任何反应,但后来发现在种子会出现在\\DD-WRT\Share\www\rtorrent\torrents这个目录,即/jffs/opt/share/www/rtorrent/rtorrent里,但不会开始下载。
请帮忙分析查找一下原因,谢谢。

是否不能读取.rtorrent.rc文件是重要原因?.rtorrent.rc文件中有scgi_port = :5000的设置。如果是,怎样解决?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-5-4 13:14

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表