有些时候我们要做一个个人仓库,但又不喜欢apache/nginx的默认index那种过于朴素的页面。这时候php目录列表程序的作用就发挥出来了。我个人也用过许多类似的程序,但是还是比较偏爱h5ai,因为部署方便,不需要像fancy index那样重新编译nginx,而功能也足够强大,美观更是没话说。DEMO
部署的方法也是相当简单,在作者官网有说明,可能有人不喜欢全英文的……我来简单的说一下。
一.安装
- 把你下载的h5ai程序包解压会看到里面有_h5ai这个文件夹,将其上传到你的web目录(当然也可以上传后再解压):
DOC_ROOT/_h5ai
.
1234DOC_ROOT├─ _h5ai├─ your files└─ and folders
访问http://YOUR-DOMAIN.TLD/_h5ai/public/index.php
, 这个页面会显示一些依赖之类的,符合代表能使用更多功能。 - 把
/_h5ai/public/index.php
(注意优先级!)添加到默认首页的配置项. 这样h5ai会接管在DOC_ROOT下所有不含
有效首页文件的目录.某些web服务器的修改方法:- Apache httpd 2.2/2.4: 在
httpd.conf
或在任意文件夹的.htaccess
文件中的修改示例:1DirectoryIndex index.html index.php /_h5ai/public/index.php - lighttpd 1.4: 在
lighttpd.conf
中的修改示例:1index-file.names += ('index.html', 'index.php', '/_h5ai/public/index.php') - nginx 1.2: 在
nginx.conf
中的修改示例:1index index.html index.php /_h5ai/public/index.php; - Cherokee 1.2: 在
cherokee.conf
中的修改示例:1vserver!1!directory_index = index.html,index.php,/_h5ai/public/index.php
- Apache httpd 2.2/2.4: 在
近期评论