背景:
前文已经使用树莓派搭载了一个基于samba的局域网文件共享系统,本文在此基础上,再基于aria2+开源的aria2 Web管理系统打造一个基于树莓派的下载机
树莓派信息:
-
Raspberry-3-modelB
-
2018-04-18-raspbian-stretch
大致步骤:
-
安装aria2服务
-
配置aria2服务
详细步骤:
1)安装aria2服务
1 | sudo apt-get install aria2 |
2)配置aria2服务
1 2 3 4 5 6 | sudo mkdir /etc/aria2 cd /etc/aria2 touch aria2.conf touch aria2.log touch aria2.session sudo nano aria2.conf |
在aria2.conf下添加如下配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | enable -rpc= true rpc-allow-origin-all= true rpc-listen-all= true rpc-listen-port=6800 file -allocation=none disable-ipv6= true disk-cache=32M split =3 max-concurrent-downloads=3 max-connection-per-server=3 max- file -not-found=3 max-tries=5 retry-wait=3 continue = true check-integrity= true log-level=error log= /var/log/aria2 .log rpc-secret=hzdx input- file = /etc/aria2/aria2 .session save-session= /etc/aria2/aria2 .session dir = /mnt/Funs/Aria2Download #下载机下载目录 |
3)测试aria2服务是否正常运行
1 | aria2c --conf-path= /etc/aria2/aria2 .conf |
出现如下对话,即正常运行
4)添加aria2服务开机启动
1 | sudo vim /lib/systemd/system/aria2 .service |
添加如下配置:
1 2 3 4 5 6 7 8 9 10 11 | [Unit] Description=Aria2 Service After=network.target [Service] User=root Type=simple ExecStart= /usr/bin/aria2c --conf-path= /etc/aria2/aria2 .conf [Install] WantedBy=multi-user.target |
设置开机服务:
1 2 | sudo systemctl daemon-reload sudo systemctl enable aria2 |
查看aria服务状态:
1 | sudo systemctl status aria2 |
启动,停止,重启aria服务:
1 2 3 4 5 6 | #启动命令 sudo systemctl start aria2 #停止命令 sudo systemctl stop aria2 #重启命令 sudo systemctl restart aria2 |