h5ai-700x210

一、什么是h5ai

H5ai是一款功能强大 php 文件目录列表程序,由德国开发者 Lars Jung 主导开发,它提供多种文件目录列表呈现方式,支持多种主流 Web 服务器,例如 Nginx、Apache、Cherokee、Lighttpd 等,支持多国语言,可以使用本程序在线预览文本、图片、音频、视频等。具体百度,本文只做代码收藏使用。没有加入离线下载功能,下载只能http。

二、代码收藏

系统更新yum update -y
yum -y install wget screen curl python nano
wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz
tar xzf oneinstack-full.tar.gz
cd oneinstack
screen -S oneinstack
./install.sh

进入oneinstack安装选择

Please input SSH port(Default: 22): 22

Do you want to install Web server? [y/n]: y

Please select Nginx server:
 1. Install Nginx
 2. Install Tengine
 3. Install OpenResty
 4. Do not install
Please input a number:(Default 1 press Enter) 1

Please select Apache server:
 1. Install Apache-2.4
 2. Install Apache-2.2
 3. Do not install
Please input a number:(Default 3 press Enter) 1

Please select tomcat server:
 1. Install Tomcat-8
 2. Install Tomcat-7
 3. Install Tomcat-6
 4. Do not install
Please input a number:(Default 4 press Enter) 1

Please select JDK version:
 1. Install JDK-1.8
 2. Install JDK-1.7
Please input a number:(Default 2 press Enter) 1

Do you want to install Database? [y/n]: y

Please select a version of the Database:
 1. Install MySQL-5.7
 2. Install MySQL-5.6
 3. Install MySQL-5.5
 4. Install MariaDB-10.1
 5. Install MariaDB-10.0
 6. Install MariaDB-5.5
 7. Install Percona-5.7
 8. Install Percona-5.6
 9. Install Percona-5.5
 10. Install AliSQL-5.6
Please input a number:(Default 2 press Enter) 1
Please input the root password of database: 数据库密码
Please choose installation of the database:
 1. Install database from binary package.
 2. Install database from source package.
Please input a number:(Default 1 press Enter) 1

Do you want to install PHP? [y/n]: y

Please select a version of the PHP:
 1. Install php-5.3
 2. Install php-5.4
 3. Install php-5.5
 4. Install php-5.6
 5. Install php-7.0
 6. Install php-7.1
Please input a number:(Default 4 press Enter) 6

Do you want to install opcode cache of the PHP? [y/n]: y
Please select a opcode cache of the PHP:
 1. Install Zend OPcache
 3. Install APCU
Please input a number:(Default 1 press Enter) 1

Do you want to install ImageMagick or GraphicsMagick? [y/n]: y
Please select ImageMagick or GraphicsMagick:
 1. Install ImageMagick
 2. Install GraphicsMagick
Please input a number:(Default 1 press Enter) 1

Do you want to install Pure-FTPd? [y/n]: y

Do you want to install phpMyAdmin? [y/n]: y

Do you want to install redis? [y/n]: y

Do you want to install memcached? [y/n]: y

Do you want to install HHVM? [y/n]: y

安装完毕重启服务器
Do you want to restart OS ? [y/n]: y

Connection closed by foreign host.

Disconnected from remote host(New Session) at 07:21:12.

Type `help' to learn how to use Xshell prompt.

解析域名后
cd oneinstack
./vhost.sh
Please choose to use environment:
 1. Use php
 2. Use java
 3. Use hhvm
Please input a number:(Default 1 press Enter) 1

Do you want to setup SSL under Nginx? [y/n]: n

Please input domain(example: www.example.com): xiaa.eu

Please input the directory for the domain:xiaa.eu :
(Default directory: /data/wwwroot/xiaa.eu): 
Virtual Host Directory=/data/wwwroot/xiaa.eu

Create Virtul Host directory......
set permissions of Virtual Host directory......
domain=xiaa.eu

Do you want to add more domain name? [y/n]: n

Do you want to add hotlink protection? [y/n]: y

Allow Nginx/Tengine/OpenResty access_log? [y/n]: y
You access log file=/data/wwwlogs/xiaa.eu_nginx.log

Allow Apache access_log? [y/n]: y
nano /usr/local/apache/conf/vhost/xiaa.eu.conf
/_h5ai/public/index.php
ctrl+c ctrl+x y enter
cd /data/wwwroot/xiaa.eu
wget http://my.what.lu/Linux/h5ai-0.29.0.zip
unzip h5ai-0.29.0.zip
service httpd restart
service nginx restart


cd /usr/local/php/etc
ls
nano php.ini
找到这一段“This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_g$”
删掉函数passthru,exec,shell_exec
service httpd restart
service nginx restart


yum -y install ImageMagick
cd /data/wwwroot/xiaa.eu/_h5ai/private/
chmod 777 -R cache
cd /data/wwwroot/xiaa.eu/_h5ai/public
chmod 777 -R cache
cd /root
wget http://my.what.lu/Linux/ffmpeginstaller.8.0.zip
unzip ffmpeginstaller.8.0.zip
cd ffmpeginstaller.8.0
chmod +x install.sh
./install.sh