十一博客 十一博客

Aria2+Aria2Ng+OneIndex 宝塔搭建教程

in 默认类,技术控,分享控 read (612) 文章转载请注明来源!

有留言说想要个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端口即可。

本文基于《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
文章链接:https://blog.67cc.cn/archives/aria2-aria2ng-oneindex-pagoda-course.html (转载时请注明本文出处及文章链接)

教程分享
发表新评论
已有 6 条评论
  1. dsong
    dsong 10Chrome 69
    回复

    怎么设置网盘密码呢?

    1. 十一
      十一本文作者 10Chrome 63
      回复

      @dsong 自行查看oneindex的官方文档说明,教程里有地址

  2. 逸香阁
    逸香阁 NChrome 62
    回复

    其实我最近也在搞这个,不过Aria2总是抽风,不是这里出问题就是那里出问题,然后就暂时放下了

  3. 老王 a
    老王 a火狐浏览器 55
    回复

    美化版的??

  4. 木芽
    木芽 10Chrome 69
    回复

    有几个错误呢
    : No such file or directoryoot/.aria2
    --2018-10-16 13:43:57-- https://raw.githubusercontent.com/marisn2017/Aria2_OneIndex/master/OneIndexupload.sh%0D
    Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.40.133
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.40.133|:443... connected.
    HTTP request sent, awaiting response... 404 Not Found
    2018-10-16 13:43:58 ERROR 404: Not Found. chmod: cannot access ‘/root/.aria2/OneIndexupload.sh\r’: No such file or directory
    bash: /etc/init.d/aria2: No such file or directory

    1. 老王 a
      老王 a火狐浏览器 55
      回复

      @木芽 换个脚本,网上搜 逗笔 的

❋该站点已苟活
© 2017-2018 十一博客 蜀ICP备15021123号-1
又拍云
PREVIOUS NEXT
雷姆
拉姆