-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patharia2_2.0.sh
More file actions
59 lines (49 loc) · 1.63 KB
/
Copy patharia2_2.0.sh
File metadata and controls
59 lines (49 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
yum install -y gcc-c++ bison libssh2-devel expat-devel gmp-devel nettle-devel libssh2-devel zlib-devel c-ares-devel gnutls-devel libgcrypt-devel libxml2-devel sqlite-devel gettext lzma-devel xz-devel gperftools gperftools-devel gperftools-libs jemalloc-devel trousers-devel
git clone https://github.com/aria2/aria2.git && cd aria2
##静态编译
autoreconf -i && ./configure ARIA2_STATIC=yes
make && make install
cat >/etc/systemd/system/aria2.service<< EOF
[Unit]
Description=aria2c
After=network.target
[Service]
ExecStart=/usr/local/bin/aria2c --conf-path=/aria2.conf
User=root
[Install]
WantedBy=multi-user.target
EOF
##aria2 config file
cat >/aria2.conf<< EOF
rpc-secret=crazy_0
enable-rpc=true
rpc-allow-origin-all=true
rpc-listen-all=true
max-concurrent-downloads=5
continue=true
max-connection-per-server=5
min-split-size=10M
split=16
max-overall-download-limit=0
max-download-limit=0
max-overall-upload-limit=0
max-upload-limit=0
dir=/web_home/downloads
file-allocation=prealloc
EOF
##安装nginx
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install nginx -y
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=80/udp --permanent
firewall-cmd --zone=public --add-port=6800/tcp --permanent
firewall-cmd --zone=public --add-port=6800/udp --permanent
##webui
cd ~
git clone https://github.com/ziahamza/webui-aria2.git
rm -fr /usr/share/nginx/html/*
cp /root/webui-aria2/docs/* /usr/share/nginx/html/
systemctl enable nginx
systemctl start nginx
systemctl enable aria2
systemctl start aria2