{"id":137,"date":"2018-04-11T22:59:49","date_gmt":"2018-04-11T20:59:49","guid":{"rendered":"http:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/?p=137"},"modified":"2020-03-11T15:00:53","modified_gmt":"2020-03-11T14:00:53","slug":"onlyofficeapache","status":"publish","type":"post","link":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/2018\/04\/11\/onlyofficeapache\/","title":{"rendered":"How To install Onlyoffice in Seafile with Apache on ubuntu"},"content":{"rendered":"<p>For those who want to run Onlyoffice in Seafile under Apache web server on Ubuntu 16.04, I share the correct and complet How To.<\/p>\n<blockquote><p>I suppose you already have a seafile server running by <a href=\"https:\/\/manual.seafile.com\/deploy\/\" target=\"_blank\" rel=\"noopener noreferrer\">following server manual<\/a>.<\/p><\/blockquote>\n<ul>\n<li><a href=\"https:\/\/docs.docker.com\/install\/linux\/docker-ce\/ubuntu\/\" target=\"_blank\" rel=\"noopener noreferrer\">Install docker<\/a> in Ubuntu 16.04 amd64 :<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">$ sudo apt-get update\n\n$ sudo apt-get install \\\n    apt-transport-https \\\n    ca-certificates \\\n    curl \\\n    software-properties-common\n\n$ curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -\n\n$ sudo add-apt-repository \\\n   \"deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu \\\n   $(lsb_release -cs) \\\n   stable\"\n\n$ sudo apt-get update\n\n$ sudo apt-get install docker-ce\n\n<\/pre>\n<ul>\n<li>\n<p id=\"deploy-onlyoffice-documentserver-docker-image\">Deploy OnlyOffice DocumentServer Docker image :<\/p>\n<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">docker run -dit -p 88:80 --restart always --name oods onlyoffice\/documentserver<\/pre>\n<ul>\n<li>\n<p id=\"configure-apache\">Configure Apache :<\/p>\n<\/li>\n<\/ul>\n<pre class=\"lang:default mark:11,12,16,55 decode:true \">LoadModule authn_core_module modules\/mod_authn_core.so\nLoadModule authz_core_module modules\/mod_authz_core.so\nLoadModule proxy_module modules\/mod_proxy.so\nLoadModule proxy_http_module modules\/mod_proxy_http.so\nLoadModule proxy_wstunnel_module modules\/mod_proxy_wstunnel.so\nLoadModule headers_module modules\/mod_headers.so\nLoadModule setenvif_module modules\/mod_setenvif.so\nLoadModule ssl_module modules\/mod_ssl.so\n\n&lt;IfModule unixd_module&gt;\n  User seafile           \/\/ replace with your seafile user\n  Group seafile          \/\/ replace with your seafile group\n&lt;\/IfModule&gt;\n\n&lt;VirtualHost *:80&gt;\n   ServerName server.fr  \/\/ replace \"server.fr\" with your server URL\n   ServerAlias seafile\n   Redirect permanent \/ https:\/\/server.fr\/\n&lt;\/VirtualHost&gt;\n\n&lt;VirtualHost *:443&gt;\n  ServerName server.fr\n  DocumentRoot \/var\/www\n\n  SSLEngine On\n  Include \/etc\/letsencrypt\/options-ssl-apache.conf\n  SSLCertificateFile \/etc\/letsencrypt\/live\/server.fr\/fullchain.pem\n  SSLCertificateKeyFile \/etc\/letsencrypt\/live\/server.fr\/privkey.pem\n\n  Alias \/media \/haiwen\/seafile-server-latest\/seahub\/media\n\n  &lt;Location \/media&gt;\n    Require all granted\n  &lt;\/Location&gt;\n\n  RewriteEngine On\n  ProxyPass \/seafhttp http:\/\/127.0.0.1:8082\n  ProxyPassReverse \/seafhttp http:\/\/127.0.0.1:8082\n\n  RewriteRule ^\/seafhttp - [QSA,L]\n  SetEnvIf Request_URI . proxy-fcgi-pathinfo=unescape\n  SetEnvIf Authorization \"(.*)\" HTTP_AUTHORIZATION=$1\n\n  ProxyPass \/ http:\/\/127.0.0.1:8000\/\n  ProxyPassReverse \/ http:\/\/127.0.0.1:8000\/\n  ProxyPass \/ fcgi:\/\/127.0.0.1:8000\/\n  \n\nDefine VPATH \/onlyofficeds\nDefine DS_ADDRESS server.fr:88\n\n&lt;Location ${VPATH}&gt;\nRequire all granted\n  SetEnvIf Host \"^(.*)$\" THE_HOST=$1\n  RequestHeader setifempty X-Forwarded-Proto https   \/\/ https VERY important !\n  RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e\n  RequestHeader edit X-Forwarded-Host (.*) $1${VPATH}\n  ProxyAddHeaders Off\n  ProxyPass \"http:\/\/${DS_ADDRESS}\/\"\n  ProxyPassReverse \"http:\/\/${DS_ADDRESS}\/\"\n&lt;\/Location&gt;\n\n&lt;\/VirtualHost&gt;\n<\/pre>\n<ul>\n<li>\n<p id=\"configure-seafile-server-for-subfolder\">Configure Seafile Server for SUBFOLDER :<br \/>\nAdd the following config option to&nbsp;<code>seahub_settings.py<\/code>:<\/li>\n<\/ul>\n<pre><code class=\"lang-python\"># Enable Only Office\nENABLE_ONLYOFFICE = True\nVERIFY_ONLYOFFICE_CERTIFICATE = True\nONLYOFFICE_APIJS_URL = 'https:\/\/server.fr\/web-apps\/apps\/api\/documents\/api.js'\nONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods')\nONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')\n<\/code><\/pre>\n<p class=\"comments-section\">Then restart the Seafile Server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For those who want to run Onlyoffice in Seafile under Apache web server on Ubuntu 16.04, I share the correct and complet How To. I suppose you already have a seafile server running by following server manual. Install docker in Ubuntu 16.04 amd64 : $ sudo apt-get update $ sudo apt-get install \\ apt-transport-https \\ &hellip; <a href=\"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/2018\/04\/11\/onlyofficeapache\/\" class=\"more-link\">Continuer la lecture de <span class=\"screen-reader-text\">How To install Onlyoffice in Seafile with Apache on ubuntu<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,5],"tags":[],"class_list":["post-137","post","type-post","status-publish","format-standard","hentry","category-sys","category-tuto"],"_links":{"self":[{"href":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/wp-json\/wp\/v2\/posts\/137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":10,"href":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":305,"href":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/wp-json\/wp\/v2\/posts\/137\/revisions\/305"}],"wp:attachment":[{"href":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lmgc.univ-montp2.fr\/perso\/norbert-deleutre\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}