HOW TO: Deploy OnlyOffice in Seafile servers subdomain subfolder - CE 6.1+

How did you setup the OnlyOffice Server?

Works fine here.

I updated the manual accordingly. Also added an example for Debian Jessie regarding memory limit which might be interessting.

@daniel.pan

Please merge ASAP, important changes included! :slight_smile:

I run seafile on Ubuntu 16.04 with nginx.

I installed docker with command
apt-get install docker-ce

and Only office with command
docker run -i -t -d -p 88:80 onlyoffice/documentserver --restart=always --name oods

Subdomain or subfolder ?
Nginx config for the DS ?

For Ubuntu it should be ā€œdocker run -dit -p 88:80 --restart always --name oods onlyoffice/documentserverā€.
Funny that you say it works for you as @mobizent said it did not on his Ubuntu 16.04.

Please stop the container (docker container stop oods), remove the container (docker container rm -f oods) and redeploy with the command above.

Onlyoffice in subfolder (https://files.domain.com/onlyofficeds).

Here what i have in nginx conf ( /etc/nginx/sites-available/seafile.conf)

# Required for only office document server
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
ā€œā€ $scheme;
}
map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
ā€œā€ $host;
}
map $http_upgrade $proxy_connection {
default upgrade;
ā€œā€ close;
}

and

location /onlyofficeds/ {

    # THIS ONE IS IMPORTANT ! - Trailing slash !
    proxy_pass http://127.0.0.1:88/;

    proxy_http_version 1.1;
    client_max_body_size 100; # Limit Document size to 100MB
    proxy_read_timeout 3600s;
    proxy_connect_timeout 3600s;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $proxy_connection;

    # THIS ONE IS IMPORTANT ! - Subfolder and NO trailing slash !
    proxy_set_header X-Forwarded-Host $the_host/onlyofficeds;

    proxy_set_header X-Forwarded-Proto $the_scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

I removed docker container and installed again with your commands, but still not working.

I donā€™t know is this relevant, but some times I get also another error which says error opening filesā€¦

Now I got it working :slight_smile:

Problem was docker containerā€™s dns because my seafile server is inside corporate network and domain name doesnā€™t exist in public dns servers and by default docker container gets default googleā€™s dns server 8.8.8.8.

So fix is provide internal dns server when installing oods to docker in such situations.
sudo docker run -dit -p 88:80 --dns=172.16.88.10 --restart always --name oods onlyoffice/documentserver

2 Likes

Please check if you can communicate with http://127.0.0.1:88 from your host.
Iā€™d replace proxy_pass http://127.0.0.1:88/; with proxy_pass http://{ Your FQDN }:88/;.
The host should be able to talk to itself as you can the document serverā€™s page.

How did you configure the URL in Seafile?
Is your certificate valid? (officially signed, NOT self-signed)

I changed proxy_pass to proxy_pass http://files.domain.com:88/; and its working like before.

Host can talk to documents server, I get page where is ā€œDocument Server is runningā€

One problem I still have. If I open for example test.docx file from seafile to onlyoffice and edit file and save, onlyoffice saves file fine, but if I download then file from seafile server to laptop there are no modification what I have made in onlyoffice??

When you save and close the file in OnlyOffice and open it again, do you see changes?

If not there might still be a problem saving the file back into Seafile.

1 Like

Hello,
I canā€™t access to https:///openofficieds/welcome/, I only have a seafileā€™s page saying
ā€œSorry, but the requested page could not be found.ā€

Here is the onlyofficieds part in my seafile.conf file:

    location /onlyofficeds/ {
            # THIS ONE IS IMPORTANT ! - Trailing slash !
            proxy_pass              http://127.0.0.1:88/;
            proxy_http_version      1.1;
            client_max_body_size    100;                    # Limit Document size to 100MB
            proxy_read_timeout      3600s;
            proxy_connect_timeout   3600s;
            proxy_set_header        Upgrade                 $http_upgrade;
            proxy_set_header        Connection              $proxy_connection;
            # THIS ONE IS IMPORTANT ! - Subfolder and NO trailing slash !
            proxy_set_header        X-Forwarded-Host        $the_host/onlyofficeds;
            proxy_set_header        X-Forwarded-Proto       $the_scheme;
            proxy_set_header        X-Forwarded-For         $proxy_add_x_forwarded_for;
}

I canā€™t even ping 127.0.0.1:88 on my server :

ping: unknown host 127.0.0.1:88

Dacker is started and if I enter:

sudo docker ps

return :

8f4ccd8d18d8 onlyoffice/documentserver ā€œ/bin/sh -c 'bash ā€¦ā€ 2 hours ago Up 30 minutes 443/tcp, 0.0.0.0:88->80/tcp oods

Can anyone could help me?
Thank you.

Is this a typo or your actual url? (the extra " i ")
You may try to access the hosts FQDM rather than the localhost address.

No, sorry, I made a mistake.
I tried ta access to OpenOffice with https://domain/openofficesd/welcome.

I donā€™t know why, but the website deleted ā€œ<ā€œdomainā€>ā€

Did you follow the documentation?

Then it should be https://sub.domain.de/onlyofficeds/welcome and not ā€œopenofficeā€, which is a different product with similiar target.

Okay, my bad, I made a 2nd mistake writing the URL on this forum, but I tried with the good URL.
So I wasnā€™t able to access to the web page, but a couple of hours after, without any modification, I was able to access to the web page. I canā€™t reboot now seafile, so Iā€™ll check tomorrow if everything is OK with seafile too.
I have one last question : can I install the mail server and the client too, or will it break the installation?
Thank you.

Okay, so I can see the ā€œDocument Server is runningā€, but I when I click on a file, I see the seafileā€™s page, not OnlyOffice.


Here is my seahub_settings.py

ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = True
ONLYOFFICE_APIJS_URL = ā€˜https://domain.ovh/onlyofficeds/web-apps/apps/api/documents/api.jsā€™
ONLYOFFICE_FILE_EXTENSION = (ā€˜docā€™, ā€˜docxā€™, ā€˜pptā€™, ā€˜pptxā€™, ā€˜xlsā€™, ā€˜xlsxā€™, ā€˜odtā€™, ā€˜fodtā€™, ā€˜odpā€™, ā€˜fodpā€™, ā€˜odsā€™, ā€˜fodsā€™)

I also tried with 127.0.0.1 insted of domain.ovh, but always the same result.

Iā€™ve upgraded to seafile CE 6.1.1 today, and installed OnlyOffice using the subfolder way and your documentation.
Great job, everything working.
In fact I found just a small error in tne nginx conf:
client_max_body_size 100M; # Limit Document size to 100MB

1 Like

nginx doesnā€™t show any error here.
If itā€™s an error Iā€™m gonna correct it, ty.

Can you insert image from file in a document ? (that was the problem)

It works fine and it does seem to have a auto-save function, as I just closed the browser tab and the changes where visible.

May be not the same nginx version (1.10.2-1.el7 for me):

with
client_max_body_size 100; # Limit Document size to 100MB

no image include possible and this in nginx log :

2017/06/25 11:00:35 [emerg] 27325#0: "client_max_body_size" directive invalid value in /etc/nginx/conf.d/seafile.conf:79
2017/06/25 11:22:45 [error] 28856#0: *1222 client intended to send too large body: 162573 bytes, client: 193.49.104.18, server: seafile.lirmm.fr, request: "POST /onlyofficeds/2017-06-09-10-21/upload/2c5460e5737727818537/uid-1498382505364/6 HTTP/1.1", host: "seafile.lirmm.fr", referrer: "https://seafile.lirmm.fr/onlyofficeds/2017-06-09-10-21/web-apps/apps/documenteditor/main/index.html?_dc=2017-06-09-10-21&lang=fr&customer=ONLYOFFICE&frameEditorId=placeholder"