linux compilation and installation of aria2, remote download settings

System: centos

Latest aria2 downloads: aria2 github

1. Download and unzip the latest aria2

wget https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1.tar.bz2
tar -jxv -f aria2-1.33.1.tar.bz2

2. Compile and install

cd aria2-1.33.1
./configure
make                                                                         #Wait for compilation to complete
cd src                                                                       #Here's the compiled aria2
cp aria2c /usr/local/bin

Some versions of. / configure may have checking for gcc no checking for cc… no checking for cl.exe… No run the following command, and execute. / configure once

yum install -y gcc-c++ gcc

After installation, execute the following command to display
aria2 version 1.33.1
Copyright (C) 2006, 2017 Tatsuhiro Tsujikawa
Success!

aria2c -v

3.aria2c setting

mkdir /root/aria2
touch /root/aria2/aria2.session
vim /root/aria2/aria2.conf

1. The following contents are settings, which can be modified according to the notes

## File saving related ##

# The saving path of the file (absolute path or relative path can be used), default: current starting location
dir=/root/Downloads
# Enable disk cache, 0 is disable cache, and requires version 1.16 or above, default: 16M
disk-cache=32M
# File pre allocation method can effectively reduce disk fragmentation. Default: prealloc
# Time required for pre allocation: none < falloc? TRUNC < prealloc
# falloc and trunc require file system and kernel support
# Falloc is recommended for NTFS, and TRUNC is recommended for ext3 / 4. This item needs to be noted under Mac
file-allocation=trunc
# Breakpoint resume
continue=true

## Download connection related ##

# Maximum number of simultaneous download tasks, modifiable during operation, default: 5
max-concurrent-downloads=10
# The number of connections to the same server can be specified when adding. Default: 1
max-connection-per-server=10
# The minimum file fragment size can be specified when adding. The value range is 1m-1024m, and the default value is 20M
# Assuming size=10M, if the file is 20MiB, two sources will be used for downloading; if the file is 15MiB, one source will be used for downloading
min-split-size=20M
# Maximum threads of a single task, which can be specified when adding, default: 5
split=10
# Overall download speed limit, modifiable at runtime, default: 0
max-overall-download-limit=0
# Download speed limit of single task, default: 0
max-download-limit=0
# Overall upload speed limit, modifiable during operation, default: 0
max-overall-upload-limit=500K
# Upload speed limit of single task, default: 0
max-upload-limit=100K
# Disable IPv6, default: false
disable-ipv6=false

## Progress saving related ##

# Read download task from session file
input-file=/root/aria2/aria2.session
# Save the download task of "error / incomplete" to the session file when Aria2 exits
save-session=/root/aria2/aria2.session
# Save the session regularly. If 0 is exit, save it. The version above 1.16.1 is required. Default: 0
save-session-interval=60
# Force save session, even if task is completed, default: false
# When a newer version is opened, the. aria2 file will remain after the task is completed
force-save=true
bt-hash-check-seed=true
bt-seed-unverified=true
bt-save-metadata=true

## RPC Related settings ##

# Enable RPC, default: false
enable-rpc=true
# Allow all sources, default: false
rpc-allow-origin-all=true
# Allow non external access, default: false
rpc-listen-all=true
# Event polling method, value: [epoll, kqueue, port, poll, select], different system default values are different
event-poll=select
# RPC listening port. It can be modified when the port is occupied. Default: 6800
rpc-listen-port=6800
# RPC authorization token set, new in v1.18.4, replacing -- RPC user and -- RPC passwd options
rpc-secret=csdn2017

## BT/PT Download related ##

# When downloading a seed (ending with. torrent), BT task will be started automatically. Default: true
follow-torrent=true
# BT listening port, used when the port is blocked, default: 6881-6999
listen-port=19999
# Maximum number of single seed connections, default: 55
bt-max-peers=100
# Open DHT function, PT needs to be disabled, default: true
enable-dht=true
# Open IPv6 DHT function, PT needs to be disabled
enable-dht6=false
# DHT network listening port, default: 6881-6999
dht-listen-port=6881-6999
# Local node lookup, PT needs to be disabled, default: false
bt-enable-lpd=true
# Seed exchange, PT needs to be disabled, default: true
enable-peer-exchange=true
# The speed limit of each seed is very useful for the PT with fewer species. Default: 50K
bt-request-peer-speed-limit=50K
# Client camouflage, PT needs
peer-id-prefix=-TR2770-
user-agent=Transmission/2.77
# When the share rate of seeds reaches this number, seed production will be stopped automatically. 0 is always seed production. Default: 1.0
seed-ratio=0.2
# BT check correlation, default: true
bt-hash-check-seed=true
# When you continue the previous BT task, you do not need to check again. Default: false
bt-seed-unverified=true
# Save the magnetic link metadata as a seed file (. torrent file), default: false
bt-save-metadata=false
#Mandatory encryption, necessary for lightning protection
bt-require-crypto=true
#Add extra tracker#
#bt-tracker=

After adding the above settings, press Esc key, input: wq, save and exit.
Then run it, it's OK

aria2c --conf-path=/root/aria2/aria2.conf -D

Set automatic startup

vim /etc/rc.d/rc.local

Last line add

aria2c --conf-path=/root/aria2/aria2.conf -D

Press Esc, enter: wq save exit

4. Install WEBUI
Install http service first

yum  -y  install  httpd
chkconfig --levels 235 httpd on
service httpd start

Download and unzip the latest WEBUI

wget https://github.com/ziahamza/webui-aria2/archive/master.zip
yum install -y unzip
unzip master.zip
cp webui-aria2-master /var/www/html/                                     #Folder move to html
cd /var/www/html/
mv webui-aria2-master webui                                              #Folder rename webui
chmod 755 /var/www/html/webui

ip/webui access of http: / / host;
Fill in the host IP address after "host:" in "Settings" – > connection settings ";
If RPC security authentication is enabled in the aria2.conf configuration file, you need to fill in the password token in the WEB client settings, otherwise the client will report an error
The password token is set in the last item of RPC related settings
#RPC authorization token set, new in v1.18.4, replacing – RPC user and – RPC passwd options
rpc-secret=csdn2017

Tags: Session github yum vim

Posted on Tue, 05 May 2020 00:04:01 -0700 by mcl