装置

编译|下载

能够本人下载编译,也能够间接去下载作者编译好的release

git clone https://github.com/lrsjng/h5ai.gitcd h5ainpm installnpm run build

编译好后失去的目录构造如下:

环境启动

须要php环境来启动,能够用apache, lighttpd, nginx or cherokee等,我比拟习惯用apache2

service apache2 status# 确保php存在php --version

如果发现apache2无奈解析php,须要装置如下依赖

sudo apt-get install libapache2-mod-phpservice apache2 restart

查看配置

拜访http://localhost/_h5ai/public/index.php,默认明码为空

解决掉这些是no的选项

没有读写权限,能够用如下命令给权限

chmod 777 -R _h5ai/

其余什么是no就去装置什么,解决问题

# ffmpegapt install -y ffmpeg# convertsudo apt-get install imagemagick# PHP GD extension with JPEG support availablesudo apt-get install php-gd libjpeg-dev

直到全都是yes就胜利了。

批改配置

批改语言

"l10n": {     "enabled": true,     "lang": "zh-cn",     "useBrowserLang": true },

开启文件搜寻性能

"search": {     "enabled": true,     "advanced": true,     "debounceTime": 300,     "ignorecase": true },

二维码

"info": {     "enabled": true,     "show": true,     "qrcode": true,     "qrFill": "#999",     "qrBack": "#fff" },

字体减速

把 fonts.googleapis.com 改成 fonts.loli.net
"resources": {    "scripts": [],    "styles": [        "//fonts.loli.net/css?family=Ubuntu:300,400,700%7CUbuntu+Mono:400,700"    ]},

设置主页

vim /etc/apache2/mods-available/dir.conf

设置内容如下,将其批改为主页拜访

<IfModule mod_dir.c>        DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm /_h5ai/public/index.php</IfModule>

展现

平安问题

  1. 默认没有明码管理机制,所有人都能够拜访,能够本人去设置apache2的basic认证。
  2. /_h5ai/private/conf/options.json能够看到密钥,不过如同没什么用。

官网文档

https://larsjung.de/h5ai/