Using Collabora with MAIB NextCloud?


#1

If you haven’t heard of Collabora it is a “LibreOffice-based online office suite with collaborative editing”.

It looks like exactly what I want for editing my NextCloud docs on MIAB. Has anyone gone through this? I’ve googled it but haven’t found anything MAIB specific for Collabora. I would love to host Collabora on the same server as MAIB but it would also be useful to know how to host on a different box. Any help is much appreciated.

Thanks
Ben


#2

Collabora and NextCloud need to be on the same server.

Install Mail in a box
Install Collabora
Enable admin in NextCloud (See mail in a box forums for details)
Install Collabora in NextCloud
Profit.


#3

I’ve had some experience installing collabora on next cloud and it’s a B*TCH! that said, If you need another set of eyes feel free to Reach out and I’ll be happy to help any way I can.


#4

Hi Alternativeresearch,

I could sure use some help install Collabora on my MailInABox server. You are so right it’s a B*TCH to install.
Everything appears to be working but when I click on a document I receive this error:

Internal Server Error
The server encountered an internal error and was unable to complete your request.

Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.

More details can be found in the server log.

Technical details
Remote Address: "MYCOMPUTERSIPADDRESS"
Request ID: 8rZKCcehADRYrKdIyxd9

I check the nginx logs and this is what it shows:
2018/01/14 16:19:34 [error] 5016#0: *82 no live upstreams while connecting to upstream, client: “IPOFSERVER”, server: apps.mydomain.com, request: “GET /hosting/discovery HTTP/1.1”, upstream: “https://localhost/hosting/discovery”, host: “apps.mydomain.com

I’m not sure how to fix this. I tried everything I can think of. Worked on it for two days. Any help would be greatly appreciated!


#5

Hmmm what do you have in the way of IM software? I’ll be available later on tonight and probably the better part of tomorrow, should we try to make some time to go over things?


#6

Hi all,

Did you guys have any specific instructions (link, perhaps?) of what you did to resolve this?

I remember seeing a post where you (@pupsncats) mentioned you got it all up and running.

Did you have to edit your nginx config file(s)?

I say this as I followed the steps on the link in the OP and when I get to the steps of restarting the apache server I get:

  • Restarting web server apache2
    (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
    (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    AH00015: Unable to open logs
    Action ‘start’ failed.
    The Apache error log may have more information.

It seems that MiaB uses nginx - I’m not too familiar with it but from looking at the folder structure it still has sites-available, etc.

Long story short: what did you guys do to get it up and running?

Thank you :slight_smile:

ETA:

@pupsncats: I just located your post saying that you got it working.


I see you couldn’t get them working on the same host. It’s unfortunate as it’d be a real solution to take on Dropbox / Google, etc.

Were you able to use all the same logins or does that not make a difference (having collabora on a different host/system)?


#7

Hi, after a lot of work I did actually get it up and going. I now have two NextCloud servers with Collabora working on them. One is for my business second is my personal NextCloud for our family.

Collabora uses a LOT of memory. I had Mail In A Box on Digital Ocean second smallest server. It was plenty for Mail In A Box but not enough for Collabora.

I have Mail In A Box on a separate server (droplet) the second smallest $10.00 a month plan).
I have Collabora on a separate server on the same plan ($10.00) It works great. The Collabora server can handle multiple NextCloud accounts if you have the power. I did have my business and personal connections to the same server. My business uses it 99.9% of the time. I just removed the connection from my personal. I always use OpenOffice on my MacBook so I don’t ever use Collabora for personal use. Buy, my employees and my business laptop are ChromBooks and definitely needs Collabora.

I can be long winded…lol So here is how I did it :slight_smile:

  1. Install Mail In A Box on a server (droplet) (I have had mine on Amazon AWS, Google Cloud, Digital Ocean, and Cloud At Cost). I HIGHLY don’t recommend Cloud At Cost. They shut the entire company down for days last week with no word if and when our servers would ever come back up. I also don’t recommend Google Cloud as you have to do some custom configurations in PostFix to send emails as Google Cloud blocks SMTP ports. Amazon AWS works great but is more expensive than Digital Ocean. (You may already know this but I figure add this in for any future readers that don’t). I do love Digital Ocean!

  2. After installing Mail In The Box you have to spin up a separate server. I tried the cheapest $5.00 month plan but it just doesn’t have enough power to run Collabora. The $10.00 plan is Eh. It’s fine if you’re the only one using it. If you have multiple people using it AT THE SAME TIME then you will need more power. Only install NGINX and docker. I used Ubuntu 16.04 and locked it down on port 443 with UFW by the internal IP for security. Here is how I did it. Just change the sample domains to yours

sudo apt update
sudo apt install docker.io
sudo docker pull collabora/code
sudo docker run -t -d -p 127.0.0.1:9980:9980 -e ‘domain=nextcloud\.your-domain\.com’ --restart always --cap-add MKNOD collabora/code
sudo apt install nginx
sudo nano /etc/nginx/sites-available/office.your-domain.com

server {
listen 80;
server_name office.your-domain.com;

root /usr/share/nginx/office;
}

ln -s /etc/nginx/available/office.your_domain.com /etc/nginx/sites-enabled/office.your_domain.com
sudo mkdir /usr/share/nginx/office
sudo chown www-data:www-data /usr/share/nginx/office -R
sudo apt install letsencrypt
sudo letsencrypt certonly --webroot --email your-email-address -d office.your-domain.com -w /usr/share/nginx/office/

REPLACE THE CONFIGURATION WITH THIS
sudo nano /etc/nginx/sites-available/office.your-domain.com.conf

server {
listen 443 ssl;
server_name office.your-domain.com;
root /usr/share/nginx/office;

ssl_protocols TLSv1.1 TLSv1.2;
ssl_certificate /etc/letsencrypt/live/office.your-domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/office.your-domain.com/privkey.pem;

# static files
location ^~ /loleaflet {
proxy_pass https://localhost:9980;
proxy_set_header Host $http_host;
}

# WOPI discovery URL
location ^~ /hosting/discovery {
proxy_pass https://localhost:9980;
proxy_set_header Host $http_host;
}

# websockets, download, presentation and image upload
location ^~ /lool {
proxy_pass https://localhost:9980;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
proxy_set_header Host $http_host;
}
}

CHECK NGINX --> sudo nginx -t
RESTART NGINX --> sudo service nginx restart

Now just connect to NextCloud in settings. Don’t add the port. Just the domain name.
Go back in and setup UFW rules for the two servers and you are golden! :slight_smile:

If you need any help just let me know.


#8

@blackbird Change apaches listening port from 80 to something not in use. (EG 8880), follow the instructions given by @pupsncats above.


#9

Thank you so much!!!

On DO, I saved a snapshot before enabling admin, then after. So I thought I’d push it and try to install all on the same host…which is why I was getting the apache errors. I may just create a new minimal droplet for collabora.

I’ll let you know how I go :slight_smile:


#10

Thank you! With regards to apache, I gather you meant change listen port 80 to 8880 in /etc/apache2/ports.conf?

Like I said above, I’m not sure how easy it is to have multiple webserver services running with multiple virtual hosts on one machine - probably doable, I’m just in over my head here.

I’m thinking I might be best to bite the bullet and create a small droplet on DO to host collabora.

Let me know what you guys think.

Thank you :slight_smile:


#11

Yes a separate DO VPS would do just fine.

But I meant changing port in /etc/apache2/ports.conf AND /etc/apache2/sites-enabled/siteconf.conf


#12

I tried to have Collabora on the same server but ran into to many problems.

  1. Collabora eats up a lot of memory and slows down the machine.
  2. Mail-In A Box is an all in one server with it’s on packages. It’s really not meant to have additional packages.
  3. When I would update Mail In A Box, move Mail In A Box to a new server, or need to restore from back-up Mail-In-A-Box will re-write your UFW.
    Collabora really needs to be on it’s own server when working with Mail In A Box.

#13

Cheers!

I don’t have apache installed on the collabora server - I gather that’s even better then?

Thank you again for all your help so far!

Right now, I think I’m having DNS issues. It would explain the problems with letsencrypt and NextCloud not being able to connect to the collabora server (from the MiaB server) .


#14

I can see, those would be annoying. There seem to be plenty of reasons for a dedicated collabora server.

I’m trying to follow the instructions above but letsencrypt is not working and I know I said above that I think it’s DNS…the error is this:

An unexpected error occurred:
The provided email for a registration was invalid :: Error creating new registration :: DNS problem: SERVFAIL looking up MX for my.site.com
Please see the logfiles in /var/log/letsencrypt for more details.

I can’t seem to see anything in the logs.

Once I sort this out, I’ll have to work on UFW rules - did you use a specific site to guide you on any of this?

Thank you so much for all your help so far! It’s been great - I think I’m getting there :slight_smile:


#15

Did you use a valid email address when you requested the SSL from Lets Encrypt?

Before I really help you I need to know more.
Are you install Collabora on it’s own server or you trying on Mail-In-A-Box?
What OS are you using if you are using Collabora on it’s own server.
Who is running your DNS? Third party or Mail In A Box?

I didn’t really use any guide. Just been doing server development and maintenance for a few decades :slight_smile:


#16

Both servers on DO (Digital Ocean).

MiaB:
box:~# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty

Collabora:
office:~# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial

Yeah, the problem in terms of my email address not appearing valid, was thus:

  1. Loaded older snapshot of MiaB on DO (the one I took after enabling admin rights, but before installing collabora).
  2. Got DNS errors trying to install letscrypt (similar to above error message - instead of email issue, it was DNS and MX records issues).
  3. Made DNS changes in both DO and my registrar (Zuver).
  4. Temporarily resolved DNS issues (based on the system checks at box.hostname.com/admin) only to have somehow cause MX DNS record issues.
  5. Re-ran ‘sudo mailinabox’ and thought I got DNS back up. I guess I was wrong.

DNS Settings for both Zuver and DO, as we speak:

Zuver:

DO: Domains and DNS Records

box.hostname.com:

NS ns2.box.hostname.com points to MiaB IP on DO
NS ns1.box.hostname.com points to MiaB IP on DO
A box.hostname.com points to MiaB IP on DO
A www.box.hostname.com points to MiaB IP on DO

office.hostname.com:

NS office.hostname.com points to ns2.box.hostname.com
NS office.hostname.com points to ns1.box.hostname.com
A wwww.office.hostname.com points to Collabora IP on DO
A office.hostname.com points to Collabora IP on DO

I think that’s as much info as you’ve asked. If you need more, please let me know. I am techy but not so great with DNS - especially after hours of bashing my head against a brickwall.

I still can’t get SSL setup - I’ve tried letsencrypt and also certbot (I think they’re both the same project at the core - but I could be wrong). Either way, I am getting similar errors from both.

e.g.

office:~# sudo certbot --nginx -d office.hostname.com Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator nginx, Installer nginx Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org Obtaining a new certificate Performing the following challenges: http-01 challenge for office.hostname.com Using default address 80 for authentication. nginx: [warn] conflicting server name "office.hostname.com" on 0.0.0.0:443, ignored Waiting for verification... Cleaning up challenges nginx: [warn] conflicting server name "office.hostname.com" on 0.0.0.0:443, ignored Failed authorization procedure. office.hostname.com (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: DNS problem: NXDOMAIN looking up A for office.hostname.com

IMPORTANT NOTES:

  • The following errors were reported by the server:

    Domain: office.hostname.com
    Type: connection
    Detail: DNS problem: NXDOMAIN looking up A for office.hostname.com

    To fix these errors, please make sure that your domain name was
    entered correctly and the DNS A/AAAA record(s) for that domain
    contain(s) the right IP address. Additionally, please check that
    your computer has a publicly routable IP address and that no
    firewalls are preventing the server from communicating with the
    client. If you’re using the webroot plugin, you should also verify
    that you are serving files from the webroot path you provided.

I reckon it has something to do with configuring name servers on Zuver, I don’t know how else to set things up there - it seems really confusing, but I’m also no expert.

root@office:~# host ns1.hostname.com
Host ns1.box.hostname.com not found: 2(SERVFAIL)
root@office:~# host ns2.hostname.com
Host ns2.box.hostname.com not found: 2(SERVFAIL)

Would appreciate any assistance you could provide.

Thank you!!! :slight_smile:


#17

Okay, that helped!

I’m not quite sure why you have ns1.box and ns2.box pointed to MiaB. You’re not using MiaB DNS server correct? You’re using Zuver, right?
If that’s correct then in Zuver you would keep the nameserver to Zuver’s name server. If your’re having DNS problems I would suggest removing all records in Zuver. Fresh clean slate. Once you have all the records removed visit MiaB Admin area. MiaB/admin
Under system click on External DNS. Enter every record as is. I don’t know if Zuver allows for ipv6 AAAA records. If not, just skip those. I also skip the SSHFP records.
After you have all those records entered. Then in Zuver create another A record for Collabora.
Test it out.

Couple side notes. In the external DNS it has you entering an A record for your primary domain. If you have a website etc. you will want to change that IP and point it to your website etc.

When you are running LetsEncrypt this is on your Collabora droplet, correct? Not on Mail in a Box.

This is how I normally install Lets Encrypt on Ubuntu 16.04
sudo apt-get install letsencrypt -y
sudo letsencrypt certonly --webroot -w /usr/share/nginx/office -d office.hostname.com

If you are still having problems send me a private message with your email address. Tomorrow I can do a Skype session with screen share and fix it all up for you.
I install MiaB all the time for my clients. It no problem at all.


#18

Firstly, thank you so much for helping.

Well, I thought it was best to let MiaB handle DNS (and the default setting for MiaB)?

The reason I set n1.box and ns2.box to point to MiaB was for reverse DNS (reverse DNS does my head in).

Also, if I let Zuver handle DNS, I get this error on the system check (box.hostname.com/admin):

?
The nameservers set on this domain at your domain name registrar should be ns1.box.jolly.id.au; ns2.box.jolly.id.au. They are currently ns1.nameserver.net.au; ns2.nameserver.net.au; ns3.nameserver.net.au. If you are using External DNS, this may be OK.

This is what kept confusing me. I’ll try what you suggested and let you know, and yes I will certainly take you up on that skype offer if it continues to cause problems.

Thank you :slight_smile:


#20

You are correct. I thought you were using Zuver as your DNS.
In that case change the name server records to point to your MiaB server. That’s all you need to do with Zuver.
The rest is handled inside MiaB.

I’ll message you my email address. Feel free to send me screenshots. It will make it a lot easier. I’ll help you through the DNS problem. I use to run DNS servers for a company I use to work for a decade ago.


#21

Thank you!

Ok, so I have wiped Zuver - however Zuver won’t let me use ns1.box.hostname.com / ns2.box.hostname.com as my custom name servers unless I have 'Domain Name Child Name Servers for hostname.com setup. So I have done that, along with office.hostname.com and box.hostname.com - not sure if I need to do those last two as well.

Today I reloaded the office droplet to start again. Because part of me was thinking maybe it was the webserver as well. I couldn’t ping office.hostname.com, although that probably means it’s DNS.

I’m wondering if all my problems are due to the fact I am trying to do this using two subdomains of hostname.com (registered with Zuver) - i.e mail on box.hostname.com and collabora on office.hostname.com?

Thanks for all your help so far @pupsncats - I think I might have missed you today (timezone and all that) - maybe we can catch up through the week or next weekend.


:thinking: … I’ve got three other websites running on DO / other registrars, a radio streaming server, and a radio scheduling server and yet this simple server that just needs to “be there” and nothing more really, and it just won’t. </mini-rant>