[HOWTO] Collabora 2.0 without using Docker not for prod

Here is my error log, the same as i did my way… i don’t know where to dig…

Failed to start loolwsd.service: Unit loolwsd.service is not loaded properly: Invalid argument.

My bad, just remove Type=oneshot as it’s not allowed with Restart=

I will edit my previous post
don’t forget to do systemctl daemon-reload

Thanks

I recommend stating that it only works on Ubuntu 16.04 and may not be working on other versions.
There is a certain set of prerequisites that has to be installed in order for it to work “out of the box”.

Hi there,

Just tried this tweak and it’s working !
Thanks.

I had to change 2 or 3 things:

  • Install latest GCC :

    add-apt-repository ppa:ubuntu-toolchain-r/test
    apt-get update
    apt-get install g+Âą4.9

  • In order to less modify loolwsd.xml, I managed to :

    • Run the container with “-e “domain=HOSTNAME””. This avoid to modify lines 38 and 48 as docker does it for you :slight_smile:
    • Remove default certificates and replace it with good ones :
      rm /etc/loolwsd/*.pem
      cp /path/to/cert.pem /etc/loolwsd/cert.pem
      cp /path/to/privkey.pem /etc/loolwsd/key.pem
      cp /path/to/chain.pem /etc/loolwsd/ca-chain.cert.pem
  • There is a mistake on your syntax while launching the system template. Good one is :

sudo /usr/bin/loolwsd-systemplate-setup /opt/lool/systemplate /opt/collaboraoffice5.1/

1 Like

As I had to redo, I wrote a little script that automatize all that stuff :

#!/bin/bash

HOSTNAME=your.fdqn.net
USERNAME=you
PASSWORD=y0uR.P@sww0rd
FILEPATH=/usr/share/loolwsd
CERTPATH=/path/to/certs

docker pull collabora/code
docker run -t -d --name collabora_tmp -p 127.0.0.1:9980:9980 -e "domain=$HOSTNAME"  --restart always --cap-add MKNOD collabora/code

docker cp collabora_tmp:/opt/collaboraoffice5.1/ /opt/
docker cp collabora_tmp:/usr/bin/loolforkit /usr/bin/
docker cp collabora_tmp:/usr/bin/loolmap /usr/bin/
docker cp collabora_tmp:/usr/bin/loolmount /usr/bin/
docker cp collabora_tmp:/usr/bin/looltool /usr/bin/
docker cp collabora_tmp:/usr/bin/loolwsd /usr/bin/
docker cp collabora_tmp:/usr/bin/loolwsd-systemplate-setup /usr/bin/
docker cp collabora_tmp:/etc/loolwsd/ /etc/
docker cp collabora_tmp:/usr/share/loolwsd/ /usr/share/
docker cp collabora_tmp:/usr/lib/libPocoCrypto.so.42 /usr/lib/
docker cp collabora_tmp:/usr/lib/libPocoFoundation.so.42 /usr/lib/
docker cp collabora_tmp:/usr/lib/libPocoJSON.so.42 /usr/lib/
docker cp collabora_tmp:/usr/lib/libPocoNet.so.42 /usr/lib/
docker cp collabora_tmp:/usr/lib/libPocoNetSSL.so.42 /usr/lib/
docker cp collabora_tmp:/usr/lib/libPocoUtil.so.42 /usr/lib/
docker cp collabora_tmp:/usr/lib/libPocoXML.so.42 /usr/lib/

docker stop collabora_tmp
docker rm collabora_tmp

sudo rm /etc/loolwsd/*.pem

sudo cp $CERTPATH/cert.pem /etc/loolwsd/cert.pem
sudo cp $CERTPATH/privkey.pem /etc/loolwsd/key.pem
sudo cp $CERTPATH/chain.pem /etc/loolwsd/ca-chain.cert.pem

sudo sed -i "s@><\/file_server_root_path>@>$FILEPATH<\/file_server_root_path>@g" /etc/loolwsd/loolwsd.xml
sudo sed -i "s@><\/username>@>$USERNAME<\/username>@g" /etc/loolwsd/loolwsd.xml
sudo sed -i "s@><\/password>@>$PASSWORD<\/password>@g" /etc/loolwsd/loolwsd.xml

useradd lool
sudo setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolforkit
sudo setcap cap_sys_admin=ep /usr/bin/loolmount
mkdir -p /var/cache/loolwsd/
mkdir -p /opt/lool/child-roots/
chown -R lool:lool /var/cache/loolwsd/
chown -R lool:lool /opt/lool/child-roots/

sudo /usr/bin/loolwsd-systemplate-setup /opt/lool/systemplate /opt/collaboraoffice5.1/
sudo chown -R lool:lool /opt/lool/systemplate 

two commands should be enought to remove it all :

sudo rm -r /opt/collaboraoffice5.1 /usr/bin/lool* /etc/loolwsd /usr/share/loolwsd /usr/lib/libPoco* /var/cache/loolwsd 
sudo deluser lool

Regards.

2 Likes

Thanx a lot for this script. Helped a lot after three days fighting with the docker image. :grin:

gives loads of errors

find: âlib/ld-â: No such file or directory
find: âlib/libcap
â: No such file or directory
find: âlib64/libcapâ: No such file or directory
find: âlib/libattr
â: No such file or directory
find: âlib/libnss_â: No such file or directory
find: âlib64/libnss_â: No such file or directory
find: âvar/cache/fontconfigâ: No such file or directory
find: âusr/lib/locale/en_US.utf8â: No such file or directory
find: âusr/lib/locale/locale_archiveâ: No such file or directory
find: âusr/share/liblangtagâ: No such file or directory
find: âusr/lib/libpng
â: No such file or directory
find: âusr/lib64/libpng
â: No such file or directory
find: âlib/ld-â: No such file or directory
find: âlib/libnss_â: No such file or directory
find: âlib64/libnss_â: No such file or directory
find: âlib/libcap
â: No such file or directory
find: âlib64/libcap
â: No such file or directory
find: âlib/libattr
â: No such file or directory
find: âusr/lib/libpngâ: No such file or directory
find: âusr/lib64/libpng
â: No such file or directory
find: â/opt/poco/libâ: No such file or directory
find: â/opt/poco/libâ: No such file or directory
find: â/usr/lib64â: No such file or directory

i have the same error as above, my server is a X86 machine, does collabora works or it really need a X64 OS?

hi everybody
is there anyone tried this tutorial on ubuntu 16.10 server ?
i did it but collabora still give error i was trying to build collabora with docker but not success then i saw this tutorial
i did all steps but i have still error on nextcloud
Please ask your administrator to check the Collabora Online server setting. The exact error message was: cURL error 7: Failed to connect to office.xyxy.com port 9980: Connection refused
my nextcloud server name is different than office server name (i use https://cloud.xyxy.com)
i have already fqdm for both domains
(i think my problem is in apache ) can somebody share libreoffice.conf file ? (apache config file for collabora)
when i put my collabora (office.xyxy.com:9980) domain my web browser reject connection
many thanks for all

It does work, you may need GCC and some other things though. But it’s hard to say without knowing what loolwsd is saying when you run it.

i already installed GCC
but nothing and nothing i am thinking my problem is in apache config file

also i just found that loolwsd service is down it doesnt want to start
Oct 25 09:23:41 test systemd[1]: Started loolwsd as a service.
Oct 25 09:23:41 test systemd[1]: loolwsd.service: Main process exited, code=exited, status=127/n/a
Oct 25 09:23:41 test systemd[1]: loolwsd.service: Unit entered failed state.
Oct 25 09:23:41 test systemd[1]: loolwsd.service: Failed with result ‘exit-code’.
Oct 25 09:23:41 test systemd[1]: loolwsd.service: Service hold-off time over, scheduling restart.
Oct 25 09:23:41 test systemd[1]: Stopped loolwsd as a service.
Oct 25 09:23:41 test systemd[1]: loolwsd.service: Start request repeated too quickly.
Oct 25 09:23:41 test systemd[1]: Failed to start loolwsd as a service.
Oct 25 09:23:41 test systemd[1]: loolwsd.service: Unit entered failed state.
Oct 25 09:23:41 test systemd[1]: loolwsd.service: Failed with result ‘start-limit-hit’.

Run:
sudo -u lool /usr/bin/loolwsd --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice5.1 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd

and see if there are any errors

error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
i received error

i have ubuntu 16.10 server with apache and php7
many thanks for your helps

root@test:~# sudo apt-get install libpng12-0
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libpng12-0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘libpng12-0’ has no installation candidate

apt-get install libpng-dev

1 Like

i already installed it then i put your command but same result same error because system find libpng12.so

hi again i added new repository for install libpng12-0 so i installed after i was trying this command

sudo -u lool /usr/bin/loolwsd --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice5.1 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd

but here is error

root@test:~# sudo -u lool /usr/bin/loolwsd --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice5.1 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd
wsd-30110-00 00:00:00.000413 [ loolwsd ] Initializing wsd
wsd-30110-00 00:00:00.000467 [ loolwsd ] Log level is [8].
wsd-30110-00 00:00:00.001186 [ loolwsd ] SSL support: SSL is enabled.
wsd-30110-00 00:00:00.001271 [ loolwsd ] Launch this in your browser:
wsd-30110-00 00:00:00.001307 [ loolwsd ] https://localhost:9980/loleaflet/1.8.4/loleaflet.html?file_path=file:///usr/bin/test/data/hello-world.odt
wsd-30110-00 00:00:00.001342 [ loolwsd ] Open Documents Limit: 10
wsd-30110-00 00:00:00.001362 [ loolwsd ] Client Connections Limit: 20
wsd-30110-00 00:00:00.001406 [ loolwsd ] Adding trusted WOPI host: [office.xyxy.com].
wsd-30110-00 00:00:00.001431 [ loolwsd ] Adding trusted WOPI host: [10.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}].
wsd-30110-00 00:00:00.001456 [ loolwsd ] Adding trusted WOPI host: [172.1[6789].[0-9]{1,3}.[0-9]{1,3}].
wsd-30110-00 00:00:00.001482 [ loolwsd ] Adding trusted WOPI host: [172.2[0-9].[0-9]{1,3}.[0-9]{1,3}].
wsd-30110-00 00:00:00.001506 [ loolwsd ] Adding trusted WOPI host: [172.3[01].[0-9]{1,3}.[0-9]{1,3}].
wsd-30110-00 00:00:00.001533 [ loolwsd ] Adding trusted WOPI host: [192.168.[0-9]{1,3}.[0-9]{1,3}].
wsd-30110-00 00:00:00.001558 [ loolwsd ] Adding blocked WOPI host: [192.168.1.1].
wsd-30110-00 00:00:00.001650 [ loolwsd ] SSL Cert file: /etc/loolwsd/office.xyxy.pem
wsd-30110-00 00:00:00.001677 [ loolwsd ] SSL Key file: /etc/loolwsd/office.xyxy.com.key
wsd-30110-00 00:00:00.001697 [ loolwsd ] SSL CA file: /etc/loolwsd/root_bundle.pem
SSL context exception: Error loading certificate from file /etc/loolwsd/office.xyxy.pem: error:02001002:system library:fopen:No such file or directory