首先安装Aria2
要先更新下sources.list 位于/etc/apt/sources.list 直接替换即可 然后执行 apt-get update
# deb http://http.us.debian.org/debian/ wheezy main deb http://ftp.de.debian.org/debian jessie main deb http://http.us.debian.org/debian/ wheezy main deb-src http://http.us.debian.org/debian/ wheezy main deb http://security.debian.org/ wheezy/updates main deb-src http://security.debian.org/ wheezy/updates main # wheezy-updates, previously known as 'volatile' deb http://http.us.debian.org/debian/ wheezy-updates main deb-src http://http.us.debian.org/debian/ wheezy-updates main
更新完sources在之后执行
apt-get install aria2
然后
1.下载本文末的aria2.conf,修改其中的文件保存路径:dir=/home/wwwroot/pan.xxx.com
2.修改完上传到/root/中
3.创建一个aria2.session文件:echo ” > /root/aria2.session;
4.测试是否可以启动aria2c –enable-rpc –rpc-listen-all=true –rpc-allow-origin-all -c –conf-path=/root/aria2.conf
然后下载yaaw 放入网站目录 前提是有PHP+NGINX
https://github.com/binux/yaaw
然后要让aria2可以后台运行 使用screen
apt-get install screen
screen -S 任务名
然后执行
aria2c –enable-rpc –rpc-listen-all=true –rpc-allow-origin-all -c –conf-path=/root/aria2.conf
然后按ctrl+a+d 暂时离开 会话仍然保持
恢复screen会话
当回来时可以再执行执行:screen -r wordname 即可恢复到离开前创建的lnmp会话的工作界面。
如果忘记或者刚开始没有指定会话名,执行screen -ls列出当前的会话列表;
screen -ls
There are screens on:
12738.wordname (Detached)
1 Sockets in /var/run/screen/S-root
12738.wordname即为即才screen创建的会话,恢复回话:screen -r 12738
最后 为了aria2只能自己使用 在配置文件aria2.conf中 启用rpc-secret=xxx
然后yaaw中设置http://token:secret@hostname:port/jsonrpc 即可
如果下载BT没速度 使用这个
aria2c –enable-rpc –rpc-listen-all=true –rpc-allow-origin-all -c –conf-path=/root/aria2.conf –bt-tracker=http://mgtracker.org:2710/announce,http://tracker.istole.it/announce,http://tracker.coppersurfer.tk:6969/announce
增加了–bt-tracker
可以设置aria2为开机启动