过程:

安装php-fpm和nginx,且经验证二者在其他项目可以正常使用。

从debian8拷贝过来_h5ai的nginx配置如下:

     location ~ [^/]\.php(/|$) {
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; #反注释
include /etc/nginx/snippets/fastcgi-php.conf;
}

由于centos7服务器上没有/etc/nginx/snippets/fastcgi-php.conf这个文件,所以把这行改成了include fastcgi_params;,即:

# _h5ai file server
server {
listen 12345;
# server_name _;
root /home/chudongyu/rtorrent/download;
index index.html index.php /_h5ai/public/index.php; location / {
try_files $uri $uri/ /index.php$is_args$args;
} location ~ [^/]\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
}

但是_h5ai并不能用,症状:

打开172.19.240.132:12345,只有空白页面,不显示任何东西。检查nginx的日志里面完全正常,没有错误。

在文件夹下建立index.html,发现可以显示,但是建立index.php()还是一批空白,啥都没有。

折腾良久,最终发现仅仅include fastcgi_params'是不够的,还要添加:

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

完整的正确配置如下

# _h5ai file server
server {
listen 12345;
# server_name _;
root /home/chudongyu/rtorrent/download;
index index.html index.php /_h5ai/public/index.php; location / {
try_files $uri $uri/ /index.php$is_args$args;
} # location ~ [^/]\.php(/|$) {
# fastcgi_pass 127.0.0.1:9000;
# include fastcgi_params;
# } location ~ \.php$ {
root /home/chudongyu/rtorrent/download;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

参考:https://blog.csdn.net/zsx0728/article/details/81183056

一个视频播放器更好用的_h5ai修改版:

【自用分享】 h5ai HTML5播放器(DPlayer)版

https://www.hostloc.com/thread-438265-1-2.html

直接下载地址: https://www.moerats.com/usr/down/h5ai_dplayer+modified+by+icycat.zip

另一种配置(在其他端口使用/download/路径,如xxx:8080/download/):

.......
location ~ /download(/|$) {
root /home/chudongyu/rtorrent;
index index.html index.php /download/_h5ai/public/index.php;
try_files $uri $uri/ /index.php$is_args$args; # #NOT WORK:
# root /home/chudongyu/rtorrent/download;
# index index.html index.php /_h5ai/public/index.php;
# try_files $document_root $document_root/ /index.php$is_args$args; # $real_script为空的时候,还是回访问download/download...
# # try_files index.html /_h5ai/public/index.php;
# # fastcgi_pass 127.0.0.1:9000;
# # fastcgi_index /_h5ai/public/index.php;
# # fastcgi_param SCRIPT_FILENAME $document_root;
# # include fastcgi_params;
}
location ~ /download/\.php$ {
root /home/chudongyu/rtorrent/download;
index index.html index.php /_h5ai/public/index.php;
# return 200 '$fastcgi_script_name'; # 返回的是 /download/...
set $real_script '';
if ( $fastcgi_script_name ~ /download(.*) ){ # 根据location的匹配规则,$1不会为空
set $real_script $1;
}
# return 200 $real_script;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$real_script;
include fastcgi_params;
}
.......
}

在云服务器搭了个下载器从紫荆下电影。。。



centos7上的h5ai折腾记的更多相关文章

  1. 【转载】有图 KVM折腾记..

    KVM折腾记...https://lengjibo.github.io/KVM%E6%8A%98%E8%85%BE%E8%AE%B0/  Veröffentlicht am 2018-09-20 |  ...

  2. 斐讯N1折腾记

    斐讯N1折腾记:运行 Linux 及优化  2018-06-23  37条评论  4,445次阅读  11人点赞 最后更新时间:2019年03月10日 咳咳咳,上篇教程教大家给斐讯 N1 降级并且刷了 ...

  3. Atom编辑器折腾记

    http://blog.csdn.net/bomess/article/category/3202419/2 Atom编辑器折腾记_(1)介绍下载安装 Atom编辑器折腾记_(2)基础了解使用 Ato ...

  4. 在CentOS7上部署PostgreSQL11数据库系统

    在数据库上的选择,也是基于了稳定性为前提.其实选择的范围并不是太大,基本可以选择的范围也就是SQLServer.MySQL.PostgreSQL这三种.SQL Server是微软的商业数据库,无论是性 ...

  5. BeagleBone折腾记(一):连接你的狗板

    BeagleBone折腾记一连接你的狗板 准备 了解BeagleBone BeagleBone社区 所需软硬件 USB连接 TTL连接 结语 准备 了解BeagleBone BeagleBone可能一 ...

  6. Anaconda折腾记(1)

    Anaconda折腾记 谨此记录小白的我在Anaconda里面的摸爬滚打 更换更新源 可以不使用命令,直接进入C盘,进入user文件夹,进入当前的用户文件夹下,记得显示隐藏文件. 找到.condarc ...

  7. hbase2.1.9 centos7 完全分布式 搭建随记

    hbase2.1.9 centos7 完全分布式 搭建随记 这里是当初在三个ECS节点上搭建hadoop+zookeeper+hbase+solr的主要步骤,文章内容未经过润色,请参考的同学搭配其他博 ...

  8. zookeeper3.5.5 centos7 完全分布式 搭建随记

    zookeeper3.5.5 centos7 完全分布式 搭建随记 这里是当初在三个ECS节点上搭建hadoop+zookeeper+hbase+solr的主要步骤,文章内容未经过润色,请参考的同学搭 ...

  9. 在centos7上安装Jenkins

    在centos7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins ...

随机推荐

  1. Eclipse如何构建(普通web)Maven工程

    进行以下步骤的前提是你已经安装好本地maven库和eclipse中的maven插件了(有的eclipse中已经集成了maven插件) 一.Maven项目的新建 1.鼠标右键---->New--- ...

  2. 饿了么监控系统 EMonitor 与美团点评 CAT 的对比

    背景介绍 饿了么监控系统EMonitor:是一款服务于饿了么所有技术部门的一站式监控系统,覆盖了系统监控.容器监控.网络监控.中间件监控.业务监控.接入层监控以及前端监控的数据存储与查询.每日处理总数 ...

  3. nucleus plus学习总结(后续)

    前言:     刚刚抽筋点了保存发布,结果要审核,那就分开写个续好了. 内容: signal     信号是异步通知task的一种机制,HISR是不可以接收信号的,但是可以发送信号.     TCB中 ...

  4. 【dart学习】-- Dart之async和await

    一,概述 在Dart1.9中加入了async和await关键字,有了这两个关键字,我们可以更简洁的编写异步代码,而不需要调用Future相关的API.他们允许你像写同步代码一样写异步代码和不需要使用F ...

  5. BZOJ 4421: [Cerc2015] Digit Division(思路)

    传送门 解题思路 差点写树套树...可以发现如果几个数都能被\(m\)整除,那么这几个数拼起来也能被\(m\)整除.同理,如果一个数不能被\(m\)整除,那么它无论如何拆,都无法拆成若干个可以被\(m ...

  6. [CSP-S模拟测试]:F(DP+线段树)

    题目传送门(内部题49) 输入格式 第一行四个整数$n,q,a,b$.接下来$n$行每行一个整数$p_i$. 输出格式 一行一个整数表示答案. 样例 样例输入: 10 3 3 7 样例输出: 数据范围 ...

  7. css 布局(圣杯、双飞翼)

    一. 圣杯布局. 左右固宽,中间自适应 三列布局,中间宽度自适应,两边定宽: 中间部分要在浏览器中优先展示渲染: 具体步骤:1.设置基本样式2.圣杯布局是一种相对布局,首先设置父元素container ...

  8. echarts 柱状图 X(Y)轴数据过多时,滑动以及内置缩放的问题

    前言:在开发中碰到的情况(菜鸟出门).           在使用echarts 图表的时候发现要展示的数据过多,但是系统留的展示框太小,造成数据都挤压在一块(不好看而且新感觉很不专业).       ...

  9. HTML5: HTML5 应用程序缓存

    ylbtech-HTML5: HTML5 应用程序缓存 1.返回顶部 1. HTML5 应用程序缓存 使用 HTML5,通过创建 cache manifest 文件,可以轻松地创建 web 应用的离线 ...

  10. MySQL-8.0填坑

    Client does not support authentication protocol 或 Authentication plugin 'caching_sha2_password' cann ...