Install Janus 1.x on Centos 7 guide

Based on my post asking for a build error, and with the guidelines from Lorenzo, I finally can build and install on an old Centos 7 OS.

Dependencies

First you need to get and build meson and ninja build. Here are some references:

Then get devtoolset 7 o higher, and switch to it.

Then do:

yum remove libsrtp-devel libnice-devel

yum install gnutls-devel jansson-devel \
   openssl-devel glib2-devel libcurl-devel \
   opus-devel libogg-devel libcurl-devel pkgconfig \
   libconfig-devel libtool autoconf automake libwebsockets-devel

After this step, all sources listed follow are download under /opt directory.

git clone https://gitlab.freedesktop.org/libnice/libnice
cd libnice
meson --prefix=/usr build && ninja -C build && sudo ninja -C build install
wget https://github.com/cisco/libsrtp/archive/v2.4.2.tar.gz
tar xfv v2.4.2.tar.gz
cd libsrtp-2.4.2
./configure --prefix=/usr --enable-openssl --libdir=/usr/lib64
make shared_library && sudo make install
wget https://duktape.org/duktape-2.7.0.tar.xz
tar xvfJ duktape-2.7.0.tar.xz
cd duktape
sed -i 's/-Os/-O2/' Makefile.sharedlibrary
make -f Makefile.sharedlibrary INSTALL_PREFIX=/usr LIBDIR=/lib64
make -f Makefile.sharedlibrary INSTALL_PREFIX=/usr LIBDIR=/lib64 install
git clone https://github.com/sctplab/usrsctp
cd usrsctp
./bootstrap
./configure --prefix=/usr --disable-programs --disable-inet --disable-inet6 --libdir=/usr/lib64
make && sudo make install
wget https://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-latest.tar.gz
tar xzf libmicrohttpd-latest.tar.gz
cd libmicrohttpd-1.0.2
./configure --prefix=/usr --libdir=/usr/lib64
make
make install
git clone https://github.com/freeswitch/sofia-sip.git
cd sofia-sip
./autogen.sh
./configure --prefix=/usr --enable-64 --libdir=/usr/lib64
make
make install

BoringSSL is need it because Janus can’t build with Centos 7 OpenSSL (1.0.2k), and I can’t test if build against a newer OpenSSL (as below describe for libwebsockets)

git clone https://boringssl.googlesource.com/boringssl
cd boringssl
# Don't barf on errors
sed -i s/" -Werror"//g CMakeLists.txt
sed -i s/"cmake_minimum_required(VERSION 3.22)"/"cmake_minimum_required(VERSION 3.17)"/g CMakeLists.txt
# Build
mkdir -p build
cd build
cmake3 -DCMAKE_INSTALL_PREFIX=/opt/boringssl -DCMAKE_CXX_FLAGS="-lrt" ..
make
make install
cp /opt/boringssl/lib64/*.a /opt/boringssl/lib

This installs an updates version of OpenSSL (1.1.1w) without affecting the current one comes with Centos 7 (1.0.2k). It is need it for libwebsockets because I can´t build with BoringSSL because I get errors.

wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz
tar xzf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
./config --prefix=/opt/openssl --openssldir=/opt/openssl/etc/ssl --libdir=lib64 no-shared zlib-dynamic
make
make test
make install
git clone https://github.com/warmcat/libwebsockets.git
cd libwebsockets
git checkout v4.3-stable
mkdir build
cd build
export OPENSSL_ROOT_DIR=/opt/openssl
cmake3 -DLWS_MAX_SMP=1 -DLWS_WITHOUT_EXTENSIONS=0 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" -DOPENSSL_LIBRARIES="/opt/openssl/lib64/libssl.a;/opt/openssl/lib64/libcrypto.a" -DLWS_OPENSSL_INCLUDE_DIRS=/opt/openssl/include/openssl -DLWS_WITH_HTTP2=1 ..
make
make install

Janus Build

git clone https://github.com/meetecho/janus-gateway.git
cd janus-gateway
sh autogen.sh
./configure --prefix=/usr --enable-libsrtp2 --enable-json-logger --enable-plugin-duktape --enable-plugin-lua --enable-javascript-es-module --enable-javascript-common-js-module --enable-boringssl --enable-dtls-settimeout
make CCLD=c++
make CCLD=c++ install
make configs

That’s all. I hope this help you if you have an old OS.

Thanks Lorenzo for your help and Janus!

2 Likes

Because I can’t edit the post, here is a little fix about libwebsockets libdir. Use this:

git clone https://github.com/warmcat/libwebsockets.git
cd libwebsockets
git checkout v4.3-stable
mkdir build
cd build
export OPENSSL_ROOT_DIR=/opt/openssl
cmake3 -DLWS_MAX_SMP=1 -DLWS_WITHOUT_EXTENSIONS=0 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DLWS_INSTALL_LIB_DIR=/usr/lib64 -DCMAKE_C_FLAGS=“-fpic” -DOPENSSL_LIBRARIES=“/opt/openssl/lib64/libssl.a;/opt/openssl/lib64/libcrypto.a” -DLWS_OPENSSL_INCLUDE_DIRS=/opt/openssl/include/openssl -DLWS_WITH_HTTP2=1 ..
make
make install
1 Like

You should be able to edit the post, clicking the three dots at the bottom of it. There’s a pencil icon that’s meant to do that. Not sure if it only appears to me as one of the managers of the group, though.

Only admins can edit forever, but normal user can within a few hours. Thanks anyway!

1 Like