---
title: "搭建一个可搜索的网页文件服务器(即52破解爱盘)"
url: https://www.landian.news/archives/61799.html
date: 2019-07-25T17:58:06+08:00
modified: 2019-07-25T11:09:12+00:00
author: "疯子"
description: "一直想搞一个可搜索又美观的网页文件服务器，而52破解论坛的爱盘让为之着迷，哈哈~我想只要接触过IT行业，应该都 [&hellip;]"
categories: ""
tags: "Linux, web, 文件系统, 服务器"
---

# 搭建一个可搜索的网页文件服务器(即52破解爱盘)

一直想搞一个可搜索又美观的网页文件服务器，而52破解论坛的爱盘让为之着迷，哈哈~我想只要接触过IT行业，应该都知道52破解论坛，而52破解论坛的爱盘就是由52破解论坛的一位大神独立开发的，他的名字叫Ganlv，目前已经爱盘3.0了，而且最重要的是开源啦~为Ganlv点赞?

爱盘第三版由Ganlv大神使用 Vue 独立开发，所有代码均托管在 Github上，地址：[https://github.com/ganlvtech/down_52pojie_cn](https://github.com/ganlvtech/down_52pojie_cn)

爱盘全新自适应界面，美的让你窒息！不管手机还是电脑都没问题，自适应让界面完全贴合屏幕，页面太美了没法截图，自己直接访问去感受吧 [https://down.52pojie.cn](https://down.52pojie.cn)，支持搜索、全部文件同时浏览、按上传时间和文件大小排序。
 爱盘浏览目录和切换返回演示

![](https://img.lancdn.com/landian/2019/07/61799-1.gif)

浏览全部文件，支持通过上传时间、文件大小和文件名进行排序演示

![](https://img.lancdn.com/landian/2019/07/61799-2.gif)

支持文件名搜索演示

![](https://img.lancdn.com/landian/2019/07/61799-3.gif)

还有常用链接等诸多细节改进就不一一赘述，请自行体验！

需要安装Nginx和PHP，给大家回顾下

Nginx：[https://www.landian.news/archives/60484.html](https://www.landian.news/archives/60484.html)

PHP(Nginx)：[https://www.landian.news/archives/60599.html](https://www.landian.news/archives/60599.html)

剩下的步骤debian和centos差不多，就直接介绍啦

首先我们需要下载爱盘最新版本的源码，地址：[https://github.com/ganlvtech/down_52pojie_cn/releases](https://github.com/ganlvtech/down_52pojie_cn/releases)

```
# wget https://github.com/ganlvtech/down_52pojie_cn/releases/download/v2.1.3/dist.zip
解压它
# unzip dist.zip
把它移动到网站根目录里面，并把文件名改为aipan
# mv dist /usr/share/nginx/html/aipan
配置nginx，这个只是基础配置，大家可以自己添加ssl呀域名呀等等，这里我用的是81端口，防火墙没有放行这个端口，请放行下
# echo -e "server{\n\tlisten\t81;\n\troot\t/usr/share/nginx/html/aipan;\n\tindex\t/index.html;\n}" > /etc/nginx/conf.d/aipan.conf
```

配置爱盘

```
# cp /usr/share/nginx/html/aipan/php/config/config.php.example /usr/share/nginx/html/aipan/php/config/config.php
编辑config.php文件，如下
创建爱盘的文件路径files，配置扫描的根目录（绝对路径）
# mkdir /usr/share/nginx/html/aipan/files
# sed -i "5 s/\/home\/ganlv\/Downloads/\/usr\/share\/nginx\/html\/aipan\/files/g" /usr/share/nginx/html/aipan/php/config/config.php
配置输出的文件路径（绝对路径）list.js
# sed -i "16 s/\/home\/ganlv\/Downloads\/public\/./\/usr\/share\/nginx\/html\/aipan\//g" /usr/share/nginx/html/aipan/php/config/config.php
配置index.html
# sed -i "15 s/{/{\n\t\tbaseUrl: 'http:\/\/你的IP地址',\n\t\t/g" /usr/share/nginx/html/aipan/index.html
示例我的爱盘的文件地址是http://192.168.136.132:81/files
# sed -i "15 s/{/{\n\t\tbaseUrl: 'http:\/\/192.168.136.132:81\/files\/',\n\t\t/g" /usr/share/nginx/html/aipan/index.html
还有一个配置大家可更改可以不更改，区别是hash模式和history 模式，区别请自行百度，或者其它搜索引擎
# sed -i "17 s/history/hash/g" /usr/share/nginx/html/aipan/index.html
```

接着我们执行php扫描文件生成list.js

```
# php /usr/share/nginx/html/aipan/php/scan.php
因为每一次上传文件我们都需要执行一次此命令
所以我们设置一个定时任务，每5分钟执行一次，大家可以根据自己的需要更改时间的长短
# crontab -u root -e
输入下面一行，然后保存退出
*/5 * * * * php /usr/share/nginx/html/aipan/php/scan.php
```

重启nginx就可以访问爱盘啦

```
# systemctl restart nginx
```

大家还可以给文件备注，就是鼠标放在文件上会自动显示备注的信息

编辑/usr/share/nginx/html/aipan/php/data/description.yml

```
给大家个示例，可以配合52破解爱盘来琢磨挺简单的
name: /
children:
  -
    name: Challenge
    description: 收录论坛往年比赛题目
    children:
      -
        name: 2012CM
        description: 2012 年论坛举行 CrackMe 大赛的作品和对应的分析文章，难度有易、中、难，大家任选学习
      -
        name: 2016_Security_Challenge
        description: 2016 年论坛举行安全挑战赛，容纳了更多与实际应用息息相关的 Windows、移动安全相关考题，欢迎大家学习
```

教程就这样结束了，文件的上传和删除大家可以用sftp，一般linux都是自带的，这样就不用再搭建ftp啦，大家可以访问自己的爱盘地址看一看，需要注意的是nginx端口和防火墙有没有开发，爱盘的页面还是52破解的界面，大家可以自行更改html文件改成自己喜欢的样式~就这样啦，感谢大家的支持~?

---

Source: [搭建一个可搜索的网页文件服务器(即52破解爱盘)](https://www.landian.news/archives/61799.html)
