|
@@ -0,0 +1,198 @@
|
|
1
|
+# Server Installation for jitmeet
|
|
2
|
+
|
|
3
|
+## Install prosody and otalk modules
|
|
4
|
+```sh
|
|
5
|
+echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list
|
|
6
|
+wget --no-check-certificate https://prosody.im/files/prosody-debian-packages.key -O- | sudo apt-key add -
|
|
7
|
+apt-get update
|
|
8
|
+apt-get install prosody-trunk
|
|
9
|
+apt-get install git lua-zlib lua-sec-prosody lua-dbi-sqlite3 liblua5.1-bitop-dev liblua5.1-bitop0
|
|
10
|
+git clone https://github.com/andyet/otalk-server.git
|
|
11
|
+cd otalk-server
|
|
12
|
+cp -r mod* /usr/lib/prosody/modules
|
|
13
|
+```
|
|
14
|
+
|
|
15
|
+## Configure prosody
|
|
16
|
+Modify the config file in `/etc/prosody/prosody.cfg.lua`:
|
|
17
|
+- modules to enable/add: compression, bosh, smacks3, smacks2, carbons, mam, lastactivity, offline, pubsub, adhoc, websocket, http_altconnect
|
|
18
|
+- comment out: `c2s_require_encryption = true`, and `s2s_secure_auth = false`
|
|
19
|
+- change `authentication = "internal_hashed"`
|
|
20
|
+- add this:
|
|
21
|
+```
|
|
22
|
+daemonize = true
|
|
23
|
+cross_domain_bosh = true;
|
|
24
|
+storage = {archive2 = "sql2"}
|
|
25
|
+sql = { driver = "SQLite3", database = "prosody.sqlite" }
|
|
26
|
+default_archive_policy = "roster"
|
|
27
|
+```
|
|
28
|
+- configure your domain by editing the example.com virtual host section section:
|
|
29
|
+```
|
|
30
|
+VirtualHost "jitmeet.example.com"
|
|
31
|
+authentication = "anonymous"
|
|
32
|
+ssl = {
|
|
33
|
+ key = "/var/lib/prosody/jitmeet.example.com.key";
|
|
34
|
+ certificate = "/var/lib/prosody/jitmeet.example.com.crt";
|
|
35
|
+}
|
|
36
|
+```
|
|
37
|
+- and finally configure components:
|
|
38
|
+```
|
|
39
|
+Component "conference.jitmeet.example.com" "muc"
|
|
40
|
+Component "jitsi-videobridge.jitmeet.example.com"
|
|
41
|
+ component_secret = "YOURSECRET1"
|
|
42
|
+```
|
|
43
|
+- check the example config file, next to the document (prosody.cfg.lua)
|
|
44
|
+
|
|
45
|
+Generate certs for the domain:
|
|
46
|
+```sh
|
|
47
|
+prosodyctl cert generate jitmeet.example.com
|
|
48
|
+```
|
|
49
|
+
|
|
50
|
+## Install nginx
|
|
51
|
+```sh
|
|
52
|
+apt-get install nginx
|
|
53
|
+```
|
|
54
|
+
|
|
55
|
+Add nginx config for domain in `/etc/nginx/nginx.conf`:
|
|
56
|
+```
|
|
57
|
+tcp_nopush on;
|
|
58
|
+types_hash_max_size 2048;
|
|
59
|
+server_names_hash_bucket_size 64;
|
|
60
|
+```
|
|
61
|
+
|
|
62
|
+Add a new file in /etc/nginx/sites-available (see the jitmeet.example.com file for example)
|
|
63
|
+```
|
|
64
|
+server {
|
|
65
|
+ listen 80;
|
|
66
|
+ server_name jitmeet.example.com;
|
|
67
|
+ # set the root
|
|
68
|
+ root /srv/jitmeet.example.com;
|
|
69
|
+ index index.html;
|
|
70
|
+ location ~ ^/([a-zA-Z0-9]+)$ {
|
|
71
|
+ rewrite ^/(.*)$ / break;
|
|
72
|
+ }
|
|
73
|
+ # BOSH
|
|
74
|
+ location /http-bind {
|
|
75
|
+ proxy_pass http://localhost:5280/http-bind;
|
|
76
|
+ proxy_set_header X-Forwarded-For $remote_addr;
|
|
77
|
+ proxy_set_header Host $http_host;
|
|
78
|
+ }
|
|
79
|
+ # xmpp websockets
|
|
80
|
+ location /xmpp-websocket {
|
|
81
|
+ proxy_pass http://localhost:5280;
|
|
82
|
+ proxy_http_version 1.1;
|
|
83
|
+ proxy_set_header Upgrade $http_upgrade;
|
|
84
|
+ proxy_set_header Connection "upgrade";
|
|
85
|
+ proxy_set_header Host $host;
|
|
86
|
+ tcp_nodelay on;
|
|
87
|
+ }
|
|
88
|
+}
|
|
89
|
+```
|
|
90
|
+
|
|
91
|
+Add link for the added configuration
|
|
92
|
+```sh
|
|
93
|
+cd /etc/nginx/sites-enabled
|
|
94
|
+ln -s ../sites-available/jitmeet.example.com jitmeet.example.com
|
|
95
|
+```
|
|
96
|
+check the example config files, next to the document (nginx.conf and jitmeet.example.com)
|
|
97
|
+
|
|
98
|
+## Fix firewall if needed
|
|
99
|
+```sh
|
|
100
|
+ufw allow 80
|
|
101
|
+ufw allow 5222
|
|
102
|
+```
|
|
103
|
+
|
|
104
|
+## Install videobridge
|
|
105
|
+```sh
|
|
106
|
+wget https://download.jitsi.org/jitsi-videobridge/linux/jitsi-videobridge-linux-{arch-buildnum}.zip
|
|
107
|
+unzip jitsi-videobridge-linux-{arch-buildnum}.zip
|
|
108
|
+```
|
|
109
|
+
|
|
110
|
+Install JRE if missing:
|
|
111
|
+```
|
|
112
|
+apt-get install default-jre
|
|
113
|
+```
|
|
114
|
+
|
|
115
|
+In the user home that will be starting the jitsi video bridge create `.sip-communicator` folder and add the file `sip-communicator.properties` with one line in it:
|
|
116
|
+```
|
|
117
|
+org.jitsi.impl.neomedia.transform.srtp.SRTPCryptoContext.checkReplay=false
|
|
118
|
+```
|
|
119
|
+
|
|
120
|
+Start the videobrdige with:
|
|
121
|
+```sh
|
|
122
|
+./jvb.sh --host=localhost --domain=jitmeet.example.com --port=5347 --secret=YOURSECRET1 &
|
|
123
|
+```
|
|
124
|
+Or autostart it by adding the line in `/etc/rc.local`:
|
|
125
|
+```sh
|
|
126
|
+/bin/bash /root/jitsi-videobridge-linux-x64-74/jvb.sh --host=localhost --domain=jitmeet.example.com --port=5347 --secret=YOURSECRET1 </dev/null >> /var/log/jvb.log 2>&1
|
|
127
|
+```
|
|
128
|
+
|
|
129
|
+Checkout and configure jitmeet:
|
|
130
|
+```sh
|
|
131
|
+cd /srv
|
|
132
|
+git clone https://github.com/jitsi/jitmeet.git
|
|
133
|
+mv jitmeet/ jitmeet.example.com
|
|
134
|
+```
|
|
135
|
+
|
|
136
|
+Edit `/srv/jitmeet.example.com/config.js`:
|
|
137
|
+```
|
|
138
|
+var config = {
|
|
139
|
+ hosts: {
|
|
140
|
+ domain: 'jitmeet.example.com',
|
|
141
|
+ muc: 'conference.jitmeet.example.com',
|
|
142
|
+ bridge: 'jitsi-videobridge.jitmeet.example.com'
|
|
143
|
+ },
|
|
144
|
+ useNicks: false,
|
|
145
|
+ bosh: '//jitmeet.example.com/http-bind' // FIXME: use xep-0156 for that
|
|
146
|
+};
|
|
147
|
+```
|
|
148
|
+check the example config file, next to the document (config.js)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+## Install [Turn server](https://github.com/andyet/otalk-server/tree/master/restund)
|
|
152
|
+```sh
|
|
153
|
+apt-get install make gcc
|
|
154
|
+wget http://creytiv.com/pub/re-0.4.7.tar.gz
|
|
155
|
+tar zxvf re-0.4.7.tar.gz
|
|
156
|
+ln -s re-0.4.7 re
|
|
157
|
+cd re-0.4.7
|
|
158
|
+make install PREFIX=/usr
|
|
159
|
+cd ..
|
|
160
|
+wget http://creytiv.com/pub/restund-0.4.2.tar.gz
|
|
161
|
+wget https://raw.github.com/andyet/otalk-server/master/restund/restund-auth.patch
|
|
162
|
+tar zxvf restund-0.4.2.tar.gz
|
|
163
|
+cd restund-0.4.2/
|
|
164
|
+patch -p1 < ../restund-auth.patch
|
|
165
|
+make install PREFIX=/usr
|
|
166
|
+cp debian/restund.init /etc/init.d/restund
|
|
167
|
+chmod +x /etc/init.d/restund
|
|
168
|
+cd /etc
|
|
169
|
+wget https://raw.github.com/andyet/otalk-server/master/restund/restund.conf
|
|
170
|
+```
|
|
171
|
+
|
|
172
|
+Configure addresses and ports as desired, and the password to be configured in prosody:
|
|
173
|
+```
|
|
174
|
+realm jitmeet.example.com
|
|
175
|
+# share this with your prosody server
|
|
176
|
+auth_shared YOURSECRET2
|
|
177
|
+
|
|
178
|
+# modules
|
|
179
|
+module_path /usr/lib/restund/modules
|
|
180
|
+turn_relay_addr [turn ip address]
|
|
181
|
+```
|
|
182
|
+
|
|
183
|
+Configure prosody to use it in `/etc/prosody/prosody.cfg.lua`. Add to your virtual host:
|
|
184
|
+```
|
|
185
|
+turncredentials_secret = "YOURSECRET2";
|
|
186
|
+turncredentials = {
|
|
187
|
+ { type = "turn", host = "turn.address.ip.configured", port = 80, transport = "tcp" }
|
|
188
|
+}
|
|
189
|
+```
|
|
190
|
+
|
|
191
|
+Reload prosody if needed
|
|
192
|
+```
|
|
193
|
+prosodyctl reload
|
|
194
|
+telnet localhost 5582
|
|
195
|
+module:reload("turncredentials", "jitmeet.example.com")
|
|
196
|
+quit
|
|
197
|
+```
|
|
198
|
+
|