aria2的安裝與配置

aria2安裝html

 

安裝 epel 源:nginx

 

yum install epel-releasegit

 

而後直接安裝:github

 

yum install aria2 -yweb

配置 Aria2

建立目錄與配置文件緩存

 

這一步須要切換到root下進行 
$ su
$ cd /etc/ && mkdir aria2 && cd aria2 && touch aria2c.conf && touch aria2.session
$ cd / && mkdir date && chmod 777 /data

編輯aria2c.conf文件內容,內容以下:bash

# 文件的保存路徑(可以使用絕對路徑或相對路徑), 默認: 當前啓動位置
dir=/data # 啓用磁盤緩存, 0爲禁用緩存, 需1.16以上版本, 默認:16M disk-cache=5M # 文件預分配方式, 能有效下降磁盤碎片, 默認:prealloc # 預分配所需時間: none < falloc ? trunc < prealloc # falloc和trunc則須要文件系統和內核支持, NTFS建議使用falloc, EXT3/4建議trunc file-allocation=none # 斷點續傳 continue=true ## 下載鏈接相關 ## # 最大同時下載任務數, 運行時可修改, 默認:5 max-concurrent-downloads=5 # 同一服務器鏈接數, 添加時可指定, 默認:1 max-connection-per-server=15 # 最小文件分片大小, 添加時可指定, 取值範圍1M -1024M, 默認:20M # 假定size=10M, 文件爲20MiB 則使用兩個來源下載; 文件爲15MiB 則使用一個來源下載 min-split-size=10M # 單個任務最大線程數, 添加時可指定, 默認:5 split=5 # 總體下載速度限制, 運行時可修改, 默認:0 #max-overall-download-limit=0 # 單個任務下載速度限制, 默認:0 #max-download-limit=0 # 總體上傳速度限制, 運行時可修改, 默認:0 max-overall-upload-limit=20kb # 單個任務上傳速度限制, 默認:0 max-upload-limit=5kb # 禁用IPv6, 默認:false disable-ipv6=true # 禁用https證書檢查 check-certificate=false #運行覆蓋已存在文件 allow-overwrite=true #自動重命名 auto-file-renaming ## 進度保存相關 ## # 從會話文件中讀取下載任務 input-file=/etc/aria2/aria2.session # 在Aria2退出時保存`錯誤/未完成`的下載任務到會話文件 save-session=/etc/aria2/aria2.session # 定時保存會話, 0爲退出時才保存, 需1.16.1以上版本, 默認:0 save-session-interval=30 ## RPC相關設置 ## # 啓用RPC, 默認:false enable-rpc=true # 容許全部來源, 默認:false rpc-allow-origin-all=true # 容許非外部訪問, 默認:false rpc-listen-all=true # 事件輪詢方式, 取值:[epoll, kqueue, port, poll, select], 不一樣系統默認值不一樣 #event-poll=select # RPC監聽端口, 端口被佔用時能夠修改, 默認:6800 rpc-listen-port=6800 # 保存上傳的種子文件 rpc-save-upload-metadata=false ## BT/PT下載相關 ## # 當下載的是一個種子(以.torrent結尾)時, 自動開始BT任務, 默認:true #follow-torrent=true # BT監聽端口, 當端口被屏蔽時使用, 默認:6881-6999 listen-port=51413 # 單個種子最大鏈接數, 默認:55 #bt-max-peers=55 # 打開DHT功能, PT須要禁用, 默認:true enable-dht=true # 打開IPv6 DHT功能, PT須要禁用 enable-dht6=false # DHT網絡監聽端口, 默認:6881-6999 #dht-listen-port=6881-6999 # 本地節點查找, PT須要禁用, 默認:false bt-enable-lpd=true # 種子交換, PT須要禁用, 默認:true enable-peer-exchange=true # 每一個種子限速, 對少種的PT頗有用, 默認:50K #bt-request-peer-speed-limit=50K # 客戶端假裝, PT須要 peer-id-prefix=-UT341- user-agent=uTorrent/341(109279400)(30888) # 當種子的分享率達到這個數時, 自動中止作種, 0爲一直作種, 默認:1.0 seed-ratio=1.0 # 強制保存會話, 話即便任務已經完成, 默認:false # 較新的版本開啓後會在任務完成後依然保留.aria2文件 #force-save=false # BT校驗相關, 默認:true #bt-hash-check-seed=true # 繼續以前的BT任務時, 無需再次校驗, 默認:false bt-seed-unverified=true # 保存磁力連接元數據爲種子文件(.torrent文件), 默認:false #bt-save-metadata=false #僅下載種子文件 bt-metadata-only=true #經過網上的種子文件下載,種子保存在內存 follow-torrent=mem

啓動
aria2c --conf-path=/etc/aria2/aria2c.conf -D

你就可使用aria2下載你的bt種子或磁力鏈了,aria2c -h 查看使用幫助

處理aria2下載bt種子或磁力鏈無速度或速度慢的狀況,添加tracker服務器

 

    在aria2c.conf文件中添加下面內容:網絡

 
 
bt-tracker=tracker url.....
例如:

  bt-tracker=udp://tracker.coppersurfer.tk:6969/announce,udp://tracker.open-internet.nl:6969/announce,udp://tracker.leechers-paradise.org:6969/announce,udp://tracker.opentrackr.org:1337/announce,http://tracker.internetwarriors.net:1337/announce,udp://9.rarbg.to:2710/announce,udp://exodus.desync.com:6969/announce,http://tracker3.itzmx.com:6961/announce,udp://explodie.org:6969/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://denis.stalker.upeer.me:6969/announce,udp://tracker4.itzmx.com:2710/announce,udp://tracker.tiny-vps.com:6969/announce,udp://tracker.port443.xyz:6969/announce,udp://thetracker.org:80/announce,udp://open.stealth.si:80/announce,udp://open.demonii.si:1337/announce,udp://bt.xxx-tracker.com:2710/announce,udp://tracker1.wasabii.com.tw:6969/announce,udp://tracker.torrent.eu.org:451/announcesession

 
tracker 地址自行到這裏取最新的添加,每一個地址之間以逗號分開:
https://github.com/ngosang/trackerslist

安裝Web UI
wget https://github.com/straightedge4life/webui-aria2/archive/master.zip && unzip webui-aria2-master.zip
把以上解壓的內容移動到nginx或者Apache的網站目錄
wget https://github.com/straightedge4life/webui-aria2/archive/master.zip && unzip webui-aria2-master.zip

若是沒有web服務器則:

yum  -y  install  httpd

而後把webui-aria2-master目錄內的內容複製到/var/www/html/下便可

 本人沒有安裝安裝Web UI, 我用的是火狐 Aria2 下載器集成組件

aria2c 開機啓動

一鍵腳本,很方便,並且速度快。項目地址:https://github.com/ToyoDAdoubi/doubi
在 /lib/systemd/system/aria2.service 編寫以下腳本

    [Unit]
    Description= aria2
    After=aria2.service
     
    [Service]
    #PIDFile=/run/aria2.pid
    ExecStart=/usr/bin/aria2c -c --conf-path=/etc/aria2/aria2c.conf
   
     
    [Install]
    WantedBy=multi-user.target

而後  systemctl daemon-reload ;systemctl enable aria2.service  ;  systemctl start aria2.service 便可開機啓動


2)aria2.servicearia2.servicearia2c -c --conf-path=/etc/aria2/aria2c.conf

安裝

下載並運行腳本:

wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/aria2.sh chmod +x aria2.sh bash aria2.sh

腳本安裝界面:

腳本備份:aria2.sh

 

其餘操做

啓動:service aria2 start中止:service aria2 stop重啓:service aria2 restart查看狀態:service aria2 status配置文件:/root/.aria2/aria2.conf下載目錄:/usr/local/caddy/www/aria2/Download

相關文章
相關標籤/搜索