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

@mobizent
Can you please try the following and report if it works:
docker run -dit -p 88:80 onlyoffice/documentserver --restart always --name oods

I want to update the manual accordingly

nope. got this error

sudo docker run -dit -p 88:80 onlyoffice/documentserver --restart always --name oods

26acbfa54fa66c356074db6706d6326d7fcf4cef6fc28c0c463348c30ae0e22a
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"--restart\": executable file not found in $PATH".

i think the trick is that you need to call --restart always --name oods before the container & i tried that & it works. so it needs to be

docker run -dit -p 88:80 --restart always --name oods onlyoffice/documentserver

1 Like

I just installed Seafile 6.1.1 with onlyoffice and now when I try open files I get follwing error (same error with seafile 6.1.0). I get same error with .doc, .docx, .xlsx and .pptx files.

I have followed instructions and checked those couple of times but I don’t error.

Does anyone else have same problem?

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.