인프라(infra)

ubuntu 18.04 + Janus Gateway 설치

주피터0410 2023. 6. 30. 10:19
apt-get install git libmicrohttpd-dev libjansson-dev libssl-dev \
  libsofia-sip-ua-dev libglib2.0-dev libopus-dev \
  libogg-dev libcurl4-openssl-dev liblua5.3-dev libconfig-dev \
  pkg-config gengetopt libtool automake gtk-doc-tools

 

별도설치

apt-get install netplan resolvconf vsftpd


** resolv.conf 설치 및 수정

vi /etc/resolv.conf
nameserver 8.8.8.8 수정
cd /etc/resolvconf/resolv.conf.d

# 추가
nameserver 8.8.8.8
systemctl start resolvconf
cat /etc/resolv.conf
# 위와 같이 삭제한 nameserver 8.8.8.8이 다시 나타나면 정상으로 판단


** vsftpd 설정

vi /etc/vsftpd.conf 

 #추가
allow_writeable_chroot=YES

# vsftp 재시작
systemctl restart vsftpd

# vsftp 상태 확인
systemctl status vsftpd


*** cmake 3.17이상 설치
출처 : https://velog.io/@bbirong/Ubuntu-18.04%EC%97%90-CMake-%EC%84%A4%EC%B9%98

wget https://github.com/Kitware/CMake/releases/download/v3.27.0-rc3/cmake-3.27.0-rc3.tar.gz
cd cmake-3.27.0-rc3
apt install qt5-default
apt-get install build-essential
./bootstrap
make
make install
vi ~/.bashrc

# 추가
PATH=$PATH:/usr/local/bin/ 

# 적용
source ~/.bashrc

# 버전 확인
cmake --version


*** Python3 최신 버전 설치하기
출처 : https://rottk.tistory.com/entry/Ubuntu-Python3-%EC%B5%9C%EC%8B%A0-%EB%B2%84%EC%A0%84-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0

wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
tar -xvzf Python-3.9.9.tgz
cd Python-3.9.9
./configure
make altinstall

# 버전 확인
python3.9 --version



*** meson 설치
출처 : https://suryanshpradhan.wordpress.com/2020/01/04/how-to-fix-meson-build-error-unknown-type-feature-on-ubuntu-18-04/
출처 : https://z-wony.tistory.com/14

meson 설치가 매우 까다롭습니다.

apt install meson 으로 설치할경우 에러가 발생

pip3 install meson


*** ninja 설치

apt install ninja-build


*** libnice 설치
libnice를 빌드하려면 Python 3, Meson 및 Ninja가 필요합니다.

git clone https://gitlab.freedesktop.org/libnice/libnice
cd libnice
meson --prefix=/usr build && ninja -C build && sudo ninja -C build install


** libsrtp 설치

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


** usrsctp 설치

git clone https://github.com/sctplab/usrsctp
cd usrsctp
./bootstrap
./configure --prefix=/usr && make && sudo make install



** libwebsockets 설치

git clone https://github.com/warmcat/libwebsockets.git
cd libwebsockets
# If you want to use the latest master version of libwebsockets, comment 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


** MQTT 설치

git clone https://github.com/eclipse/paho.mqtt.c.git
cd paho.mqtt.c
sudo prefix=/usr make install


** NanoMSG 설치

sudo apt-get update
sudo apt-get install libnanomsg-dev


** rabbitmq-c (RabbitMQ C AMQP) 설치

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


** Compiling the Janus Gateway 설치

git clone https://github.com/meetecho/janus-gateway.git
cd janus-gateway
sh autogen.sh
./configure --prefix=/opt/janus
./configure --enable-rabbitmq --enable-mqtt
make
make install
make configs  # 기본설정파일 생성


** 야누스 테스트
https://ourcodeworld.com/articles/read/1263/how-to-configure-the-janus-webrtc-server-as-a-service-with-systemd-in-ubuntu-18-04

** ubuntu localhost ssl 인증서 만들기
출처 : https://all-record.tistory.com/189

** ufw 설치

pip3 install https://launchpad.net/ufw/0.36/0.36/+download/ufw-0.36.tar.gz


** 방화벽/포트 허용

ufw allow 21
ufw allow 443/tcp
ufw allow 8089
ufw allow 8088
ufw allow 7889
ufw allow 8188
ufw allow 8557

# 방화벽 상태 확인
ufw status

# 방화벽(ufw) 재시작
systemctl enable ufw.service

# 포트 확인
netstat -lntp

 

** 아파치 재시작
/etc/init.d/apache2 restart

** 기타 janus 설정 및 관리

# janus 설정 화일
vi /opt/janus/etc/janus/janus.plugin.streaming.jcfg

# janus help
/opt/janus/bin/janus --help

# Janus 서버 시작
/opt/janus/bin/janus

# Janus 로그
cd /opt/janus/log
tail -f janus.log
# 또는
tail -f /opt/janus/log/janus.log


# stun 서버 설정
/opt/janus/bin/janus -F /opt/janus/etc/janus -S stun.l.google.com:19302 -b


** 리눅스 재부팅후 네트워크가 안 잡히는 현상이 발생

 https://velog.io/@makengi/Ubuntu-%EB%84%A4%ED%8A%B8%EC%9B%8C%ED%81%AC-%EC%84%A4%EC%A0%95%EC%9D%B4-%EC%82%AC%EB%9D%BC%EC%A1%8C%EC%9D%84%EB%95%8C-%EC%84%A4%EC%A0%952023-06-29

# ifconfig up 커맨드로 수동으로 아이피 할당
ifconfig enp2s0 192.168.0.5 netmask 255.255.255.0 up 

# 라우팅 테이블 추가
# 전부 사라져 있기 때문에 디폴트 게이트웨이 로만 추가해줘도 충분 (본인 네트워크에 맞춰 게이트웨이를 추가해주세요)
route add default gw 192.168.0.1 enp2s0

vi /etc/resolv.conf

# 추가
nameserver 8.8.8.8

'인프라(infra)' 카테고리의 다른 글

xampp 기본설정  (0) 2023.04.12
git username / password 저장  (0) 2023.03.30
Git Runners 등록  (0) 2023.03.30
ssh-copy-id 키 복사후 비밀번호 없이 접속  (0) 2023.03.30