linux搭建aria2服务,打造属于自己的专属下载器

1、安装依赖

[root@wxj aria2-1.33.1]# yum -y install bison libssh2-devel expat-devel gmp-devel nettle-devel libuv-devel libssh2-devel zlib-devel c-ares-devel cppunit-devel gnutls-devel libgcrypt-devel libxml2-devel sqlite-devel gettext lzma-devel xz-devel gperftools gperftools-devel gperftools-libs jemalloc-devel screen git unzip gcc* wget

2、aria2下载

[root@wxj ~]#  wget https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1.tar.gz

3、解压并安装

[root@wxj ~]# tar xf aria2-1.33.1.tar.gz 
[root@wxj ~]# cd aria2-1.33.1
[root@wxj aria2-1.33.1]# ./configure
[root@wxj aria2-1.33.1]# make 
[root@wxj aria2-1.33.1]# make install

4、安装完查看版本

[root@wxj aria2-1.33.1]# aria2c -v
 aria2 version 1.33.1
 Copyright (C) 2006, 2017 Tatsuhiro Tsujikawa

5、创建配置文件

 [root@wxj ~]# mkdir /download  //创建下载目录
 [root@wxj ~]# mkdir .aria2     //新建aria2目录
 [root@wxj ~]# touch .aria2/aria2.session    //新建下载任务记录文件
 [root@wxj ~]# chmod 777 .aria2/aria2.session  //给予权限
 [root@wxj ~]# vim .aria2/aria2.conf    //创建配置文件
 dir=/download
 max-concurrent-downloads=3    
 input-file=/root/.aria2/aria2.session
 save-session=/etc/aria2/aria2.session    
 save-session-interval=60    
 enable-rpc=true    
 rpc-allow-origin-all=true    
 rpc-listen-all=true    
 rpc-secret=Aa123
dir=/download    #下载目录 
max-concurrent-downloads=3    #最多同时下载3个任务 
input-file=/download/aria2.session   #从会话文件中读取下载任务 
save-session=/etc/aria2/aria2.session    #在Aria2退出时保存`错误/未完成`的下载任务到会话文件 
save-session-interval=60    #定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0 
enable-rpc=true    #启用RPC,这样就能通过WebUI进行下载管理 
rpc-allow-origin-all=true    #允许所有来源 
rpc-listen-all=true    #允许非外部访问, 默认:
false rpc-secret=<TOKEN>    #设置密码 
on-download-complete=/var/lib/aria2/aria2-done.sh  //执行下载任务后执行

6、启动

[root@wxj ~]# aria2c --conf-path=/root/.aria2/aria2.conf -D

发表评论

后才能评论