How to add the nginx-rtmp-module module to the nginx installed by brew, and set up the rtmp stream processing server

给brew安装的 nginx 添加 nginx-rtmp-module 模块,并搭建rtmp流处理服务器. 环境基础信息如下:  macOS Mojave 版本 10.14 nginx 版本 1.15.5 nginx-rtmp-module 版本 1.2.1 首先给 brew 安装的 nginx 添加 nginx-rtmp-module 模块

添加编译参数 --add-module=/usr/local/Cellar/nginx-modules/nginx-rtmp-module-1.2.1

编译的时候会有多个源码文件爆如下错误(还不知道是什么原因导致?).

解决办法是修改报错的 c 源码文件的 include 文件路径(修改成后如下图),需要根据报错的文件进行修改,实测修改编译后的程序无问题:

然后编辑 nginx.conf 添加如下配置(我本机的配置):

如果nginx之前是启动状态则重启nginx服务.

打开浏览器访问 http://rtmp.kernelstudio.com/stat 看到如下图就说明安装成功: 如果未安装ffmpeg 则使用 brew 进行安装:

使用 ffmpeg 进行流推测试(下面的命令是推的直播形式的流):

下载 VLC 播放器进行测试观看 ( File -> Open Network ): 软件点击 play 播放,出现如下视频则表示安装配置没问题: 进行web端的hls播放测试.

打开浏览器访问 http://rtmp.kernelstudio.com 查看推送的视频是否成功.

Nginx Access Control Allow Origin

当静态资源文件和主站域名不一样时,字体文件之类的会爆如下错误: Font from origin 'http://www.typenter.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.kernelstudio.com' is therefore not allowed access. Nginx 解决办法:

将这段代码添加到 http{} 或者 server{} 中, 域名也可以进行通配  *.kernelstudio.com

Nginx refused visitor IP

nginx禁止直接使用IP访问服务器:

 

VPS安装debian-X64,mysql-5.6.10,php-5.4.12,nginx-1.2.7与配置

VPS安装debian-X64,mysql-5.6.10,php-5.4.12,nginx-1.2.7与配置
环境Debian6.0X64/512M/20G.安装前的配置以及安装一些必要的工具
# aptitude update
# aptitude upgrade
# aptitude -y purge apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common
# aptitude install build-essential cmake //编译mysql5.5以上就要用到的编译工具 ......

nginx & wordpress configure rewrite

nginx & wordpress 配置重写来做伪静态,每个域名单独放到一个server文件中,在nginx.conf中包含进去,这样有利于配置管理.
me@localhost /# cat /webserver/nginx/vhost/lastme.conf
1.在需要配置伪静态的server配置文件中,配置如下...