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.
安装依赖
一条命令安装LAMPapt-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 |
查看h5ai配置
打开http://YOUR-DOMAIN.TLD/_h5ai/public/index.php
Cache directory
这个是系统文件夹的权限,分别修改public和private文件夹里的cache文件夹就可以正常cd _h5ai
chmod 666 private/cache
chmod 666 public/cacheMovie thumbs
视频预览,执行:apt-get install libav-tools
PDF thumbs
PDF预览,执行:apt-get install aptitude
aptitude install imagemagickShell zip
zip预览,执行: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.ini
将 scandir
exec
passthru
三个函数删除, 并保存重启lnmp