-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathinstallCoturn.sh
68 lines (51 loc) · 1.98 KB
/
installCoturn.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Update package repositories
sudo apt-get -y update
# Install Coturn server
sudo apt-get install coturn -y
# Stop Coturn server
sudo service coturn stop
# Enable TURN server by adding configuration in /etc/default/coturn
echo 'TURNSERVER_ENABLED=1' | sudo tee -a /etc/default/coturn
# Backup existing turnserver.conf and create a new one
sudo mv /etc/turnserver.conf /etc/turnserver.conf.bak
sudo touch /etc/turnserver.conf
# Add configuration to the turnserver.conf file
sudo tee /etc/turnserver.conf > /dev/null <<EOF
# Listener IP address of relay server. Multiple listeners can be specified.
# If no IP(s) specified in the config file or in the command line options,
# then all IPv4 and IPv6 system IPs will be used for listening.
listening-ip=0.0.0.0
#listening-ip=10.207.21.238
#listening-ip=2607:f0d0:1002:51::4
min-port=49152
max-port=65535
# Uncomment to run TURN server in 'normal' 'moderate' verbose mode.
# By default the verbose mode is off.
verbose
# Uncomment to use fingerprints in the TURN messages.
# By default the fingerprints are off.
fingerprint
# Uncomment to use long-term credential mechanism.
# By default no credentials mechanism is used (any user allowed).
lt-cred-mech
# 'Static' user accounts are NOT dynamically checked by the turnserver process,
# so that they can NOT be changed while the turnserver is running.
user=user117:passworD@368
#user=username2:key2
# OR:
#user=username1:password1
# Log file location
log-file=/var/log/turn.log
# Option to redirect all log output into system log (syslog).
syslog
# Enable Web-admin support on https. By default it is Disabled.
# If it is enabled it also enables a http a simple static banner page
# with a small reminder that the admin page is available only on https.
web-admin
# Local system IP address to be used for Web-admin server endpoint. Default value is 127.0.0.1.
web-admin-ip=0.0.0.0
# Web-admin server port. Default is 8080.
EOF
# Restart Coturn server to apply the changes
sudo service coturn restart