Переглянути джерело

Configures to use apache when this is the available web server.

j8
damencho 8 роки тому
джерело
коміт
e51f791ab0

+ 28
- 2
debian/jitsi-meet-web-config.postinst Переглянути файл

@@ -192,8 +192,34 @@ case "$1" in
192 192
 
193 193
             invoke-rc.d nginx reload
194 194
         elif [[ "$FORCE_APACHE" = "true" && ( -z "$JVB_HOSTNAME_OLD" || "$RECONFIGURING" = "true" ) ]] ; then
195
-            echo "Apache2 server is installed, automatic configuration is not supported at this time."
196
-            echo "You need to configure yourselve the virtual host for your domain."
195
+            # this is a reconfigure, lets just delete old links
196
+            if [ "$RECONFIGURING" = "true" ] ; then
197
+                a2dissite $JVB_HOSTNAME_OLD.conf
198
+                rm -f /etc/jitsi/meet/$JVB_HOSTNAME_OLD-config.js
199
+            fi
200
+
201
+            # apache2 config
202
+            if [ ! -f /etc/apache2/sites-available/$JVB_HOSTNAME.conf ] ; then
203
+                # when creating new config, make sure all needed modules are enabled
204
+                a2enmod rewrite ssl headers proxy_http include
205
+                cp /usr/share/doc/jitsi-meet-web/jitsi-meet.example-apache /etc/apache2/sites-available/$JVB_HOSTNAME.conf
206
+                a2ensite $JVB_HOSTNAME.conf
207
+                sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" /etc/apache2/sites-available/$JVB_HOSTNAME.conf
208
+            fi
209
+
210
+            if [ "$CERT_CHOICE" = "$UPLOADED_CERT_CHOICE" ] ; then
211
+                # replace self-signed certificate paths with user provided ones
212
+                CERT_KEY_ESC=$(echo $CERT_KEY | sed 's/\./\\\./g')
213
+                CERT_KEY_ESC=$(echo $CERT_KEY_ESC | sed 's/\//\\\//g')
214
+                sed -i "s/ssl_certificate_key\ \/etc\/jitsi\/meet\/.*key/ssl_certificate_key\ $CERT_KEY_ESC/g" \
215
+                    /etc/apache2/sites-available/$JVB_HOSTNAME.conf
216
+                CERT_CRT_ESC=$(echo $CERT_CRT | sed 's/\./\\\./g')
217
+                CERT_CRT_ESC=$(echo $CERT_CRT_ESC | sed 's/\//\\\//g')
218
+                sed -i "s/ssl_certificate\ \/etc\/jitsi\/meet\/.*crt/ssl_certificate\ $CERT_CRT_ESC/g" \
219
+                    /etc/apache2/sites-available/$JVB_HOSTNAME.conf
220
+            fi
221
+
222
+            invoke-rc.d apache2 reload
197 223
         fi
198 224
 
199 225
         # and we're done with debconf

+ 5
- 0
debian/jitsi-meet-web-config.postrm Переглянути файл

@@ -27,6 +27,9 @@ case "$1" in
27 27
         if [ -x "/etc/init.d/nginx" ]; then
28 28
             invoke-rc.d nginx reload
29 29
         fi
30
+        if [ -x "/etc/init.d/apache2" ]; then
31
+            invoke-rc.d apache2 reload
32
+        fi
30 33
     ;;
31 34
     purge)
32 35
         db_get jitsi-meet/jvb-hostname
@@ -35,6 +38,8 @@ case "$1" in
35 38
             rm -f /etc/jitsi/meet/$JVB_HOSTNAME-config.js
36 39
             rm -f /etc/nginx/sites-available/$JVB_HOSTNAME.conf
37 40
             rm -f /etc/nginx/sites-enabled/$JVB_HOSTNAME.conf
41
+            rm -f /etc/apache2/sites-available/$JVB_HOSTNAME.conf
42
+            rm -f /etc/apache2/sites-enabled/$JVB_HOSTNAME.conf
38 43
             rm -f /etc/jitsi/videobridge/$JVB_HOSTNAME.jks
39 44
             rm -f /etc/jitsi/videobridge/$JVB_HOSTNAME.p12
40 45
             rm -f /etc/jitsi/meet/$JVB_HOSTNAME.key

+ 1
- 0
debian/jitsi-meet-web.docs Переглянути файл

@@ -1,4 +1,5 @@
1 1
 README.md
2 2
 doc/debian/jitsi-meet/jitsi-meet.example
3
+doc/debian/jitsi-meet/jitsi-meet.example-apache
3 4
 doc/debian/jitsi-meet/README
4 5
 config.js

+ 43
- 0
doc/debian/jitsi-meet/jitsi-meet.example-apache Переглянути файл

@@ -0,0 +1,43 @@
1
+
2
+<VirtualHost *:80>
3
+    ServerName jitsi-meet.example.com
4
+    Redirect permanent / https://jitsi-meet.example.com/
5
+    RewriteEngine On
6
+    RewriteCond %{HTTPS} off
7
+    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
8
+</VirtualHost>
9
+
10
+<VirtualHost *:443>
11
+
12
+  ServerName jitsi-meet.example.com
13
+
14
+  SSLProtocol TLSv1 TLSv1.1 TLSv1.2
15
+  SSLEngine on
16
+  SSLProxyEngine on
17
+  SSLCertificateFile /etc/jitsi/meet/jitsi-meet.example.com.crt
18
+  SSLCertificateKeyFile /etc/jitsi/meet/jitsi-meet.example.com.key
19
+  SSLCipherSuite "EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRSA:EECDH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED"
20
+  SSLHonorCipherOrder on
21
+  Header set Strict-Transport-Security "max-age=31536000"
22
+
23
+  DocumentRoot "/usr/share/jitsi-meet"
24
+  <Directory "/usr/share/jitsi-meet">
25
+    Options Indexes MultiViews Includes FollowSymLinks
26
+    AddOutputFilter Includes html
27
+    AllowOverride All
28
+    Order allow,deny
29
+    Allow from all
30
+  </Directory>
31
+
32
+  Alias "/config.js" "/etc/jitsi/meet/jitsi-meet.example.com-config.js"
33
+  <Location /config.js>
34
+    Require all granted
35
+  </Location>
36
+
37
+  ProxyPreserveHost on
38
+  ProxyPass /http-bind http://localhost:5280/http-bind/
39
+  ProxyPassReverse /http-bind http://localhost:5280/http-bind/
40
+
41
+  RewriteEngine on
42
+  RewriteRule ^/([a-zA-Z0-9]+)$ /index.html
43
+</VirtualHost>

Завантаження…
Відмінити
Зберегти