【问题标题】:Make Jitsi-Meet work with apache on a sub URL让 Jitsi-Meet 在子 URL 上与 apache 一起工作
【发布时间】:2020-04-23 07:42:11
【问题描述】:

我正在尝试通过 suburl "/meet" 让 jitsi-meet 在 apache 服务器上工作,但我只能获得 index.html 视图而无法加载房间。

首先我进行了软件包安装,停止了 nginx 并使用以下参数配置了 apache 虚拟主机:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/meet/[a-zA-Z0-9]+$
RewriteRule ^/meet/(.*)$ /meet/ [PT]
ProxyPreserveHost Off

<Location "/meet/http-bind">
   RequestHeader set Host "mydomain.com"
   ProxyPass http://localhost:5280/http-bind
   ProxyPassReverse http://localhost:5280/http-bind
</Location>

<Location "/meet/xmpp-websocket">
   ProxyPass http://localhost:5280
   ProxyPassReverse http://localhost:5280
</Location>

我找到了这个配置here,Jitsi-meet 的github。我对其进行了修改以重定向本地主机上的所有请求,以避免 DNS 解析。不幸的是它没有工作,所以经过大量测试后,我卸载了所有软件包尝试手动安装,但结果是一样的。

我安装了 jitsi-videobridge 和 jicofo。 Jicofo 不会自动启动,但我设法让它适用于我的测试。我为“meet”提供了著名的“jitsi-meet”目录源,并将其放在我的 apache DocumentRoot 目录中。

由于 Jitsi-meet 是在 NodeJS 中开发的,我想我可以将它作为 http 服务器直接在另一个端口上启动,但我收到了这个错误:

/my_path/meet/app.js:63
$(document).ready(function () {
ReferenceError: document is not defined
  at Object.<anonymous> (/my_path/meet/app.js:63:3)
  at Module._compile (module.js:456:26)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:906:3

Jitsi meet 应用无法作为独立服务器启动...

我的最后一个解决方案是在另一个端口上运行 nginx(使用 jitsi 的正确默认配置)并在 apache 上创建代理以在端口 443 上启用 jitsi。但是 nginx 没有比 apache 更多的功能,所以我认为 apache可以在没有 nginx 的情况下使 jitsi-meet 工作,你不这么认为吗?也许缺少 apache 的模块?

我正在运行带有 apache 2.4.10 的 Debian Jessie 服务器,安装了 NodeJS 0.12 并且禁用了防火墙(这是一个测试服务器)。我启用了 headers、proxy-http、ssl 和 rewrite 模块。

我现在卡住了,我需要帮助才能让它工作。

谢谢

【问题讨论】:

    标签: node.js apache nginx jitsi


    【解决方案1】:

    在本地网络的 Apache 子目录中安装 Jitsi (ubuntu 18.04)

    假设 1) DocumentRoot 是 /var/www/html 2) 将 Jitsi 安装在 /var/www/html/meet 和 3) 服务器的本地 IP 地址是 192.168.2.24

    1.使用 Basic Jitsi Meet install (https://github.com/jitsi/jitsi-meet/blob/master/doc/quick-install.md) 安装 jitsi

    从上面如何"

    添加 Jitsi 包存储库

    echo 'deb https://download.jitsi.org stable/' >> /etc/apt/sources.list.d/jitsi-stable.list
    wget -qO -  https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add -
    

    在防火墙中打开端口
    在防火墙中打开以下端口,以允许流量到运行 jitsi 的机器:

    • 80 TCP
    • 443 TCP
    • 10000 UDP

    安装 Jitsi Meet

    注意:安装程序将检查 Nginx 或 Apache 是否存在(按此顺序)并在它找到的 Web 服务器中配置一个虚拟主机来服务 Jitsi Meet。如果以上都找不到,则默认为 Nginx。如果您已经在同一台机器上的 443 端口上运行 Nginx,则将跳过 turnserver 配置,因为它会与您当前的 443 端口冲突。

    # Ensure support is available for apt repositories served via HTTPS
    apt-get install apt-transport-https
    
    # Retrieve the latest package versions across all repositories
    apt-get update
    
    # Perform jitsi-meet installation
    apt-get -y install jitsi-meet
    

    在安装过程中,系统会要求您输入 Jitsi Meet 实例的主机名。如果您已经在 DNS 中设置了实例的 FQDN,请在此处输入。如果您没有可解析的主机名,您可以输入机器的 IP 地址(如果它是静态的或不变的)。

    此主机名(或 IP 地址)将用于 Jitsi Meet 中的虚拟主机配置,您和您的通讯员也将使用它来访问网络会议。

    "

    1a. 当您要求输入 Jitsi Meet 实例的主机名时,请插入您希望 jitsi 听到的 ip。 (以 192.168.2.24 为例)

    2。建立 jitsi-meet 目录的符号链接。

        sudo ln -s /usr/share/jitsi-meet /var/www/html/meet
    

    如果您的 DocumentRoot 与 /var/www/html 不同,请创建指向您的 DocumentRoot 的符号链接

    3.在/usr/share/jitsi-meet(安装目录)

    3a。在文件 base.html 中更改

      <base href="/" /> to <base href="/meet/" />
    

    3b。在文件 index.html 中更改

      #include virtual="/config.js"  to    #include virtual="config.js"  
      #include virtual="/interface_config.js"  to  #include virtual="interface_config.js"
      #include virtual="/logging_config.js" to #include virtual="logging_config.js"
      ( remove the / in front of them )
    

    4.在 /etc/jitsi/meet 文件中更改 yourip-config.js

      bosh: '//192.168.2.24/http-bind',   to    bosh: '//192.168.2.24/meet/http-bind',
    

    文件看起来像

      /* eslint-disable no-unused-vars, no-var */
    
      var config = {
    // Connection
    //
    
    hosts: {
        // XMPP domain.
        domain: '192.168.2.24',
    
        // When using authentication, domain for guest users.
        //anonymousdomain: 'guest.192.168.2.24',
    
        // Domain for authenticated users. Defaults to <domain>.
        // authdomain: '192.168.2.24',
    
        // Jirecon recording component domain.
        // jirecon: 'jirecon.192.168.2.24',
    
        // Call control component (Jigasi).
        // call_control: 'callcontrol.192.168.2.24',
    
        // Focus component domain. Defaults to focus.<domain>.
        // focus: 'focus.192.168.2.24',
    
        // XMPP MUC domain. FIXME: use XEP-0030 to discover it.
        muc: 'conference.192.168.2.24'
    },
    
    // BOSH URL. FIXME: use XEP-0156 to discover it.
    bosh: '//192.168.2.24/meet/http-bind',
    
    // Websocket URL
    // websocket: 'wss://192.168.2.24/xmpp-websocket',
       ...
    

    5.在 /etc/apache2/sites-available 将 yourip.conf 更改为如下所示

    此配置会将所有流量从端口 80(http) 重定向到端口 443(https)
    更改所有必要的部分以适合您的配置(ip、subdir、DocumentRoot)

      <VirtualHost *:80>
        ServerName 192.168.2.24
        Redirect permanent / https://192.168.2.24/
        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
      </VirtualHost>
    
      <VirtualHost *:443>
    
        ServerName 192.168.2.24
    
        SSLProtocol TLSv1 TLSv1.1 TLSv1.2
        SSLEngine on
        SSLProxyEngine on
        SSLCertificateFile /etc/jitsi/meet/192.168.2.24.crt
        SSLCertificateKeyFile /etc/jitsi/meet/192.168.2.24.key
        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"
         SSLHonorCipherOrder on
         Header set Strict-Transport-Security "max-age=31536000"
    
         DocumentRoot "/var/www/html"
         <Directory "/var/www/html/meet">
           Options Indexes MultiViews Includes FollowSymLinks
           AddOutputFilter Includes html
           AllowOverride All
           Order allow,deny
           Allow from all
         </Directory>
    
         ErrorDocument 404 /static/404.html
    
       Alias "/meet/config.js" "/etc/jitsi/meet/192.168.2.24-config.js"
         <Location /meet/config.js>
           Require all granted
         </Location>
    
         Alias "/meet/external_api.js" "/usr/share/jitsi-meet/libs/external_api.min.js"
         <Location /meet/external_api.js>
           Require all granted
         </Location>
    
       RewriteEngine On
       RewriteCond %{REQUEST_URI} ^/meet/[a-zA-Z0-9]+$
       RewriteRule ^/meet/(.*)$ /meet/ [PT]       
    
       ProxyPreserveHost on
       ProxyPass /meet/http-bind http://localhost:5280/http-bind/
       ProxyPassReverse /meet/http-bind http://localhost:5280/http-bind/
    
     </VirtualHost>
    

    6.提示

    a.如果您安装了 Webmin,请将 Webmin 的端口从 10000 更改为您喜欢的任何值
    b.如果您对 3 个或更多参与者有问题,请查看第 1 步链接的“高级配置”部分

    【讨论】:

    • 运行起来了!谢谢!但是..如何登录?另外,在网络上部署的人,请参阅digitalocean.com/community/tutorials/…
    • 忘记在 apache2 conf 中添加“RewriteEngine”.. 行。它正在工作!谢谢!
    【解决方案2】:

    假设您已经运行 Apache 服务器,根目录为 /var/www,并且您想要添加 Jitsi 视频桥,我设法让它与以下修改一起工作。

    我通过 apt-get 安装了 Jitsi,就像官方主页上描述的那样设置服务器

    我将以下内容添加到我的 Apache 配置/虚拟主机中,假设在 www.example.com/jitsi 下可以使用 Jitsi

    Alias "/jitsi/config.js" "/etc/jitsi/meet/example.com-config.js"
    <Location "/jitsi/config.js">
        Require all granted
    </Location>
    
    Alias "/jitsi/external_api.js" "/usr/share/jitsi-meet/libs/external_api.min.js"
    <Location "/jitsi/external_api.js">
        Require all granted
    </Location>
    
    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/jitsi/[a-zA-Z0-9]+$
    RewriteRule ^/jitsi/(.*)$ /jitsi/ [PT]
    
    ProxyPreserveHost on
    ProxyPass /http-bind http://localhost:5280/http-bind/
    ProxyPassReverse /http-bind http://localhost:5280/http-bind/
    
    Alias "/jitsi" "/usr/share/jitsi-meet"
    <Location "/jitsi">
        Options Indexes Includes MultiViews FollowSymLinks
        AddOutputFilter Includes .html
        AllowOverride All
        Order allow,deny
        Allow from all
    </Location>
    

    此外,您需要在 Jitsi config.js 中添加一条线路才能到达会议室:

    getroomnode: function (path) { return location.pathname.replace('/jitsi/',''); },

    在文件中,我还将子域添加到“域”和“muc”中。

    由于 Jitsi html 页面与 SSI 一起使用,因此需要调整其中的路径。 首先是base.html,它为 HTML 中的所有引用设置了基础:

    &lt;base href="/jitsi/" /&gt;

    此外,在 index.html 文件中,查找 #include virtual="/*.js" 部分。 JavaScript 文件有根,去掉前面的/

    【讨论】:

      【解决方案3】:

      found an apache conf that's work

      NameVirtualHost 127.0.0.1:80
      
      <VirtualHost 127.0.0.1:80>
        DocumentRoot "/Users/lyubomir/Sites/jitmeet"
        ServerName jitmeet.lyubomiinovsair
      
        <Directory "/Users/lyubomir/Sites/jitmeet/">
          Options Indexes MultiViews
          AllowOverride All
          Order allow,deny
          Allow from all
        </Directory>
      
        ProxyPass /http-bind http://127.0.0.1:7070/http-bind/
        ProxyPassReverse /http-bind http://127.0.0.1:7070/http-bind/
      
        RewriteEngine on
        RewriteRule ^/([a-zA-Z0-9]+)$ /index.html
      </VirtualHost>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-01-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-01-01
        • 2018-01-26
        • 2022-07-11
        相关资源
        最近更新 更多