目 录CONTENT

文章目录

Linux/Debian/Ubuntu/CentOS部署文件目录程序-h5ai

ashin
2022-02-18 / 2 评论 / 0 点赞 / 2191 阅读 / 2938 字

h5ai是一款基于PHP开发的文件目录程序,因为页面简洁美观,收到很多人的欢迎。
image5f397ccfb64a8f0b.png
正好linux挂载了onedrive,可以很方便的同步文件。所以趁机也部署一个文件列表,分享本人收藏的一些软件。

安装环境

h5ai需要PHP7以上,web服务器可以是Apache,、lighttpd和nginx。

我使用的是宝塔面板,在上面安装了PHP7.4和nginx。

获取安装包

官方
https://larsjung.de/h5ai/
安装包
https://release.larsjung.de/h5ai/
imagebeb8eebe889102bf.png
直接选择最新版下载。

部署安装包

将h5ai-0.30.0.zip上传到web目录,并且解压。
是Web目录的结构如下,_h5ai目录和共享的文件夹目录平级。

DOC_ROOT
 ├─ _h5ai
 ├─ 共享文件夹1
 └─ 贡献文件夹2

打开putenv函数

通常putenv函数为禁用状态,需要打开h5ai才能正常运行。
如果使用宝塔面板,直接在【PHP-设置-禁用函数】中,将此函数删除。

设置默认首页

由于_h5ai中的首页并不在web根目录,所以需要设置默认首页。
Apache更改.htaccess文件

DirectoryIndex  index.html  index.php  /_h5ai/public/index.php

lighttpd更改lighttpd.conf

index-file.names += ("index.html", "index.php", "/_h5ai/public/index.php")

nginx更改nginx.conf

index  index.html  index.php  /_h5ai/public/index.php;

Cherokee更改cherokee.conf

vserver!1!directory_index = index.html,index.php,/_h5ai/public/index.php

如果使用宝塔面板,直接默认主页添加:/_h5ai/public/index.php
image4116b037b1163e37.png

验证

打开地址
https://app.sqmn666.com/_h5ai/public/index.php
第一次打开会提示密码是空,可以直接登陆。
如果要设置密码,可以更改【/_h5ai/private/conf/options.json】文件
image982d4027c0ff1452.png
如显示上述页面,说明就能访问了。如果只是用来下载文件,没有其他需求,本身也没有强迫症,那么这样就部署好了。

访问共享目录

打开首页,就能看到共享的文件了。
https://app.sqmn666.com
imagea2bdf8cb1454e424.png

进阶

开启全部扩展

对于有些有强迫症的朋友,可能会想把这些【No】全部变成【yes】
image49569bd1f64b6f2c.png
大致方法如下:
1、像打开putenv函数一样,开启exec函数。
2、PHP安装imagemagick和exif扩展。
3、服务器安装ffmpeg等页面提示缺少的软件。

挂载云盘

h5ai是可以搭配云盘使用的,比如利用rclone将目录云盘挂载成本地目录,非linux使用rclone挂载onedrive网盘常方便。

但是需要注意的是,有些网盘可能并不允许用户这么做。

0

评论区