网上有很多树莓派搭建下载机的方法,用yaaw通过rpc方式访问 aria2,但是都没有加密,这就很不安全了。
网上查了
Set --rpc-secret= if you are using aria2 1.18.4(or higher) with 'JSON-RPC PATH' like http://token:secret@hostname:port/jsonrpc
Set --rpc-user= --rpc-passwd= if you are using aria2 1.15.2(or higher) with 'JSON-RPC PATH' like http://username:passwd@hostname:port/jsonrpc
aria2 1.18.4版本以上的已经不在支持 –rpc-user= –rpc-passwd= 这种加密方式了,只能用 token和secret方式加密。就是这里我一直用设置 username和passwd一直没效果,原来现在只支持token和secret方式加密。
下面说下具体操作过程
安装aria2
sudo apt-get install aria2
然后安装YAAW
下载地址 :http://binux.github.io/yaaw/
然后复制到 web访问的目录就行
创建aria2配置文件
sudo vi /home/pi/aria2.conf
#文件保存目录自行修改 dir=/home/pi/download disable-ipv6=true #打开rpc的目的是为了给web管理端用 enable-rpc=true rpc-allow-origin-all=true rpc-listen-all=true rpc-listen-port=6800 #建议端口也改了 rpc-secret=passwd #这里就是密码了 continue=true input-file=/etc/aria2/aria2.session save-session=/etc/aria2/aria2.session max-concurrent-downloads=3
然后把aria2设置为开机自启动
sudo echo ‘/usr/local/bin/aria2c –conf-path=/etc/aria2/aria2.conf’ >> /etc/init.d/rc.local
依照上面的方式运行 aria2 ,就可以在网页web端访问了然后设置
依照上面的配置的话,rpc的地址应该是 http://token:passwd@raspi.com:6800/jsonrpc