-
-
Save zjx20/89be7b45954844944d4ea9cc01c5d4f3 to your computer and use it in GitHub Desktop.
Aria2c daemon Ubuntu16.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# should install aria2c from latest source | |
# requirements: sudo apt install libgnutls-dev nettle-dev libgmp-dev libssh2-1-dev libc-ares-dev libxml2-dev zlib1g-dev libsqlite3-dev pkg-config libcppunit-dev autoconf automake autotools-dev autopoint libtool | |
#sudo apt-get install -y aria2 | |
sudo useradd aria2 | |
sudo mkdir /aria2 | |
sudo mkdir /aria2/dl | |
sudo mkdir /aria2/log | |
sudo touch /aria2/aria2.session | |
sudo bash -c "cat <<EOT > /aria2/aria2.conf | |
daemon=true | |
continue=true | |
enable-rpc=true | |
rpc-listen-port=6800 | |
rpc-listen-all=true | |
check-certificate=false | |
auto-file-renaming=false | |
allow-overwrite=true | |
dir=/aria2/dl | |
rpc-user=aria2 | |
rpc-passwd=aria2 | |
file-allocation=none | |
disable-ipv6=true | |
max-download-limit=0 | |
max-overall-download-limit=0 | |
max-concurrent-downloads=4 | |
max-connection-per-server=8 | |
log=/aria2/log/aria2.log | |
log-level=error | |
summary-interval=120 | |
timeout=600 | |
retry-wait=30 | |
max-tries=50 | |
save-session=/aria2/aria2.session | |
input-file=/aria2/aria2.session | |
save-session-interval=10 | |
disk-cache=50M | |
bt-load-saved-metadata=true | |
bt-save-metadata=true | |
EOT" | |
sudo chown -R aria2:aria2 /aria2 | |
sudo bash -c "cat <<EOT > /etc/systemd/system/aria2.service | |
[Unit] | |
Description=Aria2c download manager | |
Requires=network.target | |
After=network-online.target | |
[Service] | |
Type=forking | |
User=aria2 | |
RemainAfterExit=yes | |
ExecStart=/usr/local/bin/aria2c --conf-path=/aria2/aria2.conf | |
ExecReload=/usr/bin/kill -HUP $MAINPID | |
RestartSec=1min | |
Restart=on-failure | |
[Install] | |
WantedBy=multi-user.target | |
EOT" | |
sudo systemctl enable aria2 | |
sudo systemctl start aria2 | |
# open http://binux.github.io/yaaw/demo/#path=ws://aria2:aria2@ip:port/jsonrpc | |
# notice that the path parameter in the url should be updated properly | |
# yet another web frontend: https://github.com/mayswind/AriaNg | |
# yet yet another web frontend: https://github.com/NemoAlex/glutton |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment