jitsi / jitsi-meet

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
https://jitsi.org/meet
Apache License 2.0
23.3k stars 6.76k forks source link

Out-of-the-box Jitsi-meet can not operate when installed to webserver sub-directory #6914

Closed dvdkhlng closed 4 years ago

dvdkhlng commented 4 years ago

Description:

I installed jitsi-meet on an existing webserver that has an existing domain-name and SSL certificate. As such I didn't want to increase my webserver's configuration's complexity by adding another SSL certificate and subdomains with SNI or attempting to get a wildcard-certificate.

I thus attempted installing jitsi-meet into a webserver sub-directory. Looking at #2422, #4917, #381 there seemed to be no final answer yet whether that is "officially" supported and how to fully configure it.

I found out, that indeed two source-files outside /etc need modification, which points to subdirectory installation either not being supported, or bugs being present WRT it:

/usr/share/jitsi-meet/base.html : content had to be replaced with

    <base href="/jitsi-meet/" />

/usr/share/jitsi-meet/index.html : a few absolute-path server-side javascript-references had to be modified

    <script><!--#include virtual="/jitsi-meet/config.js" --></script>
    <script><!--#include virtual="/jitsi-meet/interface_config.js" --></script>
    <script><!--#include virtual="/jitsi-meet/logging_config.js" --></script>

Other than that just modifying the configuration was sufficient to make this setup work: /etc/jitsi/meet/[domain]-config.js :

   bosh: '//<domain>/jitsi-meet/http-bind',

For reference, this is the (slightly stripped down) copy of the apache2 configuration file for jitsi-meet installed to subdirectory //jitsi-meet/. With this configuration, jitsi-meet indeed appears to run flawlessly.

## Derived from auto-generated site-config files as follows:
## - Deleted Virtual Server
## - replaced DocumentRoot with Alias
## - prefixed existing Alias and Location commands with /jitsi-meet
## - Moved proxypass into a new <Location> block
## - Moved RewriteEngine into the <Directory> block.
## - change "bosh" in the jitsi -config.js to point to the corret http-bind 

## Other hacks for jitsi-meet in subdir:
## - modify base.html
## - modify index.html to fix all the "include virtual" statements that go
##   directory to the root dir.

Alias "/jitsi-meet/config.js" "/etc/jitsi/meet/<domain>-config.js"
Alias "/jitsi-meet/external_api.js" "/usr/share/jitsi-meet/libs/external_api.min.js"
Alias "/jitsi-meet" "/usr/share/jitsi-meet"

<Directory "/usr/share/jitsi-meet">
    Options Indexes MultiViews Includes FollowSymLinks
    AddOutputFilter Includes html
    AllowOverride All
    Order allow,deny
    Allow from all

    RewriteEngine on
    RewriteBase "/jitsi-meet/"
    RewriteRule "^([a-zA-Z0-9]+)$" "index.html"
</Directory>

<Location /jitsi-meet/config.js>
   Require all granted
</Location>

<Location /jitsi-meet/external_api.js>
  Require all granted
</Location>

<Location /jitsi-meet/http-bind>
    ProxyPreserveHost on
    ProxyPass "http://localhost:5280/http-bind/"
    ProxyPassReverse "http://localhost:5280/http-bind/"
    Require all granted
</Location>

Jitsi-meet-web .deb package version: 1.0.4127-1 OS: Debian 9.12 (stretch) amd64 apache2 package version: 2.4.25-3+deb9u

JurjenBokma commented 4 years ago

This works. Thx! At first we messed up because our Directory directive mentioned /var/www/jitsi, while that was a symbolic link to /usr/share/jitsi. So it should have mentioned /usr/share/jitsi itself. Also, the jitsi installation scripts seem to have attempted to edit our Apache config. We had to fix that.

saghul commented 4 years ago

Glad you got it working!

This is not the typical setup, so while the stock Debian install will need manual adjustments, this setup is supported in the sense that if there are bugs with it we should fix them.

Adding the steps you followed to the handbook would be nice, if you are up for writing a PR.

ilfrick commented 4 years ago

Description:

I installed jitsi-meet on an existing webserver that has an existing domain-name and SSL certificate. As such I didn't want to increase my webserver's configuration's complexity by adding another SSL certificate and subdomains with SNI or attempting to get a wildcard-certificate.

I thus attempted installing jitsi-meet into a webserver sub-directory. Looking at #2422, #4917, #381 there seemed to be no final answer yet whether that is "officially" supported and how to fully configure it.

I found out, that indeed two source-files outside /etc need modification, which points to subdirectory installation either not being supported, or bugs being present WRT it:

/usr/share/jitsi-meet/base.html : content had to be replaced with

    <base href="/jitsi-meet/" />

/usr/share/jitsi-meet/index.html : a few absolute-path server-side javascript-references had to be modified

    <script><!--#include virtual="/jitsi-meet/config.js" --></script>
    <script><!--#include virtual="/jitsi-meet/interface_config.js" --></script>
    <script><!--#include virtual="/jitsi-meet/logging_config.js" --></script>

Other than that just modifying the configuration was sufficient to make this setup work: /etc/jitsi/meet/[domain]-config.js :

   bosh: '//<domain>/jitsi-meet/http-bind',

For reference, this is the (slightly stripped down) copy of the apache2 configuration file for jitsi-meet installed to subdirectory //jitsi-meet/. With this configuration, jitsi-meet indeed appears to run flawlessly.

## Derived from auto-generated site-config files as follows:
## - Deleted Virtual Server
## - replaced DocumentRoot with Alias
## - prefixed existing Alias and Location commands with /jitsi-meet
## - Moved proxypass into a new <Location> block
## - Moved RewriteEngine into the <Directory> block.
## - change "bosh" in the jitsi -config.js to point to the corret http-bind 

## Other hacks for jitsi-meet in subdir:
## - modify base.html
## - modify index.html to fix all the "include virtual" statements that go
##   directory to the root dir.

Alias "/jitsi-meet/config.js" "/etc/jitsi/meet/<domain>-config.js"
Alias "/jitsi-meet/external_api.js" "/usr/share/jitsi-meet/libs/external_api.min.js"
Alias "/jitsi-meet" "/usr/share/jitsi-meet"

<Directory "/usr/share/jitsi-meet">
    Options Indexes MultiViews Includes FollowSymLinks
    AddOutputFilter Includes html
    AllowOverride All
    Order allow,deny
    Allow from all

    RewriteEngine on
    RewriteBase "/jitsi-meet/"
    RewriteRule "^([a-zA-Z0-9]+)$" "index.html"
</Directory>

<Location /jitsi-meet/config.js>
   Require all granted
</Location>

<Location /jitsi-meet/external_api.js>
  Require all granted
</Location>

<Location /jitsi-meet/http-bind>
    ProxyPreserveHost on
    ProxyPass "http://localhost:5280/http-bind/"
    ProxyPassReverse "http://localhost:5280/http-bind/"
    Require all granted
</Location>

Jitsi-meet-web .deb package version: 1.0.4127-1 OS: Debian 9.12 (stretch) amd64 apache2 package version: 2.4.25-3+deb9u

@dvdkhlng thanks, I've been trying to achieve this for a long time. One clarification: is the "apache2 configuration file" you pasted is one of the conf files located in /etc/apache2/sites-enabled? Must it be the default one? If not, how does it relate to the default one? Thanks again.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

briveira commented 1 year ago

Really? Cant believe this. NO WEBAPP should be designed forced to be at root path. This is a no brainer :(

saghul commented 1 year ago

Sure, are you willing to send patches?

juntong20XX commented 1 week ago

Is it still works in 2024? I want try this…