1.Aria2 源码下载
http://sourceforge.net/projects/aria2/files/stable/
2.安装必须的库文件
sudo apt-get install gcc c++ autoconf automake libcppunit-dev autopoint openssl libtool sphinx-common sphinxsearch libgcrypt11-dev libxml2-dev pkg-config
3.编译安装
tar zxvf aria2-1.17.tar.gz cd aria2-1.17.1 ./configure ARIA2_STATIC=yes --enable-bittorrent --enable-metalink
如果编译不能通过,可以删掉 ARIA2_STATIC=yes 选项:
./configure --enable-bittorrent --enable-metalink make sudo make install
4.添加启动脚本
/etc/init.d/aria2
#!/bin/sh ### BEGIN INIT INFO # Provides: aria2 # Required-Start: # Required-Stop: # Default-Start: # Default-Stop: # Short-Description: aria2 ### END INIT INFO case $1 in start) touch /etc/aria2/session.txt /usr/bin/aria2c --conf-path=/etc/aria2/aria2.conf -D ;; stop) killall aria2c ;; *) echo "Usage: /etc/init.d/aria2 {start|stop}" exit 1 ;; esac exit 0
5.增加启动项
sudo update-rc.d aria2 defaults
6.添加 Aria2 配置文件
enable-rpc=true rpc-allow-origin-all=true rpc-listen-all=true rpc-listen-port=6800 #event-poll=select disable-ipv6=true max-concurrent-downloads=2 continue=true max-connection-per-server=5 min-split-size=10M split=5 max-overall-download-limit=0 max-download-limit=0 max-overall-upload-limit=15k max-upload-limit=15k #lowest-speed-limit=0 #referer=* input-file=/etc/aria2/session.txt save-session=/etc/aria2/session.txt save-session-interval=30 dir=/nas/aria2 disk-cache=16M enable-mmap=true file-allocation=none force-save=true follow-torrent=true bt-hash-check-seed=true bt-seed-unverified=true bt-save-metadata=true #bt-request-peer-speed-limit=2M bt-save-metadata=true #seed-time=10 seed-ratio=0.1 log=/etc/aria2/aria2.log log-level=error max-download-result=50
Recent Comments