静看光阴荏苒
不管不顾不问不说也不念

Aria2+AriaNG+FileManager自建离线下载网盘

Aria2和AriaNG之前已经介绍过很多次了,所以本篇文章的主角应该是FileManager,这是一个由GO语言开发的小巧、实用的文件管理器,别看它部署简单,五脏可是俱全的哦,具备的功能完全可以满足日常需求。

我个人认为这个FileManager的优势很明显,拿老牌的H5ai以及DirectoryLister对比下吧:

1、FileManager部署最简单,不依赖任何其他的组件,像H5ai和DirectoryLister都还需要PHP的支持,其次H5ai的配置还有点蛋疼,着实没有FileManager方便。

2、功能方面,FileManager可以说是最强大的,与其说它是一个文件管理器,不如说它更像一个功能齐全的网盘程序。具体都有哪些功能,我会在文章后面给大家介绍。

3、UI界面最精致最漂亮,现代化的风格,很有逼格。

进入正题,准备一台VPS,系统选择CentOS7X64,使用Xshell以root用户登录到你的机器内。

先来把FileManager调教好:

cd /root
mkdir filemanager
cd filemanager
wget https://github.com/hacdias/filemanager/releases/download/v1.4.5/linux-amd64-filemanager.tar.gz
tar -zxvf linux-amd64-filemanager.tar.gz

注:如果你的系统不是64位的,可在如下Github上面找到更多的可用版本:

https://github.com/hacdias/filemanager/releases/

安装screen:

yum -y install screen

启动filemanager:

screen -dmS filemanager ./filemanager --port 23333 --scope /home

注:上述的23333端口可根据你的需要自行修改,/home也可以根据你的自行需要更改。

这样filemanager就启动完成了,此时可以打开你的VPS公网IP+23333端口来访问看看:

默认的管理员账号密码都是admin。

使用admin账号登录到filemanager后首先要做的事情就是把密码改了:

接着我们新建一个用户(如果你是打算把这个网盘提供公开使用,那么请务必操作这一步,否则可以跳过)

然后按如下图分配这个用户的权限:

这样完成后,你就可以把这个用户公开了,别人登录进来就只有访问和下载文件的权限,其他什么事情都做不了。

接下来就是安装Aria2了,本文开头已经强调过要使用CentOS7,所以你可以直接使用下面的方法来编译安装Aria2:

cd /root
wget https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1.tar.gz
tar xzvf aria2-1.33.1.tar.gz
cd aria2-1.33.1
./configure
make
make install

如果你不是CentOS7而是6的话,则需要先升级gcc到可支持编译Aria2的版本然后再执行上面的命令:

wget https://copr.fedoraproject.org/coprs/rhscl/devtoolset-3/repo/epel-6/rhscl-devtoolset-3-epel-6.repo -O /etc/yum.repos.d/rhscl-devtoolset-3-epel-6.repo
yum install devtoolset-3-gcc devtoolset-3-gcc-c++ devtoolset-3-binutils devtoolset-3-gcc-gfortran
scl enable devtoolset-3 bash
gcc --version

安装好Aria2后,现在来启动Aria2:

aria2c --enable-rpc --rpc-listen-all --rpc-allow-origin-all --rpc-secret=lala -c --dir /root/downloads -D

注:请将–rpc-secret=后面的这个lala尽量修改复杂一点,这是你的Aria2RPC连接密匙,待会儿要用到,一定要记住了。

Aria2启动完成后,我们需要一个图形化界面来方便使用Aria2,所以这里我们需要安装一个AriaNG,首先我们下载宝塔面板:

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

宝塔面板安装完成后,使用宝塔安装一个LNMP环境,环境装好后新建一个站点,在这个站点根目录下下载AriaNG程序:

下载地址:

https://github.com/mayswind/AriaNg/releases/download/0.3.0/aria-ng-0.3.0.zip

如图:

下载完成后解压:

此时你就可以通过浏览器访问到这个AriaNG的UI界面了,首先请按如图操作,将之前启动Aria2的密钥填入其中:

接着,不出意外你就可以看到AriaNG成功连接上了Aria2:

此时,我们利用AriaNG来修改Aria2默认的下载目录为/home(和之前filemanager内指定的目录要一致):

现在就可以用AriaNG下载文件试试了,我这里随便试了个BT种子:

在下载完成后,我们打开filemanager可以看到之前下载好的文件显示在里面了,并且我们可以在这里将文件下载回本地:

像类似上图这种文件夹的形式,filemanager支持一次性打包下载:

如果是图片格式的文件,可以直接在线预览:

如果视频格式是mp4的话,使用高版本的Chome等浏览器可以直接在线播放:

你还可以分享文件给你的朋友,指定分享连接是永久生效还是到期自动销毁:

当然像一些很基本的功能,比如:新建文件、新建文件夹、重命名文件/文件夹、复制文件、移动文件、删除文件、在线上传/下载文件等等,filemanager都是完美支持的!

至此,相信你把这篇文章看到这里,你已经可以熟练使用filemanager了,并且能够自由使用Aria2+AriaNG来下载你需要的文件到filemanager中。

写在最后:

一些你可能会遇到的问题:

一、我不想用filemanager了,如何关闭?或者如何卸载?

你有两种方法可以停止运行filemanager:

1、输入如下命令:

screen -r filemanager

键盘组合键Ctrl+C退出即可。

2、输入如下命令:

ps -ef | grep filemanager

找到回显的filemanager进程ID使用kill命令强行终止:

kill -9 进程ID

卸载的话直接rm就行:

cd /root
rm -rf filemanager

二、filemanager无法访问?打不开?首先检查防火墙配置,最简单的办法把防火墙关了:

systemctl stop firewalld.service

不想关闭防火墙?防火墙还有用处?可以添加如下规则放行23333端口:

firewall-cmd --permanent --zone=public --add-port=23333/tcp
firewall-cmd --permanent --zone=public --add-port=23333/udp
firewall-cmd --reload

三、我自己的admin账号为什么一直显示的是root目录?如何更改?

用户管理-编辑你的管理员账号-修改目录范围即可。其他用户由于我们之前启动filemanager的时候已经指定了初始目录为/home,所以不会有这个问题,只有管理员需要自己指定。

四、filemanager还有更多可配置选项吗?怎么配置?

请参考:https://hacdias.github.io/filemanager/configuration/

最后再多废话一句,如果你不是特别喜欢AriaNG这个UI的话,还有一个Webui-Aria2也是很不错的,详情可浏览Gayhub:

https://github.com/ziahamza/webui-aria2

赞(8)
未经允许不得转载:荒岛 » Aria2+AriaNG+FileManager自建离线下载网盘
分享到: 更多 (0)

评论 49

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    有没适合的vps介绍下?感觉找VPS好麻烦。 :wink:

    qingbise6年前 (2018-01-20) Google Chrome 63.0.3239.84 Google Chrome 63.0.3239.84 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 你要先说下你是什么用途啊。。。做站还是?

      LALA6年前 (2018-01-21) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
      • 只要下载就好。价格低点的。

        qingbise6年前 (2018-01-21) Google Chrome 63.0.3239.84 Google Chrome 63.0.3239.84 Windows 10 x64 Edition Windows 10 x64 Edition回复
        • 搬瓦工吧,bwh1.net
          这家的机器很不错的,下载的话装个锐速速度可以跑很快,而且随便跑,他家不会随便BAN机器。

          LALA6年前 (2018-01-21) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
          • 这一家?哪 :cry: 一家?

            qingbise6年前 (2018-01-21) Google Chrome 63.0.3239.108 Google Chrome 63.0.3239.108 Windows 10 x64 Edition Windows 10 x64 Edition
          • bwh1.net,不是发给你网址了么。

            LALA6年前 (2018-01-22) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition
  2. #2

    make: *** No targets specified and no makefile found. Stop.
    请问装aria2c出现这个提示咋办?

    xinxin6年前 (2018-01-23) Google Chrome 63.0.3239.132 Google Chrome 63.0.3239.132 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 没有安装gcc吧,安装一个。不会的话可以百度。

      东风6年前 (2018-05-03) Google Chrome 66.0.3359.117 Google Chrome 66.0.3359.117 Windows 10 x64 Edition Windows 10 x64 Edition回复
  3. #3

    up主我解决了,同时希望你能更新下教程。在Filemanager部署过程也报错了,原因是缺少了epel,要加上“yum -y install epel-release”才可以。至于make的部署需要有依赖,“yum -y install gcc gcc-c++ autoconf automake”,“yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel”,补上这两步即可。

    xinxin6年前 (2018-01-23) Google Chrome 63.0.3239.132 Google Chrome 63.0.3239.132 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 这个可能是你的系统太精简了,连gcc和make都没安装的原因。每个人的系统环境都不一样,所以不能百分百保证一定能装成功。

      LALA6年前 (2018-01-23) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
      • 深表同情!不过凡事两面看= =证明你开始火了,哇咔咔。 :mrgreen:

        xinxin6年前 (2018-01-23) Chrome 63.0.3239.73 Chrome 63.0.3239.73 iPhone iOS 11.2.2 iPhone iOS 11.2.2回复
  4. #4

    lala你的bolg怎么了?!半天上不去。

    xinxin6年前 (2018-01-23) Google Chrome 63.0.3239.132 Google Chrome 63.0.3239.132 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 被DDOS了。

      LALA6年前 (2018-01-23) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
  5. #5

    我现在遇到另一个情况了,重启后脚本没跟着启动= =,请问在centos7下怎么设置aria2和filemanager开机启动。。

    xinxin6年前 (2018-01-23) Chrome 63.0.3239.73 Chrome 63.0.3239.73 iPhone iOS 11.2.2 iPhone iOS 11.2.2回复
    • 我待会写一个通用的开机启动脚本。

      LALA6年前 (2018-01-23) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
  6. #6

    为何我的一直连接不上去呢

    changfu6年前 (2018-01-27) Google Chrome 64.0.3278.0 Google Chrome 64.0.3278.0 Windows 7 x64 Edition Windows 7 x64 Edition回复
  7. #7

    有商业网盘源码推荐吗?可以对外注册的

    筑楼6年前 (2018-02-03) Google Chrome 64.0.3282.137 Google Chrome 64.0.3282.137 Android 6.0.1 Android 6.0.1回复
    • 国外Yetishare,国内就phpdisk吧,推荐Yetishare。

      LALA6年前 (2018-02-04) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
  8. #8

    额..纯小白一个…最近出于好玩在倒腾…从安装宝塔界面起有点疑问…有时间的话能解答一下吗…谢谢..
    在宝塔解压airaNG压缩包那一步之后…去哪进入它的管理界面呢…我试了ip:端口 和 域名…都是进入filemanager界面…然而并未显示airaNG…..是怎么回事….
    我瞄了一下github上airaNG intro,他不是说ng依赖库是‘Node.js, NPM, Gulp and Bower ’吗…理论上是不是只要有这几个installed就行了…然后可以去找一下这几个的安装包?(还没试,不知道可行不)… 不过话说回来,宝塔的极速安装还是算快的…lnmp.org的一键包要装好久…就是站点绑定那一步看得我有点懵…到那一步就弄不下去了…

    mikezhuo6年前 (2018-02-11) Google Chrome 63.0.3239.132 Google Chrome 63.0.3239.132 Mac OS X  10.13.3 Mac OS X 10.13.3回复
    • Aria2NG安装不需要你说的这些组件,你说的这些是从源头建设才需要。实际上作者已经有打包好的资源了。打包好的安装包只需要一个可以跑html的环境就行,也就是说只需要一个nginx就足矣。再通俗一点的说就是Aria2NG就是一堆html页面,不需要其他任何依赖。
      你把Aria2NG解压到你的站点根目录,你这个站点绑定的是哪个域名或者IP就直接访问就行了,不需要加端口。如果是安装在子目录内,就访问子目录即可。

      LALA6年前 (2018-02-11) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
      • 谢谢…这两天不在家,又没邮箱提醒..没看到…
        刚看完你回复,去恢复快照重新执行了一遍命令..发现是aria2安装失败…之前是我搞错了…
        看报错语句是缺少C++11支持而失败…
        #
        configure: error: *** A compiler with support for C++11 language features is required.
        [root@host aria2-1.33.1]# make
        make: *** 没有指明目标并且找不到 makefile。 停止
        #
        我查了centos7默认支持C++11了啊…而我检查确认是瓦工提供的centos7 *64,你文章一开始我就检查了…但我还是去试了下升级GCC,然而…devtool-2又报错error-14 404…然后我看了下提示的解决方法…disable了devtool-2运行,再次升级GCC,又提示devtool-3(什么开发包3?)错误:
        #
        错误:软件包:devtoolset-3-gcc-gfortran-4.9.2-6.el6.x86_64 (rhscl-devtoolset-3)
        需要:libmpfr.so.1()(64bit)
        错误:软件包:devtoolset-3-gcc-4.9.2-6.el6.x86_64 (rhscl-devtoolset-3)
        需要:libgmp.so.3()(64bit)
        错误:软件包:devtoolset-3-gcc-4.9.2-6.el6.x86_64 (rhscl-devtoolset-3)
        需要:libmpfr.so.1()(64bit)
        错误:软件包:devtoolset-3-gcc-gfortran-4.9.2-6.el6.x86_64 (rhscl-devtoolset-3)
        需要:libgmp.so.3()(64bit)
        错误:软件包:devtoolset-3-gcc-c++-4.9.2-6.el6.x86_64 (rhscl-devtoolset-3)
        需要:libgmp.so.3()(64bit)
        错误:软件包:devtoolset-3-gcc-c++-4.9.2-6.el6.x86_64 (rhscl-devtoolset-3)
        需要:libmpfr.so.1()(64bit)
        #
        然后我又去google…简直了…这么一通下来…感觉事情变得复杂起来…
        能指导一下吗….谢谢…各种不懂程序语言读者英语reading硬猜…..
        实在有点莫名其妙…

        mikezzhuo6年前 (2018-02-14) Google Chrome 37.0.2062.122 Google Chrome 37.0.2062.122 Mac OS X  10.10.2 Mac OS X 10.10.2回复
        • 把系统重装了,然后重头再来吧。。。yum有一个天坑就是各种依赖关系错综复杂,别这样折磨自己。。。
          你是CentOS7,就直接编译安装Aria2就行了,不需要再装什么其他的东西了。

          LALA6年前 (2018-02-14) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
          • 新年好啊…系统重装也不行…真是很神奇…
            #
            [root@host ~]# cd aria2-1.33.1
            [root@host aria2-1.33.1]# ./configure
            checking build system type… x86_64-pc-linux-gnu
            checking host system type… x86_64-pc-linux-gnu
            checking target system type… x86_64-pc-linux-gnu
            checking for a BSD-compatible install… /usr/bin/install -c
            checking whether build environment is sane… yes
            checking for a thread-safe mkdir -p… /usr/bin/mkdir -p
            checking for gawk… gawk
            checking whether make sets $(MAKE)… yes
            checking whether make supports nested variables… yes
            checking whether make supports nested variables… (cached) yes
            checking for style of include used by make… GNU
            checking for gcc… no
            checking for cc… no
            checking for cl.exe… no
            configure: error: in `/root/aria2-1.33.1′:
            configure: error: no acceptable C compiler found in $PATH
            See `config.log’ for more details
            [root@host aria2-1.33.1]# make
            make: *** 没有指明目标并且找不到 makefile。 停止
            #
            看命令行是没有C支持…真是B了狗了…我服气了…

            mikezhuo6年前 (2018-02-17) Google Chrome 63.0.3239.132 Google Chrome 63.0.3239.132 Mac OS X  10.13.3 Mac OS X 10.13.3
          • 那既然你这机器不能编译安装,那就用EPEL源装旧版本吧,但是提前说一句,EPEL装的版本貌似不支持AriaNG。(我很久以前测试的,现在不清楚。)

            LALA6年前 (2018-02-17) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition
          • :razz: 谢谢啦…我还试过别的方法…暂时放弃了…改天弄个小鸡再试试…之前倒腾caddy把手里的一台小鸡弄得达到OS每月重装上限35次 :!: 老盯着一台搞…学习成本不要太高..

            mikezhuo6年前 (2018-02-17) Google Chrome 63.0.3239.132 Google Chrome 63.0.3239.132 Mac OS X  10.13.3 Mac OS X 10.13.3
          • 别害羞,35次算少的。。。

            LALA6年前 (2018-02-18) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition
          • 额,3天35次 :razz:

            mikezzhuo6年前 (2018-02-19) Google Chrome 37.0.2062.122 Google Chrome 37.0.2062.122 Mac OS X  10.10.2 Mac OS X 10.10.2
  9. #9

    如何卸载

    mppp6年前 (2018-02-11) Google Chrome 55.0.2883.87 Google Chrome 55.0.2883.87 Windows 10 x64 Edition Windows 10 x64 Edition回复
  10. #10

    Scute 嘿嘿嘿

    特咯啊6年前 (2018-02-17) Google Chrome 64.0.3282.137 Google Chrome 64.0.3282.137 Android 8.0.0 Android 8.0.0回复
    • 老司机~

      LALA6年前 (2018-02-18) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
  11. #11

    dalao filemanager可以自定样式吗,就比如xx这种

    z'z'z6年前 (2018-02-19) Google Chrome 63.0.3239.132 Google Chrome 63.0.3239.132 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 不是很清楚呀,老哥。貌似可以自定义CSS,其他的我就没怎么折腾过了。

      LALA6年前 (2018-02-19) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
  12. #12

    被转义掉了 :cry: :cry: 就是那种html链接

    z'z'z6年前 (2018-02-19) Google Chrome 63.0.3239.132 Google Chrome 63.0.3239.132 Windows 10 x64 Edition Windows 10 x64 Edition回复
  13. #13

    :smile: :smile: :smile: 我搞定了,哈哈哈哈哈! 几个问题都解决了
    1.gcc和zlib是无意中看到xinxin评论里的解决方法…我几个vps都是CentOS7但都出现该问题..dalao的文章里其实最好更新一下说明的..

    2.用文中的代码编译安装aira2在启动aria2会无法bash aria2c,倒腾了一下没成功于是改用了doubi的一键脚本,一键安装启动的,把rpc密码改成自己的就好了。

    3. aria2下载bt速度0,然后我在git上找到了ngosang大佬的日更项目trackerlist…瞬间跑满百兆口带宽…

    新技能get..仅供参考

    mikezhuo6年前 (2018-03-03) Google Chrome 64.0.3282.186 Google Chrome 64.0.3282.186 Mac OS X  10.13.3 Mac OS X 10.13.3回复
    • 可以,成功了然后用的舒服就行~

      LALA6年前 (2018-03-03) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
  14. #14

    安装aria2的时候输入make,提示
    [root@vultr aria2-1.33.1]# make
    make: *** No targets specified and no makefile found. Stop.

    啦啦啦6年前 (2018-04-06) Google Chrome 65.0.3325.181 Google Chrome 65.0.3325.181 Windows 7 x64 Edition Windows 7 x64 Edition回复
    • 参考一下楼上xinxin的回复。

      LALA6年前 (2018-04-07) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
  15. #15

    如果主要目的是为了离线小姐姐 :!: ,是不是就需要超大容量的vps呢?在离线时视频所占的容量到底是本身大小还是种子大小啊,如果都是按视屏本身体积那么自建的网盘住不了多少小姐姐啊,还不如115性价比了,求大佬解惑

    zeldasun6年前 (2018-04-12) Google Chrome 65.0.3325.181 Google Chrome 65.0.3325.181 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 肯定是视频的原始大小,你可以考虑大硬盘的VPS,或者一些特价独立服务器。

      LALA6年前 (2018-04-12) TheWorld Browser TheWorld Browser Windows 7 x64 Edition Windows 7 x64 Edition回复
  16. #16

    开车新姿势

    天青软件6年前 (2018-04-21) Google Chrome 64.0.3282.186 Google Chrome 64.0.3282.186 Windows 10 x64 Edition Windows 10 x64 Edition回复
  17. #17

    lala呀,我按照教程在centos7的vps上安装了aira2和airang,但是airang始终无法连接到aira2,密码检查过没有错误。请问会是什么原因呢?

    东风6年前 (2018-05-03) Google Chrome 66.0.3359.117 Google Chrome 66.0.3359.117 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 宝塔的安全端口放行一下

      一碗loli汤6年前 (2018-05-15) UC Browser 6.2.3964.2 UC Browser 6.2.3964.2 Windows 10 x64 Edition Windows 10 x64 Edition回复
  18. #18

    安装了Aria2+AriaNG。。正打算找一个管理文件程序。。明儿试试这个。本来也在想用owncloud

    一个人6年前 (2018-06-25) Google Chrome 67.0.3396.87 Google Chrome 67.0.3396.87 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 如果用owncloud的话,那我还是推荐你用nextcloud,毕竟现在own的团队主力开发nextcloud了。

      LALA6年前 (2018-06-26) Google Chrome 66.0.3359.181 Google Chrome 66.0.3359.181 Windows 10 x64 Edition Windows 10 x64 Edition回复
  19. #19

    资源都是哪里找的呀。

    jos6年前 (2018-06-28) Sogou Explorer Sogou Explorer Windows 10 x64 Edition Windows 10 x64 Edition回复
  20. #20

    bt下载始终没速度怎么操作啊

    淡定定定哥5年前 (2019-03-07) Google Chrome 72.0.3626.121 Google Chrome 72.0.3626.121 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 试试:https://github.com/ngosang/trackerslist

      LALA5年前 (2019-03-07) Google Chrome 71.0.3578.98 Google Chrome 71.0.3578.98 Windows 10 x64 Edition Windows 10 x64 Edition回复

分享创造快乐

广告合作资源投稿