How to set up apache server for collabor online

I want to set up collaborator online (CODE) in my home lab, but I have a problem with the apache server configuration.
This is my situation.
collabora

  • Reverse proxy server Nginx on Debian 10 (192.168.1.105)
  • Nextcloud 23 + Collabora Online on Debian 11 (192.168.1.108)

Nextcloud 23 works very well, I just want to solve Collabora Online.
Install Collabora Online on Debian 11 (192.168.1.108)

sudo apt install apt-transport-https ca-certificates
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D
nano /etc/apt/sources.list.d/collabora.list
deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian11 ./
sudo apt update
sudo apt install coolwsd code-brand

Make some changes in the configuration file.

sudo coolconfig set ssl.enable false
sudo coolconfig set ssl.termination true
sudo coolconfig set storage.wopi.host collabora.example.com
sudo coolconfig set-admin-password
sudo systemctl restart coolwsd

restart service

sudo systemctl restart coolwsd.service
sudo systemctl status coolwsd.service
● coolwsd.service - Collabora Online WebSocket Daemon
     Loaded: loaded (/lib/systemd/system/coolwsd.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-01-23 15:03:30 CET; 6h ago
   Main PID: 161 (coolwsd)
        CPU: 53.625s
     CGroup: /system.slice/coolwsd.service
             ├─161 /usr/bin/coolwsd --version --o:sys_template_path=/opt/cool/systemplate --o:child_root_path=/opt/cool/child-roots --o:file_server_root_path=/usr/share/coolwsd
             ├─465 /usr/bin/coolforkit --losubpath=lo --systemplate=/opt/cool/systemplate --lotemplate=/opt/collaboraoffice --childroot=/opt/cool/child-roots/ --clientport=9980 --masterport=coolwsd>
             └─467 /usr/bin/coolforkit --losubpath=lo --systemplate=/opt/cool/systemplate --lotemplate=/opt/collaboraoffice --childroot=/opt/cool/child-roots/ --clientport=9980 --masterport=coolwsd>

Jan 23 20:15:37 debian-11-nextcloud coolwsd[161]: wsd-00161-00479 2022-01-23 20:15:37.966366 +0100 [ websrv_poll ] WRN  client - server version mismatch, disabling browser cache. Expected: 21324cf|>
Jan 23 20:15:38 debian-11-nextcloud coolwsd[161]: wsd-00161-00479 2022-01-23 20:15:38.071664 +0100 [ websrv_poll ] WRN  client - server version mismatch, disabling browser cache. Expected: 21324cf|>
Jan 23 20:26:06 debian-11-nextcloud coolwsd[161]: wsd-00161-00479 2022-01-23 20:26:06.842804 +0100 [ websrv_poll ] ERR  Unknown resource: /_ignition/execute-solution G, host: xx.xx.100.172, path: 2
Jan 23 20:26:06 debian-11-nextcloud coolwsd[161]: [0] '_ignition'
Jan 23 20:26:06 debian-11-nextcloud coolwsd[161]: [1] 'execute-solution'
Jan 23 20:26:06 debian-11-nextcloud coolwsd[161]: full URI: /_ignition/execute-solution| wsd/COOLWSD.cpp:2822
Jan 23 20:46:07 debian-11-nextcloud coolwsd[161]: wsd-00161-00479 2022-01-23 20:46:07.935856 +0100 [ websrv_poll ] ERR  Unknown resource: /hosting/discovery H, host: collabora.example.com, path: 2
Jan 23 20:46:07 debian-11-nextcloud coolwsd[161]: [0] 'hosting'
Jan 23 20:46:07 debian-11-nextcloud coolwsd[161]: [1] 'discovery'
Jan 23 20:46:07 debian-11-nextcloud coolwsd[161]: full URI: /hosting/discovery| wsd/COOLWSD.cpp:2822

I’ll configure a reverse proxy server and get TLS certificates.
On debian 10 (192.168.1.105)
Here is the resulting configuration file.

server {
    server_name collabora.example.com;

    location / {
        proxy_pass http://192.168.1.108:9980;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/collabora.example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/collabora.example.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
    if ($host = collabora.example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    server_name collabora.example.com;
    return 404; # managed by Certbot


}

then i open the web browser url collabora.example.com
collabora-ok

The web browser responds OK.
Now I would like to set up an apache2 server, but I don’t know how (on 192.168.1.108)

sudo nano /etc/apache2/sites-available/collabora.example.com.conf

I used this configuration

 ########################################

 # Reverse proxy for Collabora Online
 #

 ########################################


 AllowEncodedSlashes NoDecode
 ProxyPreserveHost On


 # static html, js, images, etc. served from coolwsd
 # browser is the client part of Collabora Online
 ProxyPass           /browser http://127.0.0.1:9980/browser retry=0
 ProxyPassReverse    /browser http://127.0.0.1:9980/browser


 # WOPI discovery URL
 ProxyPass           /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0
 ProxyPassReverse    /hosting/discovery http://127.0.0.1:9980/hosting/discovery


 # Capabilities
 ProxyPass           /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
 ProxyPassReverse    /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities


 # Main websocket
 ProxyPassMatch      "/cool/(.*)/ws$"      ws://127.0.0.1:9980/cool/$1/ws nocanon


 # Admin Console websocket
 ProxyPass           /cool/adminws ws://127.0.0.1:9980/cool/adminws


 # Download as, Fullscreen presentation and Image upload operations
 ProxyPass           /cool http://127.0.0.1:9980/cool
 ProxyPassReverse    /cool http://127.0.0.1:9980/cool
 # Compatibility with integrations that use the /lool/convert-to endpoint
 ProxyPass           /lool http://127.0.0.1:9980/cool
 ProxyPassReverse    /lool http://127.0.0.1:9980/cool
sudo a2ensite collabora.example.com.conf
sudo ufw allow 9980
sudo a2enmod proxy
sudo a2enmod proxy_wstunnel
sudo a2enmod proxy_http
sudo a2enmod ssl #Maybe not necessary
sudo systemctl reload apache2

then i open the web browser url https://collabora.example.com/browser/dist/admin/admin.html#
collabora-admin
Web admin console does not work.

Now I go to the nextcloud web interface and install collabor online.
Next I go to Settings → Office and set it as it is in the picture.

collabora-office
However, files cannot be edited or created.
I don’t know where I’m making a mistake.

Can anyone advise please ?

Hi @gusto, i don’t know how to help you on your issue but have you set this line in your config.php ?
'allow_local_remote_servers' => true,

have you some log of nextcloud about collabora ?

This directive is not included in my configuration file. When I add a directive to the config file, nothing happens.
I see the problem more with coolwsd… When I log in to the admin console, I always see this.

collabora-admin
I am attaching journalctl from coolwsd.

Hi @gusto, i found this error :

[ coolwsd ] ERR Failed to open directory [/usr/bin/browser/welcome] (ENOENT: No such file or directory)| wsd/FileServer.cpp:758

FileServerRequestHandler::NotAuthenticated: No authentication information found| wsd/FileServer.cpp:708

but i never installed collabora server so it’s difficult to help you …
try to find informations about these error maybe it can help you

have you edit this file ? /etc/coolwsd/coolwsd.xml

edit : according to this site, the admin web page is https://office.your-domain.tld/loleaflet/dist/admin/admin.html ?

Of course, I modified the configuration (see my first post).

sudo coolconfig set ssl.enable false
sudo coolconfig set ssl.termination true
sudo coolconfig set storage.wopi.host collabora.example.com
sudo coolconfig set-admin-password
sudo systemctl restart coolwsd

The site you remember is outdated. Many things have changed since then. Coolwsd is used, not loolwsd.

I first installed collwsd in an unprivileged LXC.
To avoid the problem, I tried the privileged LXC and then I tried KVM.
But I did not solve the problem.

I found out a new fact.
Today I installed coolwsd on my desktop (linux mint 19). The installation procedure is classic

sudo apt install apache2
sudo apt install coolwsd code-brand

sudo coolconfig set ssl.enable false
sudo coolconfig set ssl.termination true
sudo coolconfig set-admin-password
sudo systemctl restart coolwsd
systemctl status coolwsd

sudo nano /etc/apache2/sites-available/collabora.example.com.conf
<VirtualHost *:80>
AllowEncodedSlashes NoDecode
 ProxyPreserveHost On


 # static html, js, images, etc. served from coolwsd
 # browser is the client part of Collabora Online
 ProxyPass           /browser http://127.0.0.1:9980/browser retry=0
 ProxyPassReverse    /browser http://127.0.0.1:9980/browser


 # WOPI discovery URL
 ProxyPass           /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0
 ProxyPassReverse    /hosting/discovery http://127.0.0.1:9980/hosting/discovery


 # Capabilities
 ProxyPass           /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
 ProxyPassReverse    /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities


 # Main websocket
 ProxyPassMatch      "/cool/(.*)/ws$"      ws://127.0.0.1:9980/cool/$1/ws nocanon


 # Admin Console websocket
 ProxyPass           /cool/adminws ws://127.0.0.1:9980/cool/adminws


 # Download as, Fullscreen presentation and Image upload operations
 ProxyPass           /cool http://127.0.0.1:9980/cool
 ProxyPassReverse    /cool http://127.0.0.1:9980/cool
 # Compatibility with integrations that use the /lool/convert-to endpoint
 ProxyPass           /lool http://127.0.0.1:9980/cool
 ProxyPassReverse    /lool http://127.0.0.1:9980/cool
</VirtualHost>
sudo a2enmod proxy
sudo a2enmod proxy_wstunnel
sudo a2enmod proxy_http
sudo a2enmod ssl
sudo systemctl restart apache2

My desktop has an IP address of 192.168.1.2.
When I enter a web browser url

http://127.0.0.1:9980/browser/dist/admin/admin.html

It seems to be OK

cool01

When I enter a web browser url

http://192.168.1.2:9980/browser/dist/admin/admin.html

I get the same mistake

It seems to me that coolwsd only works in localhost.
I will create it in /home/gusto/test.odt and I want to edit it using collabor online
cool03
Then I see this


cool05

1 Like

Hello. I have the same problem with collabora admin console with Apache proxy. collabora/code is in docker version and and follow all official configuration for Apache Proxy.

All works well in Nextcloud but in admin console I have : “Server has been shut down; please reload the page.”

Regards