#
## aria2 config
#
# man page = http://aria2.sourceforge.net/manual/en/html/aria2c.html
# file path = $HOME/.aria2/aria2.conf
# Download Directory: specify the directory all files will be downloaded to.
# When this directive is commented out, aria2 will download the files to the
# current directory where you execute the aria2 binary.
dir=/media/hdd1/ #-----<<<-------Nơi chứa file download, sửa lại cho đúng
# Bit Torrent: If the speed of the incoming data (download) from other peers is
# greater then the peer-speed-limit, then do not allow any more connections
# then max-peers. The idea is to limit the amount of clients our system will
# connect with to reduce our overall load when we are already saturating our
# incoming bandwidth. Make sure to set the the peer-speed-limit to your
# preferred incoming (download) speed. Speeds must be whole numbers so 5.5M is
# illegal but 5500K is valid.
bt-max-peers=1
bt-request-peer-speed-limit=5500K
# Bit Torrent: the max upload speed for all torrents combined. Again, only
# whole numbers are valid. WE find a global upload limit is more flexible then
# an upload limit per torrent.
max-overall-upload-limit=2500K
# Bit Torrent: When downloading a torrent remove ALL trackers from the listing.
# This is a good way to only use distributed hash table (DHT) and Peer eXchange
# (PeX) on connections. We find start up of the torrent takes 60-120 seconds
# longer with all trackers disabled, but helps reduce the load on trackers.
#bt-exclude-tracker="*"
# Bit Torrent: ports and protocols used for bit torrent TCP and UDP
# connections. Peers use TCP. DHT and PEX as well as UDP based trackers use UDP
# and make sure the DHT server is enabled.
dht-listen-port=6881
enable-dht=true
enable-peer-exchange=true
listen-port=6881
# When running aria2 on FreeBSD with ZFS, disable disk-cache due to ZFS using
# Adaptive Replacement Cache (ARC). ZFS can also take advantage of the "sparse
# files" format which is significantly faster then pre allocation of file
# space. For other file systems like EXT4 and XFS you can test with "prealloc"
# and "falloc" to see which file-allocation allows arai2 to start quicker and
# use less disk I/O.
disk-cache=0
file-allocation=none
# Bit Torrent: fully encrypt the negotiation as well and the payload of all bit
# torrent traffic. Encryption is required and all old, non-encrypted clients
# are ignored. This may help avoid some ISPs rate limiting P2P clients, but may
# reduce the amount of clients aria2 will talk to.
bt-min-crypto-level=arc4
bt-require-crypto=true
# Bit Torrent: timeout values for servers and clients.
bt-tracker-connect-timeout=10
bt-tracker-interval=900
bt-tracker-timeout=10
# Bit Torrent: Download the torrent file into memory (RAM) if there is no need
# to save the .torrent file itself. This option works with both magnet and
# torrent URL links.
follow-torrent=mem
# Bit Torrent: The amount of time and the upload-to-download ratio you wish to
# seed to. If either the time limit ( seconds ) or the seed ratio is reached,
# torrent seeding will stop. You can set seed-time to zero(0) to disable
# seeding completely.
seed-ratio=1.0
seed-time=900
# Bit Torrent: scripts or commands to execute before, during or after a
# download finishes.
# on-bt-download-complete=/path/to/script.sh
# on-download-complete=/path/to/script.pl
# on-download-error=/path/to/script
# on-download-pause=/path/to/script.sh
# on-download-start=/path/to/script.pl
# on-download-stop=/path/to/script
# Event Multiplexing: set polling to the OS type you are using. For FreeBSD,
# OpenBSD and NetBSD set to "kqueue". For Linux set to "epoll".
event-poll=epoll
# Data Integrity: check the MD5 / SHA256 hash of metalink downloads as well as
# the hash of bit torrent chunks as our client receives them. CPU time is
# reasonably low for the high value of verified data.
check-integrity=true
realtime-chunk-checksum=true
# File Names: Resume file downloads if we have a partial copy. Do not rename
# the file or make another copy if the same file is downloaded a second time.
allow-overwrite=false
always-resume=true
auto-file-renaming=false
continue=true
remote-time=true
# User Agent: Disable the identification string of our client. If you connect
# to a server which requires a certain id string you can always add one here.
# Trackers should never use client id strings as security authentication or
# access control.
peer-id-prefix=""
user-agent=""
# Status Summery messages are disabled since the status of the download is
# updated in real time on the CLI anyways.
summary-interval=0
# FTP: use passive ftp which is firewall friendly and reuse the ftp data
# connection when asking for multiple resources from the same server for
# efficiency.
ftp-pasv=true
ftp-reuse-connection=true
# Metalink: Set the country code to make sure mirrors closest to you are used
# first. Prefer more secure https mirrors over http and ftp servers.
metalink-language=en-US
metalink-location=us
metalink-preferred-protocol=https
# Disconnect from https, http or ftps server who do not upload data to us
# faster then the specified value. Aria2 will then find another mirror in the
# metalink file which might be quicker. If there are no more mirrors left then
# the current slow mirror is still used. This value is NOT used for bit torrent
# connections though. NOTE: we hope to convince the developer to add a
# lower-speed value or even a minimal client U/D ratio to bit torrent some day
# to kick off leachers too.
lowest-speed-limit=50K
# Concurrent downloads: Set the number of different servers to download from
# concurrently; i.e. in parallel. If we are downloading a single file then
# split that file into the same amount of streams. Make sure to keep in mind
# that if the amount of parallel downloads times the lowest-speed-limit is
# greater then your total download bandwidth then you will drop servers
# incorrectly. For example, we have ten(10) connections at a minimum of
# 50KiB/sec which equals 500KiB/sec. If our total download bandwidth is not at
# least 500KiB/sec then arai2 will think the mirrors are too slow and drop
# connection slowing down the whole download. Do not set the
# max-connection-per-server greater then one(1) as to avoid abusing a single
# server.
max-concurrent-downloads=10 #--------<<<-------Số files download đồng thời
max-connection-per-server=1
min-split-size=5M
split=10
# RPC Interface: To access aria2 through XML-RPC API, like using webui-aria2.
enable-rpc
rpc-listen-all
#rpc-user=username
#rpc-passwd=passwd
# Daemon Mode: To run aria2 in the background as a daemon. Use daemon mode to
# start aria2 on reboot or when using an RPC interface like webui-aria2.
daemon
#
#
# Reference: the following options are commented out and the developers
# defaults are used. We kept them here for reference.
# bt-max-open-files=100
# bt-save-metadata=false
# bt-stop-timeout=0
# bt-tracker="udp://tracker.openbittorrent.com:80/announce"
check-certificate=true
conditional-get=true
# dht-entry-point="dht.transmissionbt.com:6881"
# dht-file-path=$HOME/.aria2/dht.dat
# dht-message-timeout=10
# disable-ipv6=true
http-accept-gzip=true
log=/var/log/aria2.log
log-level=debug
### EOF ###
mkdir /mnt/share1
mount -t ntfs //IP_máy_Windows/share1 /mnt/share1 -o username=usr,password=pwd
pyload tôi chưa dùng nên không biết gì
Chưa cài được aria2 webui? Trước hết anh test xem aria2 chạy ổn chưa?
Tốc độ download của aria2 thay đổi thất thường, có vẻ nó đặt ưu tiên thấp trong việc chiếm dụng băng thông, nếu có ai đó trong mạng nội bộ dùng băng thông cao thì aria2 failed.
Bí quyết để aria2 không failed liên tục là tốc_độ_download_tối_thiểu * số_link_download_đồng thời = băng_thông_tối_thiểu
Thí dụ:
Tốc độ thấp nhất của đường truyền nhà bạn là 200KB/s. Mở aria2.conf đặt
- lowest-speed-limit=40K
- max-concurrent-downloads=5
Tốc độ thấp nhất của đường truyền nhà bạn là 500KB/s.
- lowest-speed-limit=50K
- max-concurrent-downloads=10
Làm sao biết băng thông thấp nhất mạng của mình là bao nhiêu? Căn cứ vào cam kết của nhà mạng hay theo kinh nghiệm sử dụng
apt-get install aria2
mkdir /root/.aria2
nano /root/.aria2/aria2.conf
#
## aria2 config
#
# man page = http://aria2.sourceforge.net/manual/en/html/aria2c.html
# file path = $HOME/.aria2/aria2.conf
# Download Directory: specify the directory all files will be downloaded to.
# When this directive is commented out, aria2 will download the files to the
# current directory where you execute the aria2 binary.
dir=[COLOR="#FF0000"]/media/hdd1/[/COLOR] #nơi chứa file download, sửa lại cho đúng
# Bit Torrent: If the speed of the incoming data (download) from other peers is
# greater then the peer-speed-limit, then do not allow any more connections
# then max-peers. The idea is to limit the amount of clients our system will
# connect with to reduce our overall load when we are already saturating our
# incoming bandwidth. Make sure to set the the peer-speed-limit to your
# preferred incoming (download) speed. Speeds must be whole numbers so 5.5M is
# illegal but 5500K is valid.
bt-max-peers=1
bt-request-peer-speed-limit=5500K
# Bit Torrent: the max upload speed for all torrents combined. Again, only
# whole numbers are valid. WE find a global upload limit is more flexible then
# an upload limit per torrent.
max-overall-upload-limit=2500K
# Bit Torrent: When downloading a torrent remove ALL trackers from the listing.
# This is a good way to only use distributed hash table (DHT) and Peer eXchange
# (PeX) on connections. We find start up of the torrent takes 60-120 seconds
# longer with all trackers disabled, but helps reduce the load on trackers.
#bt-exclude-tracker="*"
# Bit Torrent: ports and protocols used for bit torrent TCP and UDP
# connections. Peers use TCP. DHT and PEX as well as UDP based trackers use UDP
# and make sure the DHT server is enabled.
dht-listen-port=6881
enable-dht=true
enable-peer-exchange=true
listen-port=6881
# When running aria2 on FreeBSD with ZFS, disable disk-cache due to ZFS using
# Adaptive Replacement Cache (ARC). ZFS can also take advantage of the "sparse
# files" format which is significantly faster then pre allocation of file
# space. For other file systems like EXT4 and XFS you can test with "prealloc"
# and "falloc" to see which file-allocation allows arai2 to start quicker and
# use less disk I/O.
disk-cache=0
file-allocation=none
# Bit Torrent: fully encrypt the negotiation as well and the payload of all bit
# torrent traffic. Encryption is required and all old, non-encrypted clients
# are ignored. This may help avoid some ISPs rate limiting P2P clients, but may
# reduce the amount of clients aria2 will talk to.
bt-min-crypto-level=arc4
bt-require-crypto=true
# Bit Torrent: timeout values for servers and clients.
bt-tracker-connect-timeout=10
bt-tracker-interval=900
bt-tracker-timeout=10
# Bit Torrent: Download the torrent file into memory (RAM) if there is no need
# to save the .torrent file itself. This option works with both magnet and
# torrent URL links.
follow-torrent=mem
# Bit Torrent: The amount of time and the upload-to-download ratio you wish to
# seed to. If either the time limit ( seconds ) or the seed ratio is reached,
# torrent seeding will stop. You can set seed-time to zero(0) to disable
# seeding completely.
seed-ratio=1.0
seed-time=900
# Bit Torrent: scripts or commands to execute before, during or after a
# download finishes.
# on-bt-download-complete=/path/to/script.sh
# on-download-complete=/path/to/script.pl
# on-download-error=/path/to/script
# on-download-pause=/path/to/script.sh
# on-download-start=/path/to/script.pl
# on-download-stop=/path/to/script
# Event Multiplexing: set polling to the OS type you are using. For FreeBSD,
# OpenBSD and NetBSD set to "kqueue". For Linux set to "epoll".
event-poll=epoll
# Data Integrity: check the MD5 / SHA256 hash of metalink downloads as well as
# the hash of bit torrent chunks as our client receives them. CPU time is
# reasonably low for the high value of verified data.
check-integrity=true
realtime-chunk-checksum=true
# File Names: Resume file downloads if we have a partial copy. Do not rename
# the file or make another copy if the same file is downloaded a second time.
allow-overwrite=false
always-resume=true
auto-file-renaming=false
continue=true
remote-time=true
# User Agent: Disable the identification string of our client. If you connect
# to a server which requires a certain id string you can always add one here.
# Trackers should never use client id strings as security authentication or
# access control.
peer-id-prefix=""
user-agent=""
# Status Summery messages are disabled since the status of the download is
# updated in real time on the CLI anyways.
summary-interval=0
# FTP: use passive ftp which is firewall friendly and reuse the ftp data
# connection when asking for multiple resources from the same server for
# efficiency.
ftp-pasv=true
ftp-reuse-connection=true
# Metalink: Set the country code to make sure mirrors closest to you are used
# first. Prefer more secure https mirrors over http and ftp servers.
metalink-language=en-US
metalink-location=us
metalink-preferred-protocol=https
# Disconnect from https, http or ftps server who do not upload data to us
# faster then the specified value. Aria2 will then find another mirror in the
# metalink file which might be quicker. If there are no more mirrors left then
# the current slow mirror is still used. This value is NOT used for bit torrent
# connections though. NOTE: we hope to convince the developer to add a
# lower-speed value or even a minimal client U/D ratio to bit torrent some day
# to kick off leachers too.
[COLOR="#FF0000"] lowest-speed-limit=50K[/COLOR]
# Concurrent downloads: Set the number of different servers to download from
# concurrently; i.e. in parallel. If we are downloading a single file then
# split that file into the same amount of streams. Make sure to keep in mind
# that if the amount of parallel downloads times the lowest-speed-limit is
# greater then your total download bandwidth then you will drop servers
# incorrectly. For example, we have ten(10) connections at a minimum of
# 50KiB/sec which equals 500KiB/sec. If our total download bandwidth is not at
# least 500KiB/sec then arai2 will think the mirrors are too slow and drop
# connection slowing down the whole download. Do not set the
# max-connection-per-server greater then one(1) as to avoid abusing a single
# server.
[COLOR="#FF0000"]max-concurrent-downloads=5
max-connection-per-server=1
min-split-size=5M[/COLOR]
split=16
# RPC Interface: To access aria2 through XML-RPC API, like using webui-aria2.
enable-rpc
rpc-listen-all
#rpc-user=admin
#rpc-passwd=
# Daemon Mode: To run aria2 in the background as a daemon. Use daemon mode to
# start aria2 on reboot or when using an RPC interface like webui-aria2.
# daemon
#
#
# Reference: the following options are commented out and the developers
# defaults are used. We kept them here for reference.
# bt-max-open-files=100
# bt-save-metadata=false
# bt-stop-timeout=0
# bt-tracker="udp://tracker.openbittorrent.com:80/announce"
check-certificate=true
conditional-get=true
# dht-entry-point="dht.transmissionbt.com:6881"
# dht-file-path=$HOME/.aria2/dht.dat
# dht-message-timeout=10
# disable-ipv6=true
http-accept-gzip=true
log=/var/log/aria2.log
log-level=debug
### EOF ###
nano /etc/init.d/aria2
#! /bin/sh
# /etc/init.d/aria2
### BEGIN INIT INFO
# Provides: aria2cRPC
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: aria2c RPC init script.
# Description: Starts and stops aria2 RPC services.
### END INIT INFO
RETVAL=0
case "$1" in
start)
echo -n "Starting aria2c daemon\n"
umask 0000
aria2c --daemon --conf-path=/root/.aria2/aria2.conf
RETVAL=$?
;;
stop)
echo -n "Shutting down aria2c daemon\n"
killall aria2c
RETVAL=$?
;;
restart)
$0 stop
sleep 3
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL
chmod +x /etc/init.d/aria2
update-rc.d aria2 defaults 99
/etc/init.d/aria2 start
ps -e|grep aria2
Cũng là 1 cách để phá Rasp.![]()