gspohu
gspohu

Reputation: 41

Trying to install jitsi meet with apache2

I know there are already post on this subject, but they don't produce good results and I would like to share, here, my thinking on this subject. Feel free to moderate my post if you think it's a bad idea.

Server: Ubuntu 16.04.1, Apache2.4.18

DNS conf:

Like I said I try to run Jitsi meet on apache2. By following the steps described in Quick install (https://github.com/jitsi/jitsi-meet/blob/master/doc/quick-install.md)

If I install Jitsi meet on my server just after installing Ubuntu so without Apache or Nginx. Jitsi works great. If I install Jitsi meet on my server after installing Nginx. Jitsi works great.

With the same method of installation, I try to install Jitsi meet after installing Apache2, so I notice that Jitsi meet does not configure itself apache2, so I tried this first configuration:

<VirtualHost *:443>
ServerAdmin [email protected]
ServerName  meet.mydomain.xx
ServerAlias  meet.mydomain.xx
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
DocumentRoot "/usr/share/jitsi-meet/"
<Directory /usr/share/jitsi-meet/>
AllowOverride All
</Directory>

ProxyPass / http://meet.mydomain.xx:5280/http-bind
ProxyPassReverse / http://meet.mydomain.xx:5280/http-bind

ProxyPreserveHost Off

<Location "/http-bind">
   Order allow,deny
   Allow from all
</Location>

<Location "/meet/xmpp-websocket">
    ProxyPass http://meet.mydomain.xx:5280
    ProxyPassReverse http://meet.mydomain.xx:5280
</Location>

ErrorLog /var/www/meet/logs/error.log
CustomLog /var/www/meet/logs/access.log combined
SSLCertificateFile /etc/letsencrypt/live/acert.mydomain.xx/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/acert.mydomain.xx/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

When I load the page meet.mydomain.xx I get the following error:

"It works! Now your customer BOSH points to this URL to connect to Prosody.

For more information see Prosody. Setting up BOSH "

But when I look at the /etc/prosody/conf.avail/meet.mydomain.xx.cfg.lua file, I notice that bosh is already enabled and the rest of the configuration is ok with what is explain here https://github.com/jitsi/jitsi-meet/blob/master/doc/manual-install.md The log contains no errors. If you have an idea to fix this problem I'm interested.

Second configuration that I tested:

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName  meet.mydomain.xx
ServerAlias  meet.mydomain.xx
DocumentRoot "/usr/share/jitsi-meet/"

SSLProxyEngine On
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/[a-zA-Z0-9]+$
RewriteRule ^/(.*)$ / [PT]
RewriteRule ^/http-bind$ https://meet.mydomain.xx:5281/http-bind [P,L]

ErrorLog /var/www/meet/logs/error.log
CustomLog /var/www/meet/logs/access.log combined
</Virtualhost>

With this setup the result seems better, I can see the home page of Jitsi meet but without the text, without the logo and when I click on the go button, nothing happend. The log contains no errors.

So here I don't no really what to do. If someone have some advices or ideas, ​​thank you to share it !

Bye, thank you for reading

Gspohu

Upvotes: 1

Views: 5567

Answers (1)

Norbert Poellmann
Norbert Poellmann

Reputation: 56

This works with FreeBSD 12.2-RELEASE, apache24-2.4.46, particularly also with the jitsi client app on Android telephones. I think it will answer your question.

As an additional tweak on our site: for https we use the non-standard port 444 (instead of usual 443).

I followed the very useful instructions of http://www.bobeager.uk/pdf/jitsi.pdf (Thanks for this!), but then, instead of nginx, I use apache, simple because it's running anyway on this server.

The apache config:

loaded modules in httpd.conf
    LoadModule proxy_module libexec/apache24/mod_proxy.so
    LoadModule proxy_connect_module libexec/apache24/mod_proxy_connect.so
    LoadModule proxy_http_module libexec/apache24/mod_proxy_http.so
    

The apache VirtualServer config: Note the /index.html in RewriteRule!

<VirtualHost *:444>
ServerName meet.example.com:444
DocumentRoot "/usr/local/www/jitsi-meet"
ServerAdmin [email protected]
SSLEngine on
SSLProxyEngine on
SSLCertificateFile       "/usr/local/etc/letsencrypt/live/meet.example.com/fullchain.pem"
SSLCertificateKeyFile    "/usr/local/etc/letsencrypt/live/meet.example.com/privkey.pem"
  <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/[a-zA-Z0-9]+$
    RewriteRule ^/([a-zA-Z0-9=?]+)$ /index.html
  </IfModule>

<directory "/usr/local/www/jitsi-meet">
    require all granted
    Options +Includes
    directoryindex index.html
    AddOutputFilter Includes html
        XBitHack on
</directory>

# BOSH
<location "/http-bind">
        proxypass  "http://localhost:5280/http-bind"
        header set host "expr=%{HTTP_HOST}"
</location>

# XMPP websockets
<location "/xmpp-websocket">
        proxypass  "http://localhost:5280/xmpp-websocket"
        header set host  "expr=%{HTTP_HOST}"
        header set x-forwarded-for "expr=%{REMOTE_ADDR}"
</location>
</VirtualHost>

Because of the XBitHack I did:

    chmod +x /usr/local/www/jitsi-meet/*.html

not sure, whether this is necessary; but I think, it does not hurt.

Changes in /usr/local/www/jitsi-meet/config.js

Note: some values are set to domain only, others to domain+port Misconfiguration here may cause javascript CORS errors in browser. Check with firefox crtl-shift-I , console

var domainroot = 'meet.example.com'
var domainuri = domainroot+':444'
var config = {
   hosts: {
        domain: domainroot,
        bridge: 'jitsi-videobridge.'+domainroot,
        focus: 'focus.'+domainroot,
        muc: 'conference.'+domainroot
   },

    // BOSH URL. FIXME: use XEP-0156 to discover it.
    // bosh: '//jitsi-meet.example.com/http-bind',
    bosh: '//'+domainuri+'/http-bind',
 ....

Upvotes: 1

Related Questions