|
@@ -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
|