跳至主要内容

搭建h5ai文件服务器

h5ai是一款不错的php目录列表程序,也就是php列目录工具,支持apache和nginx

介绍

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
1
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

1
2
3
4
cd /var/www/html
wget https://release.larsjung.de/h5ai/h5ai-0.28.1.zip
apt-get install unzip     
unzip h5ai*.zip

查看h5ai配置

打开http://YOUR-DOMAIN.TLD/_h5ai/public/index.php
  • Cache directory这个是系统文件夹的权限,分别修改public和private文件夹里的cache文件夹就可以正常
    1
    2
    3
    cd _h5ai
    chmod 666 private/cache 
    chmod 666 public/cache
  • Movie thumbs视频预览,执行:
    apt-get install libav-tools
  • PDF thumbsPDF预览,执行:
    1
    2
    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平级目录就可以,当然也可以建立文件夹等等..

评论

此博客中的热门博文

部署 shadowsocks-manager

如何讓 Firefox 有不同的設定檔,並讓它們能同時執行,實現帳號多開、區隔不同用途的瀏覽環境?

使用 shadowsocks Manager 搭建 SS 多人管理平台 Debian/Ubuntu