Ubuntu 16.04 에서 STUN/TURN 서버 설치

리눅스/Network|2018. 10. 4. 08:29
반응형

STUN 은 두 peer 간 연결만 도와주므로 서버의 부담이 적고,

TURN 은 STUN 으로 연결되지 못하는 경우 데이터 중계역할을 직접 하므로 트래픽 및 부하가 발생합니다.

* 참고

- TURN 서버는 STUN 서버가 처리 못하는것도 직접 중계하여 성공률이 높다 하지만, STUN 서버의 peer 간 연결 성공률도 높습니다. 안되는 경우는 NAT 서비스 상단에 (가정용 공유기 등) 방화벽을 설정해놓은 경우 입니다.

- TURN 서버는 STUN 의 기능도 포함하고 있습니다.




1. Coturn 패키지 설치


# apt-get install coturn

 


2. Coturn 서버 구성 파일 준비


turnserver.conf 파일을 찾습니다. 보통은 /etc/turnserver.conf 에 있습니다.

/etc/turnserver.conf 파일을 사용할 수 없지만 /usr/local/etc/turnserver.conf.default 파일이 있으면 /usr/local/etc 에 복사합니다.


# cp -p usr / local / etc / turnserver.conf.default /usr/local/etc/turnserver.conf


기본적으로 Coturn은 STUN / TURN 서버처럼 작동합니다.

서버를 TURN 전용으로 사용하려면 /usr/local/etc/turnserver.conf 를 열어 아래 옵션을 활성화 합니다. (주석 제거)


no-stun


이 예제에서는 기본 설정을 사용합니다. 즉, Coturn 서버는 STUN / TURN 서버로 작동합니다.



3. Listening IP 설정


Coturn 서버의 IP를 입력합니다.


listening-ip = 10.x.x.x


* relay-ip 옵션이 있다면 마찬가지로 공인IP 를 입력해줍니다.

relay-ip = 10.x.x.x



4. Coturn 접속 계정 설정


Coturn 서버에 액세스하기위한 사용자 이름과 암호를 설정합니다.


기본적으로 Coturn 서버에는 권한 부여 세트가 없으므로 액세스하려면 사용자 이름과 암호를 설정하는 것이 좋습니다.


/usr/local/etc/turnserver.conf 를 열고 아래 옵션을 설정하면 됩니다.


[형식] user = 사용자이름 : 암호


user=testuser:usertest



5. Listening Port 설정


UDP 및 TCP의 기본 리스너 포트는 다음과 같습니다.


listening-port = 3478 

tls-listening-port = 5349


이 포트는 STUN 및 TURN 모두 동일합니다. TURN 은 연결 및 트래픽 릴레이에 기본 포트 범위 49152-65535를 사용합니다.


엄격한 NAT를 사용하기 위해 포트를 80 또는 443으로 변경할 수 있으므로 Coturn 서버의 공식 설명서 ( https://github.com/coturn/coturn/wiki/turnserver) 를 참조하는 것이 좋습니다.


이 예제에서는 기본 포트를 사용합니다.



6. WebRTC를 지원 설정


WebRTC를 지원하도록 구성하려면 Coturn 안내서 및 사용법을 참조하십시오.

 

이 예제에서는 /usr/local/etc/turnserver.conf 파일을 열고 아래 내용 주석해제를 합니다.


verbose

fingerprint

lt-cred-mech

realm=sysdocu.com

 


7. Coturn 서버 실행


# turnserver &


참고로 Coturn 로그 디렉토리는 / var / log, / log /, / var / tmp, / tmp 또는 현재 디렉토리입니다.


Coturn 서버가 이제 가동 될 것입니다.


 

[출처] https://www.nomachine.com/AR07N00894

[번역] 구글번역기

반응형

댓글()

php 7 에서 mysqli 추가시 오류

리눅스/PHP|2018. 7. 15. 07:36
반응형

[설치]

# cd /usr/local/src/php-7.1.2/ext/mysqli

# /usr/local/php/bin/phpize

# ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config

# make

# make install


* 위에서 make 진행시 아래 오류 발생


/usr/local/src/php-7.0.7/ext/mysqli/mysqli_api.c:36:62: fatal error: /usr/local/php/ext/mysqlnd/mysql_float_to_double.h: 그런 파일이나 디렉터리가 없습니다

 


[오류 해결]

#vi mysqli_api.c


아래의 내용을 찾는다


#include "/usr/local/src/php-7.1.2/ext/mysqlnd/mysql_float_to_double.h"    // 파란색 부분을 추가하여 절대 경로로 만들어준다.


반응형

댓글()

cinder 블록스토리지 상태값 강제 변경

리눅스/OpenStack|2018. 6. 18. 15:17
반응형

VM 연결 해제 상태

cinder reset-state --state available [volume-id]


VM 연결 상태

cinder reset-state --state in-use [volume-id]


반응형

댓글()

provider 네트워크 대역 업데이트 및 추가

리눅스/OpenStack|2018. 6. 12. 07:00
반응형

[업데이트]

# neutron subnet-update provider --allocation-pool start=10.20.202.0,end=10.20.207.254



[추가]

# neutron subnet-create --name provider2 --allocation-pool start=10.20.208.3,end=10.20.208.254  --dns-nameserver 164.124.101.2 --gateway 10.20.208.1 provider 10.20.208.0/24



반응형

댓글()

모든 컴퓨트 노드가 down 으로 보이는 현상

리눅스/OpenStack|2018. 6. 9. 03:57
반응형

컨트롤러 서버에서 netstat -nltp 를 하면 beam.smp 과 같은 데몬이 떠 있어야 하는데, 없는 경우는

아래 명령으로 해결이 가능하다.

컴퓨트 노드의 down 상태가 순차적으로 up 으로 변경 된다.


# service rabbitmq-server restart


반응형

댓글()

novnc 콘솔 페이지 ssl 파일 갱신시

리눅스/OpenStack|2018. 6. 5. 09:06
반응형

1. 컨트롤러 서버의 /etc/nova/ssl 디렉토리에 인증서를 넣어놓기만 하면 됩니다. (데몬 재시작 할 필요 없음)


2. 파일명이 변경될 경우 /etc/nova/nova.conf 파일의 [DEFAULT] 섹션에 아래 옵션을 수정해주세요.

ssl_only = True

cert = /etc/nova/ssl/cert1.pem

key = /etc/nova/ssl/privkey1.pem



반응형

댓글()

VM 파티션 크기 재할당하기

리눅스/OpenStack|2018. 6. 4. 13:59
반응형

[root@sysdocu ~]# fdisk -l


Disk /dev/vda: 134.2 GB, 134217728000 bytes

139 heads, 8 sectors/track, 235741 cylinders

Units = cylinders of 1112 * 512 = 569344 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000594e0


   Device Boot      Start         End      Blocks   Id  System

/dev/vda1               2       47149    26213376   83  Linux

[root@sysdocu ~]# df -Th

Filesystem     Type   Size  Used Avail Use% Mounted on

/dev/vda1      ext4    25G  2.7G   21G  12% /

tmpfs          tmpfs  3.9G   88K  3.9G   1% /dev/shm

[root@sysdocu ~]# fdisk -u /dev/vda


WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

         switch off the mode (command 'c').


Command (m for help): p


Disk /dev/vda: 134.2 GB, 134217728000 bytes

139 heads, 8 sectors/track, 235741 cylinders, total 262144000 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000594e0


   Device Boot      Start         End      Blocks   Id  System

/dev/vda1            2048    52428799    26213376   83  Linux


Command (m for help): d

Selected partition 1


Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First sector (8-262143999, default 8): 2048    // ★ 중요 : 시작을 2048로 해야 합니다.

Last sector, +sectors or +size{K,M,G} (2048-262143999, default 262143999): 

Using default value 262143999


Command (m for help): p


Disk /dev/vda: 134.2 GB, 134217728000 bytes

139 heads, 8 sectors/track, 235741 cylinders, total 262144000 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000594e0


   Device Boot      Start         End      Blocks   Id  System

/dev/vda1            2048   262143999   131070976   83  Linux


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.


WARNING: Re-reading the partition table failed with error 16: 장치나 자원이 동작 중.

The kernel still uses the old table. The new table will be used at

the next reboot or after you run partprobe(8) or kpartx(8)

Syncing disks.

[root@sysdocu ~]# reboot





반응형

댓글()

CentOS 7 에서 FFMpeg 설치하기

리눅스/OS 일반|2018. 5. 30. 12:49
반응형

First install the epel-release

yum -y install epel-release

Install the nux repository

rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

Install ffmpeg and ffmpeg -devel packages

yum install ffmpeg ffmpeg-devel -y

Make sure it works:

# ffmpeg -version
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100

That is it for installing with a repository.



[출처] https://linuxadmin.io/install-ffmpeg-on-centos-7/


반응형

댓글()

원하는 커널 버전 yum 으로 설치하기

리눅스/OS 일반|2018. 5. 29. 14:10
반응형

명령을 실행해 설치 가능한 커널 리스트를 확인합니다.


# yum list --showduplicates kernel



원하는 버전의 커널을 설치합니다.


# yum install kernel-2.6.32-696.28.1.el6




반응형

댓글()

mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': Unknown system variable 'OPTION' (1193)

리눅스/MySQL|2018. 5. 18. 08:32
반응형

mariadb-10.0.14-linux-x86_64 버젼에서 이중화를 위해 덤프를 수행하자 아래와 같은 에러가 난다. 

 

[maria@db1 work]$ mysqldump -uroot -proot --socket=/maria/maria_tmp/mysql.sock --opt --single_transaction --master-data=2 --routines --all-databases -r dump.sql --hex-blob --triggers

mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': Unknown system variable 'OPTION' (1193)


뭔 뜻인지는 알겠는데 왜 이런 에러가 발생할까? 

우선 해당 파라미터를 조회해 보자. 

mysql> show variables like '%QUOTE%';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| sql_quote_show_create | ON    |
+-----------------------+-------+
1 row in set (0.00 sec)

헐.. 'ON' 이라고 되어 있다. 
이를 어쩌나.. 우선 숫자 개념이 완전히 안되는 건가 확인해보자. 

mysql> set sql_quote_show_create=0;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like '%QUOTE%';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| sql_quote_show_create | OFF   |
+-----------------------+-------+
1 row in set (0.00 sec)

mysql> set sql_quote_show_create=1;
Query OK, 0 rows affected (0.00 sec)

이제 보니 option 이란 단어가 들어가면 안된다..ㅠㅠ 아니 tar 파일을 그대로 설치한 거라서 압축 파일 자체가 문제인거 같다. 

mysql> select version();
+---------------------+
| version()           |
+---------------------+
| 10.0.14-MariaDB-log |
+---------------------+
1 row in set (0.00 sec)

블로깅을 해보니 5.6 버젼의 클라이언트를 이용해서 dump를 받아야 한다고 조언한다. 
어떤 글은 바이너리 파일에서 위 옵션을 주석처리하기도 하는데 전 해보니 인식을 할 수 없는 글만 보였다. ㅠㅠ

귀찮다. 젠장. 5.5.x mysqldump를 이용해야 하는데 이건 아닌 거 같다. 걍 5.3. 버젼 써야지..


[출처] https://m.blog.naver.com/PostView.nhn?blogId=freebat&logNo=220210111983&proxyReferer=https%3A%2F%2Fwww.google.co.kr%2F


반응형

댓글()

파티션 UUID 확인

리눅스/OS 일반|2018. 5. 17. 16:51
반응형

# blkid

/dev/sda1: UUID="e99a25e8-bd84-408a-ba27-3ee71c40d4a9" TYPE="ext4" PARTLABEL="primary" PARTUUID="1345a264-f621-46ad-a69a-ddc9010edab0"

/dev/sdb1: UUID="e733e239-875c-4da2-95a2-77508bf4d31a" TYPE="swap" PARTUUID="91e99159-01"

/dev/sdb2: UUID="9436b509-1577-438c-a5a7-48a1b7833021" TYPE="ext4" PARTUUID="91e99159-02"



반응형

댓글()