centos7 安装NGINX-1.16.0+nginx-rtmp-module,配置直播、点播流媒体服务器、同时配置wordpress
在配置之前,首先要安装mysql和PHP
1、下载nginx-1.16.0和rtmp-module
http://nginx.org/en/download.html
https://github.com/sergey-dryabzhinsky/nginx-rtmp-module
到/usr/local/src目录
2、解压后,进入nginx目录准备进行编译
编译前首先搭建基础环境:
yum install -y gcc gcc-c++ autoconf wget
yum -y install wget gcc-c++ ncurses ncurses-devel cmake make perl bison openssl openssl-devel
gcc* libxml2 libxml2-devel curl-devel libjpeg* libpng* freetype*
这下面三个基础的必须安装:
1、 安装openssl
yum install openssl openssl-devel
2、 安装pcre
yum install pcre pcre-devel
3、安装zlib
yum install zlib zlib-devel
4、之后编译:
./configure
--prefix=/usr/local/nginx --add-module=/usr/local/src/nginx-rtmp-module-master --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-stream --with-stream_ssl_module
然后
make && make install
注意,如果之前已经安装了NGINX,只是想升级,那就只make,然后把生成的objs文件夹中的二进制文件“nginx”,复制到之前的安装执行目录:/usr/local/nginx/sbin,之前的执行文件自行备份。
5、然后配置 “/usr/local/nginx/conf” 文件夹中 “nginx.conf”
如果要准备安装wordpress的话,可先查看php配置目录中的www.conf:
vim /etc/opt/remi/php73/php-fpm.d/www.conf
找到【www】选项,发现user和group是系统默认用户和组apache,于是把nginx.conf中的默认用户也改成apache。当然也可以将两者都修改成自己建的系统用户和组。
vim /etc/