纵有疾风起
人生不言弃

ubuntu16.04 一键安装nginx-rtmp

给nginx加rtmp协议,网上写的都是重新编译安装,这样会比较麻烦,编译的时候会报很多依赖缺失的问题,这个其实是可以通过apt-get一键安装

参考:https://blog.csdn.net/kangear/article/details/83019640

sudo apt-get install software-properties-common python-software-propertiessudo add-apt-repository ppa:nginx/stablesudo apt-get updatesudo apt-get install nginx

然后安装rtmp

sudo apt-get install libnginx-mod-rtmp

ubuntu16.04 一键安装nginx-rtmp插图

 centos7.x系列在编译安装过程中可能有n多个报错。。按照网上的方法。忽略报错即可,最后可能就是没法用systemctl命令去启动服务,这时只需要自己手动添加就好:

vim /usr/lib/systemd/system/nginx.service  # 内容一般都是默认的

[Unit]Description=nginx - high performance web serverDocumentation=http://nginx.org/en/docs/After=network.target remote-fs.target nss-lookup.target[Service]Type=forkingPIDFile=/usr/local/nginx/logs/nginx.pidExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.confExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.confExecReload=/bin/kill -s HUP $MAINPIDExecStop=/bin/kill -s QUIT $MAINPIDPrivateTmp=true[Install]WantedBy=multi-user.target

此时就可以使用:systemctl status/stop/start/restart nginx等命令进行相关操作

文章转载于:https://www.cnblogs.com/52-qq/p/11812815.html

原著是一个有趣的人,若有侵权,请通知删除

未经允许不得转载:起风网 » ubuntu16.04 一键安装nginx-rtmp
分享到: 生成海报

评论 抢沙发

评论前必须登录!

立即登录