How to run Onlyoffice with Apache 2.4.18 on Ubuntu 16.04.4?

I do this :

  • apt-get install docker.io

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

*add module on sites-enabled/seafile.conf file

  • add user and group of unix user of seafile process :

    User seafile
    Group seafile

  • add:
    Define VPATH /onlyofficeds
    Define DS_ADDRESS MyIP:88

<Location ${VPATH}>
Require all granted
SetEnvIf Host "^(.)$" THE_HOST=$1
RequestHeader setifempty X-Forwarded-Proto http
RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
RequestHeader edit X-Forwarded-Host (.
) $1${VPATH}
ProxyAddHeaders Off
ProxyPass “http://${DS_ADDRESS}/”
ProxyPassReverse “http://${DS_ADDRESS}/”

The error occur when I try to "Test that DocumentServer is running via SUBFOLDER"
https://MyIP/onlyofficeds/welcome/
I got : Cannot GET //welcome/

Any idea ?

I make wrong installation of docker .
Must follow this link : https://www.youtube.com/watch?v=vu5KO1yTMXc&t=1040s

I’m no expert but isn’t docker.io deprecated in favor of docker-ce shown here?

Second, once docker is installed (and you verify using Hello World) and you spin up onlyoffice/documentserver, you can check by running http://ip_address:88 in a browser.

1 Like

I have read a lot about docker, the package is definately docker-ce not docker.io. Or have you added some weird ppas ?

Now it’s run with docker-ce !
But i got this error message

Now the fun begins!

Can you get an error message for the page from the Developers’ Tools in your browser? Unbalanced tree? CallBack error? Bad API request?

Also, does this server have a domain name and is it using a self-signed certificate?

-Thanks

I use certificat with https://certbot.eff.org/

I got this error when I clic on doc file on web browser

Can you setup your server first to serve just http (port 80) and test Onlyoffice? I have seen it work with http and then fail when SSL is applied.

To view the page error in Chrome or Chromium you might try View > Developer > {Developer Tools | Javascript Console}.

In Firefox, Tools > Web Developer > Web Console.

i write this in apache file
<VirtualHost *:80>
ServerName name.fr
ServerAlias seafile
Redirect permanent / http://name.fr/

**and in seahub_settings.py **
ONLYOFFICE_APIJS_URL = ‘http://name.fr/onlyofficeds/web-apps/apps/api/documents/api.js

But i’m always redirect in https

error message in console
Mixed Content: The page at ‘https://seafile.lmgc.univ-montp2.fr/lib/e46eb79f-c43d-49c7-9f00-219ee98c25a5/file/ok.docx’ was loaded over HTTPS, but requested an insecure script ‘http://seafile.lmgc.univ-montp2.fr/onlyofficeds/web-apps/apps/api/documents/api.js’. This request has been blocked; the content must be served over HTTPS.

Simplest thing is probably to set

ONLYOFFICE_APIJS_URL = ‘http://name.fr/onlyofficeds/web-apps/apps/api/documents/api.js

to

ONLYOFFICE_APIJS_URL = ‘https://name.fr/onlyofficeds/web-apps/apps/api/documents/api.js’

restart and try again.

I’d still like to know if it works with just HTTP though.

i have write
ONLYOFFICE_APIJS_URL = ‘https://name.fr/onlyofficeds/web-apps/apps/api/documents/api.js

nothing change

i’m always redirect in https
I don’t known what do to not being redirect

Do you see the same error message in browser console?

I don’t know Apache well but I recall that there are several ways to redirect to https. For example, do you have access to the Virtual Hosts file? Are you running something like this?

NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.yourdomain.com
Redirect / https://www.yourdomain.com


ServerName www.yourdomain.com
DocumentRoot /usr/local/apache2/htdocs
SSLEngine On

etc…

There are some notes here for reference.

with ONLYOFFICE_APIJS_URL = 'https:

with ONLYOFFICE_APIJS_URL = 'http:

Are the pictures and captions reversed?

I have a test server running on Nginx (sorry!) with a certificate from Let’s Encrypt (just like you). You must check the Seafile configuration files:

ccnet.conf
seahub_settings.py

Make sure SERVICE_URL, FILE_SERVER_ROOT and ONLYOFFICE_APIJS_URL are all https.

If you post your Apache configuration I have no doubt someone will critique it for you.

Yes pictures are reverse !
I have https in all file !

Apache configuration :

LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule ssl_module modules/mod_ssl.so

#user and group that run seafile …

User seafile
Group seafile

<VirtualHost *:80>
   ServerName seafile.lmgc.univ-montp2.fr
   ServerAlias seafile
   Redirect permanent / https://seafile.lmgc.univ-montp2.fr/
</VirtualHost>

<VirtualHost *:443>
  ServerName seafile.lmgc.univ-montp2.fr
  DocumentRoot /var/www

  SSLEngine On
  Include /etc/letsencrypt/options-ssl-apache.conf
  SSLCertificateFile /etc/letsencrypt/live/seafile.lmgc.univ-montp2.fr-0001/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/seafile.lmgc.univ-montp2.fr-0001/privkey.pem

  Alias /media /zfs_data/cloud/seafile-server-latest/seahub/media

  <Location /media>
    Require all granted
  </Location>

  RewriteEngine On
  ProxyPass /seafhttp http://127.0.0.1:8082
  ProxyPassReverse /seafhttp http://127.0.0.1:8082
  RewriteRule ^/seafhttp - [QSA,L]
  SetEnvIf Request_URI . proxy-fcgi-pathinfo=unescape
  SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1


  ProxyPass / http://127.0.0.1:8000/
  ProxyPassReverse / http://127.0.0.1:8000/


  ProxyPass / fcgi://127.0.0.1:8000/
  SSLCertificateFile /etc/letsencrypt/live/seafile.lmgc.univ-montp2.fr-0001/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/seafile.lmgc.univ-montp2.fr-0001/privkey.pem

Define VPATH /onlyofficeds
Define DS_ADDRESS seafile.lmgc.univ-montp2.fr:88


<Location ${VPATH}>
  Require all granted
  SetEnvIf Host "^(.*)$" THE_HOST=$1
  RequestHeader setifempty X-Forwarded-Proto http
  RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
  RequestHeader edit X-Forwarded-Host (.*) $1${VPATH}
  ProxyAddHeaders Off
  ProxyPass "http://${DS_ADDRESS}/"
  ProxyPassReverse "http://${DS_ADDRESS}/"
</Location>
</VirtualHost>

I resolv my problem and writen the correct doc :slight_smile:

1 Like