pcre 包作用是让nginx 支持正则表达式,地址重写 rewrite
yum -y install gcc
yum -y install gcc-c++
yum -y install make
yum -y install zlib-devel
yum -y install pcre
yum -y install pcre-devel
yum -y install openssl-devel
先安装nginx-rtmp-module
cd /var/www/setup/nginx-rtmp-module
cd /usr/local
mkdir nginx-rtmp-module
cd /usr/local/nginx-rtmp-module
git clone https://github.com/arut/nginx-rtmp-module.git
wget http://nginx.org/download/nginx-1.21.6.tar.gz
tar zxvf nginx-1.21.6.tar.gz
cd nginx-1.21.6/
#./configure –prefix=/usr/local/nginx –add-module=/usr/local/nginx-rtmp-module
#./configure –prefix=/usr/local/nginx –with-http_ssl_module –add-module=/usr/local/nginx-rtmp-module
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --pid-path=/var/runtime/nginx/nginx.pid --lock-path=/var/runtime/nginx/nginx.lock --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --with-debug --with-http_dav_module --with-http_flv_module --with-http_ssl_module --with-http_xslt_module --with-http_realip_module --with-http_addition_module --with-http_stub_status_module --with-http_sub_module --with-http_random_index_module --with-http_degradation_module --with-http_secure_link_module --with-file-aio --with-mail --with-mail_ssl_module --with-http_gzip_static_module --with-zlib=zlib-1.2.11 --with-ld-opt=-Wl,-E --http-scgi-temp-path=/var/runtime/nginx/temp_scgi --http-uwsgi-temp-path=/var/runtime/nginx/temp_uwsgi --http-proxy-temp-path=/var/runtime/nginx/temp_proxy --http-fastcgi-temp-path=/var/runtime/nginx/temp_fastcgi --http-client-body-temp-path=/var/runtime/nginx/temp_client_body --add-module=/usr/local/nginx-rtmp-module
make
make install
cd /usr/local/nginx/
./sbin/nginx
ln /usr/local/nginx/sbin/nginx /sbin/nginx
/usr/local/niginx/sbin/nginx # 启动
/usr/local/niginx/sbin/nginx -s reload # 重载
/usr/local/niginx/sbin/nginx -s stop # 关闭
/usr/local/niginx/sbin/nginx -s quit # 关闭(当请求被处理完成之后才关闭)