centos搭建janus服务器

1、借鉴官网https://janus.conf.meetecho.com/docs/README.html

2、可能会碰到

libmicrohttpd-devel 安装失败的情况,这个时候可以直接github下载源代码,编译安装

如果缺少这个库,janus的http与https通信方式就会不支持

3、libnice

git clone https://gitlab.freedesktop.org/libnice/libnice
	cd libnice
	./autogen.sh
	./configure --prefix=/usr
	make && sudo make install

4、libsrtp,2.0.0以上

wget https://github.com/cisco/libsrtp/archive/v2.2.0.tar.gz
	tar xfv v2.2.0.tar.gz
	cd libsrtp-2.2.0
	./configure --prefix=/usr --enable-openssl
	make shared_library && sudo make install

5、libwebsocket

git clone https://libwebsockets.org/repo/libwebsockets
	cd libwebsockets
	# If you want the stable version of libwebsockets, uncomment the next line
	# git checkout v2.4-stable
	mkdir build
	cd build
	# See https://github.com/meetecho/janus-gateway/issues/732 re: LWS_MAX_SMP
	cmake -DLWS_MAX_SMP=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" ..
	make && sudo make install

6、rabbitmq用于外部业务通信

git clone https://github.com/alanxz/rabbitmq-c
	cd rabbitmq-c
	git submodule init
	git submodule update
	mkdir build && cd build
	cmake -DCMAKE_INSTALL_PREFIX=/usr ..
	make && sudo make install

7、janus源码

git clone https://github.com/meetecho/janus-gateway.git
	cd janus-gateway
./configure --enable-websockets  --enable-rest

如果提示找不到libnice,执行

export PKG_CONFIG_PATH=/path/to/libnice/lib/pkgconfig`(libnice的安装路径)

如果提示找不到libsrtp,一样执行对应的方式

export PKG_CONFIG_PATH=/usr/lib/libsrtp/lib/pkgconfig

 

如果提示找不到动态库,执行ldconfig

 

命令执行完后,会显示,支持哪些功能,

make &&make install

make configs,把一些样本配置文件,拷贝为可用的配置文件

 

配置文件配置

janus.transport.websockets.jcfg  websocket的配置文件,主要配置监听端口(app用)

janus.transport.http.jcfg   http与https的配置文件,主要配置对应的端口(浏览器用)

8、搭建nginx

出现的各种问题,可以参考这个链接(主要涉及到静态资源访问和nginx反向代理)

https://blog.csdn.net/cgs1999/article/details/89881733

 

9.然后浏览器通过http与https访问服务了,注意谷歌浏览器必须要https访问才能调用媒体设备

  android的app通过websocket访问服务。

 

10、如果是局域网,环境就可以了,,如果是公网环境,并且有nat的情况,必须搭建stun与turn服务器,来ice打洞

参考https://blog.csdn.net/cgs1999/article/details/89882164

 

 

参考资料

https://www.jianshu.com/p/00a23028006e

https://blog.csdn.net/cgs1999/article/details/89881733

https://blog.csdn.net/cgs1999/article/details/89881401

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章