首页 > 服务器 > ubuntu安装配置aria2

作者:ghostry 发布时间:2016-10-04 浏览: 1379

转载注明出处: https://blog.ghostry.cn/server/746.html
apt install aria2
cd /mnt/data/etc/
mkdir aria2
vi aria2/aria2.conf

写入这些

# General Setting
#
continue
peer-id-prefix=-TR2610-
user-agent=Transmission/2.61 (13407)
event-poll=epoll

enable-rpc=true
rpc-allow-origin-all=true
rpc-listen-all=true
quiet=true
seed-time=120
seed-ratio=1
max-tries=120
continue=true
input-file=/mnt/data/etc/aria2/aria2.session
save-session=/mnt/data/etc/aria2/aria2.session
on-download-complete=/mnt/data/etc/aria2/complete.sh
bt-hash-check-seed=true
bt-seed-unverified=true
bt-save-metadata=true
dht-file-path=/mnt/data/etc/aria2/dht.dat
file-allocation=none
bt-enable-lpd=true
enable-dht=true
rpc-listen-port=6800
dir=/mnt/tmp/tmp
bt-tracker=http://mgtracker.org:2710/announce,udp://11.rarbg.me:80/announce,udp://tracker.openbittorrent.com:80/announce,http://tracker.prq.to/announce,http://tracker.thepiratebay.org/announce,udp://tracker.thepiratebay.org:80/announce,http://tracker.openbittorrent.com/announce,udp://tracker.openbittorrent.com:80/announce,udp://tracker.publicbt.com:80/announce,http://tracker.publicbt.com/announce,http://nemesis.1337x.org/announce,http://genesis.1337x.org:1337/announce,http://pow7.com/announce,http://tracker.prq.to/announce.php,http://tracker.torrent.to:2710/announce,http://t2.popgo.org:7456/annonce,http://tracker.1000fr.net:2710/announce,http://tracker2.1000fr.com:8080/announce,http://bt.1000fr.net:2710/announce,http://trackedbyet.info:420/announce,http://tracker.bittorrent.am/announce,http://11.rarbg.com/announce,http://tracker.istole.it/announce,udp://tracker.istole.it:80/announce,http://tracker.hexagon.cc:2710/announce,http://bt1.54new.com:8080/announce,http://bt2.54new.com:8080/announce,http://post.greedland.net:2710/announce,http://tracker.csze.com/announce,http://tracker.csze.com/announce.php,http://tracker.csze.com:8080/announce,http://tk3.5qzone.net:8080/,udp://bt.btwuji.com:7979/announce,http://tracker.ydy.com:101/announce,udp://bt1.btally.net:6969/announce,udp://bt1.btally.net:8888/announce,http://tracker.lzbt.net:8077/announce,http://bigfoot1942.sektori.org:6969/announce,http://pow7.com/announce,udp://open.demonii.com:1337/announce,http://i.bandito.org/announce,udp://mgtracker.org:2710/announce,http://announce.torrentsmd.com:8080/announce,http://tracker3.torrentino.com/announce,http://tracker1.torrentino.com/announce,http://tracker2.torrentino.com/announce,udp://tracker.leechers-paradise.org:6969/announce,udp://9.rarbg.me:2710/announce,http://exodus.desync.com/announce,http://exodus.desync.com:6969/announce,udp://exodus.desync.com:6969,udp://shadowshq.yi.org:6969/announce,http://bt.careland.com.cn:6969/announce,http://tracker1.wasabii.com.tw:6969/announce
disk-cache=10M
max-concurrent-downloads=20
max-connection-per-server=4
min-split-size=20M
split=6
save-session-interval=30
follow-torrent=true
listen-port=6881
bt-max-peers=55

然后

cd ../bin
vi aria2.sh 

写入

#!/bin/bash
stop() {
    # must interrupt it to save session
    killall -2 aria2c
    echo 'stop'
}
start(){
    usr_path="/mnt/data/etc/"                   #基础目录
    aria2_conf_path="$usr_path/aria2"           #配置文件目录
    aria2_configfile="$aria2_conf_path/aria2.conf"      #配置
    aria2_downloadlist="$aria2_conf_path/aria2.session" #下载任务列表
    rpc_secret=""           #管理密码,1.19后使用

    [ ! -d "$aria2_conf_path" ] && mkdir -p "$aria2_conf_path"
    [ ! -f "$aria2_downloadlist" ] && touch "$aria2_downloadlist"
    cmd="aria2c -c -D --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all --conf-path=$aria2_configfile \
    --input-file=$aria2_downloadlist --http-accept-gzip=true ";
    [ "$rpc_secret" != "" ] && cmd=$cmd" --rpc-secret=$rpc_secret ";
    [ "`pgrep aria2c`" != "" ] && {
    stop
    sleep 3
    }
    echo 'starting...'
    eval "$cmd"
}
restart(){
    stop
    sleep 3 
    start
}

case "$1" in  
start)  
        start  
        ;;  
stop)  
        stop  
        ;;  
reload|force-reload|restart)  
        restart  
        ;;
status|pid)  
        pgrep aria2c  
        ;;
*)  
        echo "Usage: $0 {start|stop|restart|pid}"  
        exit 1  
esac 

然后

chmod +x aria2.sh
vi /etc/rc.local

增加

/mnt/data/bin/aria2.sh start

打开http://webui-aria2.ghostry.cn/ 设置》服务器设置 输入Ubuntu的ip

标签: ubuntu

上一篇: ubuntu配置Samba服务器
下一篇: ubuntu安装配置Xware1.0.31

添加新评论 »

*
*

欢迎评论!歡迎評論!Comments welcome!komentoj bonvenaj!댓글 오신 것을 환영합니다!
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: :cold: :cryy: :cute: :shy: :sleep: :struggle: :tea: :yahou: