部署环境centos7(其他安装参数根据需要选择)

1.nginx安装参数


./configure --prefix=/usr/local/nginx --with-http_image_filter_module --with-http_stub_status_module --with-http_ssl_module --add-module=/usr/src/nginx-rtmp-module --add-module=/usr/src/ngx_devel_kit/ --add-module=/usr/src/lua-nginx-module/ --add-module=/usr/src/echo-nginx-module --with-pcre  --add-module=/usr/src/set-misc-nginx-module/ --add-module=/usr/src/nginx-video-thumbextractor-module  --with-cc-opt='-I /usr/local/imagemagick' --with-http_sub_module   --with-ld-opt="-L /application/ffmpeg/lib" --with-cc-opt="-I /application/ffmpeg/include"

2.环境部署(yum部署)

yum源为官方自带,epel源,与三方源,下面为epel与三方源部署方法

rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro

rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm

yum -y install epel-release

3.服务搭建前准备

yum install gcc  make git libgcc libstdc++  subversion ruby ncurses-devel -y

yum  -y install   openssl  openssl-devel  gd  gd-devel

yum -y install lua-devel  pcre pcre-devel

yum -y install yasm   


cd  /usr/src

git clone https://github.com/arut/nginx-rtmp-module.git

git clone https://github.com/simpl/ngx_devel_kit.git

git clone https://github.com/openresty/lua-nginx-module.git

git clone https://github.com/openresty/echo-nginx-module.git

git clone https://github.com/openresty/set-misc-nginx-module.git

git clone https://github.com/wandenberg/nginx-video-thumbextractor-module.git

wget https://www.imagemagick.org/download/ImageMagick.tar.gz

tar xvf ImageMagick.tar.gz

mv ImageMagick-7.0.7-16/ /usr/local/imagemagick            #此处版本为7.0.7-16


wget http://ffmpeg.org/releases/ffmpeg-3.3.3.tar.bz2

tar -xf ffmpeg-3.3.3.tar.bz2

cd ffmpeg-3.3.3

./configure --prefix=/application/ffmpeg/ --enable-shared  --disable-ffserver --disable-ffplay --enable-postproc --enable-gpl

make

echo $?

make install

编辑/etc/ld.so.conf追加

vi /etc/ld.so.conf

/application/ffmpeg/lib/

/application/ffmpeg/include/


ldconfig    刷新模块

cd /mnt

wget  http://nginx.org/files/3182000009C41C0C/nginx.org/download/nginx-1.10.3.tar.gz

tar xvf nginx-1.10.3.tar.gz

cd nginx-1.10.3/


进入nginx路径,编译安装

./configure --prefix=/usr/local/nginx --with-http_image_filter_module --with-http_stub_status_module --with-http_ssl_module --add-module=/usr/src/nginx-rtmp-module --add-module=/usr/src/ngx_devel_kit/ --add-module=/usr/src/lua-nginx-module/ --add-module=/usr/src/echo-nginx-module --with-pcre  --add-module=/usr/src/set-misc-nginx-module/ --add-module=/usr/src/nginx-video-thumbextractor-module  --with-cc-opt='-I /usr/local/imagemagick' --with-http_sub_module   --with-ld-opt="-L /application/ffmpeg/lib" --with-cc-opt="-I /application/ffmpeg/include"

 

make

make install

安装完成