Aria2+Aria2Ng+OneIndex 宝塔搭建教程

有留言说想要个Aria2+Aria2Ng+OneIndex宝塔搭建教程,今天有时间就来写下。

先来一发?https://down.sybk.tw/

首先,搭建宝塔都应该会吧,此教程基于Centos 7.x 64位系统。

  • yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh

baota

环境搭建完成后,新建一个网站:

宝塔

伪静态设置为:

  • location / {
  • try_files $uri /index.php?$args;
  • }

SSL可行看需求开启,不影响后续操作

使用SSH进入网站文件夹管理,运行以下命令

  • cd /home/wwwroot/网站文件夹 #自行更改
  • rm -rf index.html
  • git clone https://github.com/donwa/oneindex.git && mv ./oneindex/* /home/wwwroot/网站文件夹 #自行更改
  • chmod 777 ./config && chmod 777 ./cache

浏览器进入你设置的域名,对接Onedrive

Onedrive

对接问题可访问https://github.com/donwa/oneindex/issues提问


下面搭建aria2ng

再次新建一个网站,域名随便,二级的也可以

进入文件管理,先把默认的index.html删除,再点击远程下载,https://github.com/mayswind/AriaNg-DailyBuild/archive/master.zip

宝塔文件管理解压,移动文件夹中的所有文件到目录首页即可。


下面搭建aria2,下面找到rpc-secret=密码,自行更改

  • echo -e “开始安装Aria2”
  • yum install build-essential cron -y
  • yum -y install bzip2
  • cd /root
  • mkdir Download
  • wget -N –no-check-certificate “https://github.com/q3aql/aria2-static-builds/releases/download/v1.34.0/aria2-1.34.0-linux-gnu-64bit-build1.tar.bz2”
  • Aria2_Name=“aria2-1.34.0-linux-gnu-64bit-build1”
  • tar jxvf “aria2-1.34.0-linux-gnu-64bit-build1.tar.bz2”
  • mv “aria2-1.34.0-linux-gnu-64bit-build1” “aria2”
  • cd “aria2/”
  • make install
  • cd /root
  • rm -rf aria2 aria2-1.34.0-linux-gnu-64bit-build1.tar.bz2
  • mkdir “/root/.aria2” && cd “/root/.aria2”
  • wget “https://raw.githubusercontent.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/master/sh/dht.dat”
  • wget “https://raw.githubusercontent.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/master/sh/trackers-list-aria2.sh”
  • echo > /root/.aria2/aria2.session
  • chmod +x /root/.aria2/trackers-list-aria2.sh
  • chmod 777 /root/.aria2/aria2.session
  • echo “dir=/root/Download
  • rpc-secret=密码,自行更改
  • disk-cache=32M
  • file-allocation=trunc
  • continue=true
  • max-concurrent-downloads=10
  • max-connection-per-server=5
  • min-split-size=10M
  • split=20
  • max-overall-upload-limit=10K
  • disable-ipv6=false
  • input-file=/root/.aria2/aria2.session
  • save-session=/root/.aria2/aria2.session
  • enable-rpc=true
  • rpc-allow-origin-all=true
  • rpc-listen-all=true
  • rpc-listen-port=6800
  • follow-torrent=true
  • listen-port=51413
  • enable-dht=true
  • enable-dht6=false
  • dht-listen-port=6881-6999
  • bt-enable-lpd=true
  • enable-peer-exchange=true
  • peer-id-prefix=-TR2770-
  • user-agent=Transmission/2.77
  • seed-time=0
  • bt-seed-unverified=true
  • on-download-complete=/root/.aria2/OneIndexupload.sh
  • allow-overwrite=true
  • bt-tracker=udp://tracker.coppersurfer.tk:6969/announce,udp://tracker.open-internet.nl:6969/announce,udp://p4p.arenabg.com:1337/announce,udp://tracker.internetwarriors.net:1337/announce,udp://allesanddro.de:1337/announce,udp://9.rarbg.to:2710/announce,udp://tracker.skyts.net:6969/announce,udp://tracker.safe.moe:6969/announce,udp://tracker.piratepublic.com:1337/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker2.christianbro.pw:6969/announce,udp://tracker1.wasabii.com.tw:6969/announce,udp://tracker.zer0day.to:1337/announce,udp://public.popcorn-tracker.org:6969/announce,udp://tracker.xku.tv:6969/announce,udp://tracker.vanitycore.co:6969/announce,udp://inferno.demonoid.pw:3418/announce,udp://tracker.mg64.net:6969/announce,udp://open.facedatabg.net:6969/announce,udp://mgtracker.org:6969/announce” > /root/.aria2/aria2.conf
  • echo -e “开始配置Aria2自启和自动上传”
  • wget –no-check-certificate https://raw.githubusercontent.com/marisn2017/Aria2_OneIndex/master/aria2 -O /etc/init.d/aria2
  • chmod +x /etc/init.d/aria2
  • echo ‘bash /etc/init.d/aria2 start’ >> /etc/rc.local
  • cd /root/.aria2
  • wget –no-check-certificate https://raw.githubusercontent.com/marisn2017/Aria2_OneIndex/master/OneIndexupload.sh
  • chmod +x /root/.aria2/OneIndexupload.sh
  • bash /etc/init.d/aria2 start
  • echo -e “Aria2安装完成”

下面设置定时任务,

  • yum -y install vixie-cron crontabs
  • rm -rf /var/spool/cron/root
  • echo ‘SHELL=/bin/bash’ >> /var/spool/cron/root
  • echo ‘PATH=/sbin:/bin:/usr/sbin:/usr/bin’ >> /var/spool/cron/root
  • echo ‘0 3 */7 * * /root/.aria2/trackers-list-aria2.sh’ >> /var/spool/cron/root
  • echo ‘0 0 * * * bash /etc/init.d/aria2 restart’ >> /var/spool/cron/root
  • echo ‘0 * * * * php /home/wwwroot/OneIndex/one.php token:refresh’ >> /var/spool/cron/root
  • echo “*/10 * * * * php /home/wwwroot/OneIndex/one.php cache:refresh” >> /var/spool/cron/root
  • service crond restart

下面配置防火墙,点击宝塔安全设置,放行6800端口即可。

发表评论

电子邮件地址不会被公开。 必填项已用*标注