Aria2c安装配置

获取最新版下载地址

https://github.com/aria2/aria2/releases

获取并解压文件

wget https://github.com/aria2/aria2/releases/download/release-1.34.0/aria2-1.34.0.tar.gz
tar -xzvf aria2*.tar.gz
cd aria2*

编译

yum install gcc* -y
./configure
make
make install

启动脚本

//CentOS7
vim /usr/lib/systemd/system/aria2c.service
//Debian9
vim /lib/systemd/system/aria2c.service

aria2c.service

[Unit]
Description=Aria2c
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
GuessMainPID=yes
ExecStart=/usr/local/bin/aria2c -D --conf-path=/etc/aria2c.conf
ExecReload=/bin/kill -s QUIT $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

配置文件

vim /etc/aria2c.conf

dir="默认下载地址"
input-file=/root/.aria2/aria2.session
save-session=/root/.aria2/aria2.session
#save-session-interval=60
enable-rpc=true
rpc-listen-all=true
rpc-allow-origin-all=true
max-connection-per-server=16
split=25

创建相关文件

mkdir /root/.aria2
touch /root/.aria2/aria2.session

启动aria2并设置自启动

systemctl start aria2c && systemctl enable aria2c
点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注