h5ai是一款不错的php目录列表程序,也就是php列目录工具,支持apache和nginx
官网 https://larsjung.de/h5ai/

介绍

h5ai is a modern file indexer for HTTP web servers with focus on your files. Directories are displayed in a appealing way and browsing them is enhanced by different views, a breadcrumb and a tree overview. Initially h5ai was an acronym for HTML5 Apache Index but now it supports other web servers too.

Requires PHP 5.5+ and works fine with Apache httpd, lighttpd, nginx and Cherokee.

安装依赖

一条命令安装LAMP

apt-get install mysql-server mysql-client apache2 php5 php5-cli libapache2-mod-php5 php5-mysql php5-curl php5-gd php-pear php5-imagick php5-mcrypt php5-memcache php5-mhash php5-sqlite php5-xmlrpc php5-xsl php5-json php5-dev libpcre3-dev

安装h5ai

cd /var/www/html
# wget https://release.larsjung.de/h5ai/h5ai-0.28.1.zip 旧版本有 搜索/打包下载 等功能
wget https://release.larsjung.de/h5ai/h5ai-0.29.0.zip
apt-get install unzip
unzip h5ai*.zip

查看h5ai配置

打开http://YOUR-DOMAIN.TLD/_h5ai/public/index.php

  • Cache directory这个是系统文件夹的权限,分别修改public和private文件夹里的cache文件夹就可以正常

    cd _h5ai
    chmod 666 private/cache
    chmod 666 public/cache
  • Movie thumbs视频预览,执行:
    apt-get install libav-tools

  • PDF thumbsPDF预览,执行:

    apt-get install aptitude
    aptitude install imagemagick
  • Shell zipzip预览,执行:
    apt-get install zip

配置web服务器

将/_h5ai/public/index.php添加到web服务器配置文件中默认首页文件列表代码的最后位置

  • Apache2
    cd /etc/apache2/sites-available/
    修改配置文件,增加一行
    DirectoryIndex index.html index.php /_h5ai/public/index.php
    然后执行a2enmod rewrite
    最后service apache2 reload

  • Nginx
    对应的nginx配置文件中找到如下一行
    index index.html index.php
    改为
    index index.html index.php /_h5ai/public/index.php
    最后service nginx reload

正常安装后,文件放置到和_h5ai平级目录就可以,当然也可以建立文件夹等等

使用 LNMP 一键包的要删除 PHP 禁用函数

编辑 /usr/local/php/etc/php.iniscandir exec passthru 三个函数删除, 并保存重启lnmp

参考

h5ai-默默的文件分享系统