Installing Collabora Office on Devuan Beowulf

By dose | October 25, 2022
Under: Uncategorized

Unfortunately, the Package coolwsd from Collabora for Debian 10 relies on systemd. And most recent loolwsd is now coolwsd for Collabora online (office suite to use with nextcloud).
So here is a short how-to how to set it up on Devuan Beowulf:

Setup repo:

apt install gnupg apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D
echo "deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian10 ./" >/etc/apt/sources.list.d/collabora.list
apt update

Install cooldwsd without systemd:

apt-get download coolwsd code-brand
dpkg -i --ignore-depends=systemd coolwsd_22.05.7.2-1_amd64.deb

I actually did it this way, as I was unaware of –ignore-depends option, but I leave it in here for reference in case it doesn’t work with ignore-depends option:

dpkg --force-all -i coolwsd_22.05.7.2-1_amd64.deb

Then remove systemd dependency to fix package cache:

vi /var/lib/dpkg/status

Remove “systemd” from “coolwsd” package in dependency list so that your apt isn’t damaged anymore.

When you installed with –force-all, install missing dependencies:

apt install expat collaboraofficebasis-calc collaboraofficebasis-core collaboraofficebasis-graphicfilter collaboraofficebasis-images collaboraofficebasis-impress collaboraofficebasis-ooofonts collaboraofficebasis-writer collaboraoffice collaboraoffice-ure collaboraofficebasis-en-us collaboraofficebasis-draw collaboraofficebasis-extension-pdf-import collaboraofficebasis-ooolinguistic collaboraofficebasis-math code-brand

Create logfile dir:

mkdir /var/log/coolwsd
chown cool:cool /var/log/coolwsd

Configure coolwsd:

vi /etc/coolwsd/coolwsd.xml
ssl/enable -> false
ssl/termination -> true
net/listen -> loopback
file -> enable=true
file/patch -> /var/log/coolwsd/coolwsd.log
trace_event/path -> /var/log/coolwsd/coolwsd.trace.json
net/proto -> IPv4
storage/ssl/as_scheme -> false
net/
<host desc="External IP of server">123\.123\.123\.123</host>

 

Create init.d script /etc/init.d/coolwsd

#!/bin/sh
### BEGIN INIT INFO
# Provides:          coolwsd
# Required-Start:    $local_fs $remote_fs $network $syslog $named
# Required-Stop:     $local_fs $remote_fs $network $syslog $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: libreoffice
# Description:       LibreOffice Online WebSocket server
#                    This script will start the libreoffice server
### END INIT INFO
 
# run update-rc.d for create K S file in /etc/init.d/*
 
 
DESC="LibreOffice Online WebSocket server"
NAME=coolwsd
USER=cool
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
PARAM=""
PARAM="$PARAM --version"
PARAM="$PARAM --disable-ssl"
PARAM="$PARAM --o:sys_template_path=/opt/cool/systemplate"
PARAM="$PARAM --o:child_root_path=/opt/cool/child-roots"
PARAM="$PARAM --o:file_server_root_path=/usr/share/coolwsd"
PARAM="$PARAM --o:logging.file[@enable]=true"
 
test -x $DAEMON || exit 0
 
 
. /lib/lsb/init-functions
 
 
if [ "$(id -u)" != "0" ]
then
  log_failure_msg "You must be root to start, stop or restart cool"
  exit 1
fi
 
 
do_status () {
     log_daemon_msg "$DESC" "$name"
     start-stop-daemon --status --verbose --pidfile $PIDFILE
     log_end_msg $?
     return $?
}
 
do_start () {
  log_daemon_msg "Starting $DESC" "$name"
  start-stop-daemon --start --verbose --pidfile $PIDFILE --make-pidfile --chuid $USER --background --exec $DAEMON -- $PARAM
  log_end_msg $?
  return $?
}
 
do_stop () {
  log_daemon_msg "Stopping $DESC" "$name"
  start-stop-daemon --stop --verbose --pidfile $PIDFILE --remove-pidfile
  log_end_msg $?
  return $?
}
 
case "$1" in
  status)
     do_status || exit 1
     ;;
  start)
     do_start || exit 1
     ;;
  stop)
     do_stop || exit 1
     ;;
  force-reload|restart)
     do_stop &amp;&amp; sleep 3
     do_start || exit 1
     ;;
  *)
 
     echo "Usage: /etc/init.d/lool {start|stop|restart|force-reload|status}"
     exit 1
esac
 
exit 0

Install with: update-rc.d coolwsd defaults

Now setup apache virtualhost to collabora.yourdomain.com:


cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/collabora.conf
vi /etc/apache2/sites-available/collabora.conf

Uncomment & set the ServerName directive.

Install SSL certificate:

a2ensite collabora
/etc/init.d/apache2 reload
certbot --apache -d collabora.yourdomain.com
a2enmod proxy proxy_wstunnel proxy_http

Add configuration options for coolwsd:
vi /etc/apache2/sites-enabled/collabora-le-ssl.conf:

# Encoded slashes need to be allowed
AllowEncodedSlashes NoDecode
 
# Container uses a unique non-signed certificate
SSLProxyEngine Off
SSLProxyVerify None
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerName Off
 
# keep the host
ProxyPreserveHost On
 
# static html, js, images, etc. served from coolwsd
# browser is the client part of LibreOffice 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
 
# 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
 
# Endpoint with information about availability of various features
ProxyPass /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
ProxyPassReverse /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities

Start collabora and reload apache and it should work:


/etc/init.d/apache2 reload
/etc/init.d/coolwsd start

Hope that helps to use collabora without this dreaded systemd cr*p.

Leave a Comment

Name:

E-Mail :

Subscribe :
Website :

Comments :