您的位置:首页 > 运维架构 > Nginx

nginx hls rtmp 环境搭建

2014-02-17 13:47 267 查看


1.准备安装包

nginx:http://nginx.org/download/nginx-1.5.3.tar.gz

nginx-rtmp-module:https://github.com/arut/nginx-rtmp-module/releases,nginx-rtmp-module-1.0.2

pcre:http://vcs.pcre.org/viewvc/code/tags/pcre-8.33/?view=tar
http://vcs.pcre.org/viewvc/code/tags/pcre-8.02/?view=tar
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.tar.gz【前两个安装包,解压后没有configure文件,无法安装】
openssl:http://www.openssl.org/source/openssl-1.0.1e.tar.gz

所有的安装包都解压到/root/nginx/目录:

[root@localhost nginx]# ls /root/nginx/

nginx-1.5.3 nginx-rtmp-module-1.0.2 openssl-1.0.1e pcre-8.21

nginx-1.5.3.tar.gz nginx-rtmp-module-1.0.2.tar.gz openssl-1.0.1e.tar.gz pcre-8.21.tar.gz

2.安装

第一步:解压openssl到openssl-8.33,config && make && make install,安装好openssl

第二步:tar -zxvf pcre-8.21.tar.gz , cd pcre-8.21 , ./configure && make && make install , 安装成功。

第三步:在/etc/ld.so.conf中加入:/usr/local/lib,然后运行sudo /sbin/ldconfig -v

第四步:编译nginx:./configure --prefix=/usr/local/nginx --with-pcre=/root/nginx/pcre-8.21 --with-openssl=/root/nginx/openssl-1.0.1e/
--with-http_stub_status_module --without-http_gzip_module --with-http_ssl_module --add-module=../nginx-rtmp-module-1.0.2

make && make install 。 安装完毕。可以看到产生了/usr/local/nginx/目录。
http://www.nginx.cn/install可以参考。
3.启停与配置

启动:/usr/local/nginx/sbin/nginx

停止:/usr/local/nginx/sbin/nginx -s quit

配置文件:/usr/local/nginx/conf/nginx.conf

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: