centos安装h5ai目录列表
一直想给我自己的download.slogra.com下载站找个好点的程序,终于在最近发现了h5ai这个目录列表程序,简洁的外观,又不简单的功能,很适合我这样挑剔的人.好了,废话不多,下面来看看怎么安装h5ai吧.
系统:centos 6.x(64位)
环境:LNMP
1.安装lnmp
如果不会安装的,也不用看下面的了.
2.下载h5ai
wget https://release.larsjung.de/h5ai/h5ai-0.29.0.zip
3.安装h5ai
unzip h5ai-0.29.0.zip
mv _h5ai DOC_ROOT/_h5ai
#复制_h5ai到你的网站根目录下,如下:
DOC_ROOT
├─ _h5ai
├─ your files
└─ and folders
把文件放置到和h5ai平级目录就可以了.
vi /etc/php.ini
找到下面这一行:
1 | disable_functions = passthru, exec ,system,chroot,scandir, chgrp , chown ,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink, symlink ,popepassthru,stream_socket_server |
把exec,passthru,scandir这三个函数删除掉.
修改nginx配置文件:
vi /etc/nginx/conf/download.slogra.com.conf
01 | server { |
02 | listen 80; |
03 | server_name download.slogra.com; |
04 | root DOC_ROOT/download.slogra.com; |
05 | index index.html index.php /_h5ai/public/index.php; |
06 | include nginx-extra.conf; |
07 |
08 | location ~ .*\.(php|php5)?$ { |
09 | fastcgi_pass unix:/tmp/php-cgi.sock; |
10 | fastcgi_index index.php; |
11 | include fastcgi.conf; |
12 | } |
13 |
14 | location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { |
15 | expires 30d; |
16 | access_log off; |
17 | } |
18 |
19 | location ~ .*\.(js|css)?$ { |
20 | expires 1d; |
21 | access_log off; |
22 | } |
23 | } |
修改_h5ai/private/conf/options.json
01 | /*使用中科大Google Fonts镜像,提高国内加载速度*/ |
02 | "resources" : { |
03 | "scripts" : [], |
04 | "styles" : [ |
05 | "//fonts.lug.ustc.edu.cn/css?family=Ubuntu:300,400,700%7CUbuntu+Mono:400,700" |
06 | ] |
07 | }, |
08 | /*启用下载功能,并以zip为下载多文件时的压缩格式*/ |
09 | "download" : { |
10 | "enabled" : true , |
11 | "type" : "shell-zip" , |
12 | "packageName" : null, |
13 | "alwaysVisible" : false |
14 | }, |
15 | /*允许显示文件信息及下载链接的二维码,但默认不显示,可在左侧栏开启*/ |
16 | "info" : { |
17 | "enabled" : true , |
18 | "show" : false , |
19 | "qrcode" : true , |
20 | "qrFill" : "#999" , |
21 | "qrBack" : "#fff" |
22 | }, |
23 | /*以简体中文为默认语言*/ |
24 | "l10n" : { |
25 | "enabled" : true , |
26 | "lang" : "zh-cn" , |
27 | "useBrowserLang" : false |
28 | }, |
29 | /*关闭视频及音频预览时的自动播放*/ |
30 | "preview-aud" : { |
31 | "enabled" : true , |
32 | "autoplay" : false , |
33 | "types" : [ "aud" ] |
34 | }, |
35 | "preview-vid" : { |
36 | "enabled" : true , |
37 | "autoplay" : false , |
38 | "types" : [ "vid-avi" , "vid-flv" , "vid-mkv" , "vid-mov" , "vid-mp4" , "vid-mpg" , "vid-webm" ] |
39 | }, |
40 | /*不预览文本文件*/ |
41 | "preview-txt" : { |
42 | "enabled" : true , |
43 | "styles" : { |
44 | "txt" : 1, |
45 | "txt-authors" : 1, |
46 | "txt-c" : 3, |
47 | "txt-cpp" : 3, |
48 | "txt-css" : 3, |
49 | "txt-diff" : 1, |
50 | "txt-go" : 3, |
51 | "txt-h" : 3, |
52 | "txt-hpp" : 3, |
53 | "txt-install" : 1, |
54 | "txt-js" : 3, |
55 | "txt-json" : 3, |
56 | "txt-less" : 3, |
57 | "txt-license" : 1, |
58 | "txt-log" : 1, |
59 | "txt-makefile" : 1, |
60 | "txt-md" : 2, |
61 | "txt-py" : 3, |
62 | "txt-rb" : 3, |
63 | "txt-readme" : 1, |
64 | "txt-rtf" : 1, |
65 | "txt-rust" : 3, |
66 | "txt-script" : 3, |
67 | "txt-xml" : 1 |
68 | } |
69 | }, |
70 | /*启用搜索功能*/ |
71 | "search" : { |
72 | "enabled" : true , |
73 | "advanced" : true , |
74 | "debounceTime" : 300, |
75 | "ignorecase" : true |
76 | }, |
77 | /*允许以复选框选择多个文件*/ |
78 | "select" : { |
79 | "enabled" : true , |
80 | "clickndrag" : false , |
81 | "checkboxes" : true |
82 | }, |
83 | /*允许使用树状目录,并默认启用*/ |
84 | "tree" : { |
85 | "enabled" : true , |
86 | "show" : true , |
87 | "maxSubfolders" : 50, |
88 | "naturalSort" : true , |
89 | "ignorecase" : true |
90 | } |
配置h5ai访问密码
vi ./_h5ai/private/conf/options.json
找到这一行:
"passhash": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e",
去http://md5hashing.net/hashing/sha512把你的密码转换为sha512格式.
当从h5ai显示支持界面进去后:
将上图显示no的选项变为yes,以便h5ai可以实现一些更丰富的功能
把_h5ai中private和public两个文件夹中的cache目录权限设置为666,刷新一下网页可以看到两个Public Cache directory和Private Cache directory的no变为yes.
#Use EXIF thumbs
安装php的exif模块即可.
#Movie thumbs
安装ffmpeg
#PDF thumbs
选择安装convert,直接yum -y install ImageMagick即可.
#Shell tar,Shell zip和Shell du
这三项根据h5ai官网,在php.ini被禁用函数中去掉exec和passthru即可,是否有危险不知道,自己掂量,禁用好像也不影响一些功能,另外顺便把scandir函数去掉禁用,不然会出现无非显示目录中文件的情况.
好了,最后就是访问浏览器进行验证.
ps:
https://www.5752.me/1555.html
http://blog.easydcode.com/129.html
ps:
https://www.5752.me/1555.html
http://blog.easydcode.com/129.html
centos7安装ffmpeg
yum -y install epel-release
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
yum -y install ffmpeg ffmpeg-devel
Movie thumbs
‘--conv’ or ‘ffmpeg’
这两个包怎么安装?
实在是没找着,