[Solved] Two or more collabora on one server and one collabora for several domains

Dear all,
Iā€™m using several nextcloud instances on a single machine, single ip and it works fine, with several virtual hosts.
something like : cloud1.mydomain.com cloud2.mydomain.com etcā€¦
One of them is linked to a default collabora service, installed on the same server. like collabora1.mydomain.com
It works fine
I tried to run a second docker container just changing port and client domain like this :

echo docker run -t -d -p 127.0.0.1:9981:9981 -e ā€˜domain=collabora2\.mydomain\.comā€™ --restart always --cap-add MKNOD collabora/code

with a second virtual host, adjusting the ports in the apache config file, with different servername and certificate etcā€¦

when i try to edit a document in cloud2.mydomain.com, Iā€™ve the error Access Forbiden

nothing with docker logs ā€¦
in apache error log :

[Tue Apr 25 16:52:36.100834 2017] [proxy_http:error] [pid 11078] (103)Software caused connection abort: [client XX.XX.XX.XX:59227] AH01102: error reading status line from remote server 127.0.0.1:9981
[Tue Apr 25 16:52:36.100951 2017] [proxy:error] [pid 11078] [client XX.XX.XX.XX:59227] AH00898: Error reading from remote server returned by /hosting/discovery

???

Well, mainly two things,
a) Thatā€™s not correctly done
b) You might donā€™t want to go that path

Elaborating,
a) The docker port will never change 9980, for the host OTOH it does on 9981, so youā€™ll get
-p 127.0.0.1:9981:9980
Also try giving docker containers names with -name so you know what container is doing what.

b) CODE (the Collabora Free version or any Online Office suite) is about RAM since the documents will be open on the server, also docker it self is taking itā€™s chunk of RAM to work.

So you probably want to use the same service for multiple domains, in order to have enough RAM available for users to be able to use that feature, or on the long run youā€™ll end with a filled up server that wonā€™t be able to serve itā€™s main purpose, share and sync files.

Cheers!

Thank you very much Ark74 for your quick and complete answer.

I did the change on the port and everything works fine ! And the --name option is also very useful !

The second solution sounds good : using the same container for several domainsā€¦ but how to ?
In the container, the environment variable ā€œdomainā€ seems not to provide a solution to do that.
Is it possible to set several domain name ? Is it possible to use a ā€œ*ā€ or something like that ?
Where do you find documentation about that, I searched a lot but didnā€™t find how to set a different port like you explained and other settingsā€¦

Regards

The domain option can be configured on:

'domain=first\\.domain\\.com\|second\\.domain.com|third\\.domain\\.com'

When running the docker image:
docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=domain\\.nextcloud\\.com' --restart always --cap-add MKNOD collabora/code

1 Like

Very nice ! It works fine !
Thank you !
Butā€¦ where do you find this precious informationsā€¦ ?

Mostly on the documentation, later on self experience.
https://nextcloud.com/collaboraonline/

If you see fit, mark this issue as solved.
Cheers!

1 Like

@Jerome Iā€™m planning to do the same on my ubuntu1604 but how can I setup a 2nd host as I believe I need another SSL cert as well for that same public IP then ? Or are you using localhost and not a public IP/SSL?

Any other gotchaā€™s when I run nextcloud 1103 and collabora on the same server?

thnx! Jeroen

Hi Jeroen,

if you want to host several nextcloud instances on the same machine using the same ip, you have to define as many virtual hosts as you have instances (Iā€™m not a specialist, but it is tha way I did). For each, you have to use a different certificate because the domain is different.

then, for collabora, you have two choices : using the same collabora container or not :

  • simply pass the two or more domain names of your nextcloud instances in the docker run command line ( as described here : https://nextcloud.com/collaboraonline/ ) like this :
    docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=myfirst\.domain\.com|mysecond\.domain\.com' --restart always --cap-add MKNOD collabora/code and thatā€™s all

  • mounting a second container on a second port, still on the same machine like this :
    docker run -t -d -p 127.0.0.1:9981:9980 -e 'domain=mysecond\.domain\.com' --restart always --cap-add MKNOD --name mysecondcontainer collabora/code
    and then you need to install a second virtual host on your apache server with the configuration file pointing on port 9981 instead of default 9980ā€¦ with an other domain name
    and then you need to get another certificate for the new domain name

The second choice need a little bit more effort but can supply collabora for a little bit more users as it is said that one instance of collabora container can respond to 20 users (I do not have sufficient experience to measure that)

The two solutions are working on my 1102 instances, I donā€™t think it will change on 1103. If it does, Iā€™ll post on the forum.

I donā€™t see any other gotchaā€¦

Enjoy !

JƩrƓme

Merci JĆ©rĆ“me! Iā€™ll give it a try!