手动使用Server packages搭建Community Server
--------安装Mono
--------安装Node.js
--------安装Nginx
--------安装Community Server
--------开启Https访问
----------------脚本自动执行
----------------手动配置SSL(不推荐)")
自动安装
--------使用Docker容器安装
--------One click install 在线一件安装

对接在线编辑Document server请参考


ONLYOFFICE Community Server介绍,功能,硬软件配置要求


介绍:
Community Server is a free open source collaborative system developed to manage documents, projects, customer relationship and email correspondence, all in one place.
社区服务器是一个免费的开源协作系统,用于管理文档,项目,客户关系和电子邮件通信,所有这些都集中在一个地方。

Functionality

  • Cross platform solution: Linux, Windows
  • Document management
  • Integration with Google Drive, Box, Dropbox, OneDrive, OwnCloud
  • File sharing
  • Document embedding
  • Access rights management
  • Customizable CRM
  • Web-to-lead form
  • Invoicing system
  • Project Management
  • Gantt Chart
  • Milestones, task dependencies and subtasks
  • Time tracking
  • Automated reports
  • Blogs, forums, polls, wiki
  • Calendar
  • Email Aggregator
  • People module (employee database)
  • Instant Messenger
  • Support of more than 20 languages

System requirements

  • CPU:dual core 2 GHz or better
  • RAM:2 GB or more
  • HDD:at least 2 GB of free space
  • Additional Requirements:at least 2 GB of swap
  • OS:amd64 Linux distribution with kernel version 3.10 or later
  • Additional Requirements

    • Mono: version 4.2 or later
    • MySQL: version 5.5 or later
    • Node.js: version 6.10.3 or later
    • NGINX

Community Edition , Integration Edition , Developer Edition功能有所不同,只有社区版免费

github主页: https://github.com/ONLYOFFICE/DocumentServer
服务器包下载区:https://www.onlyoffice.com/download.aspx

注意:社区版服务器是一套管理面板而不是能在线编辑文件的Document-server,如果需要在线编辑文件功能,需要搭建Onlyoffice-Documentserver然后在社区版服务器器面版设置-文档设置中,按照example的格式填写document-server的api.js文件地址进行调用.

手动使用Server packages搭建Community Server

官方参考:https://helpcenter.onlyoffice.com/server/linux/community/linux-installation.aspx
本文操作使用的是Ubuntu16.04
拿到手的新vps先更新一下

apt-get update
apt-get upgrade -y

安装Mono

官方参考: https://www.mono-project.com/download/stable/#download-lin-ubuntu
将Mono仓库添加到系统

Ubuntu18.04 (i386, amd64, armhf, arm64, ppc64el)

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update

Ubuntu16.04 (i386, amd64, armhf, arm64, ppc64el)

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt install apt-transport-https
echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update

Ubuntu14.04 (i386, amd64, armhf, arm64, ppc64el)

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt install apt-transport-https
echo "deb https://download.mono-project.com/repo/ubuntu stable-trusty main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update

安装Mono

sudo apt install mono-devel

The package mono-devel should be installed to compile code.

The package mono-complete should be installed to install everything - this should cover most cases of "assembly not found" errors.

The package mono-dbg should be installed to get debugging symbols for framework libraries - allowing you to get line numbers in stack traces.

The package referenceassemblies-pcl should be installed for PCL compilation support - this will resolve most cases of "Framework not installed: .NETPortable" errors during software compilation.

The package ca-certificates-mono should be installed to get SSL certificates for HTTPS connections. Install this package if you run into trouble making HTTPS connections.

The package mono-xsp4 should be installed for running ASP.NET applications.

安装Node.js

官方文档: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

我安装了6.x

curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get install nodejs

8.x

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

10.x

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

安装Nginx

sudo apt-get install nginx

Ubuntu安装之后的文件结构大致为:

  • 所有的配置文件都在/etc/nginx下,并且每个虚拟主机已经安排在了/etc/nginx/sites-available下
  • 程序文件在/usr/sbin/nginx
  • 日志放在了/var/log/nginx中
  • 并已经在/etc/init.d/下创建了启动脚本nginx
  • 默认的虚拟主机的目录设置在了/var/www/nginx-default (有的版本 默认的虚拟主机的目录设置在了/var/www, 请参考/etc/nginx/sites-available里的配置)

安装Community Server

添加GPG key:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5

添加源

sudo echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list
虽然APT包是针对Debian Squeeze构建的,但它与许多Debian衍生产品(包括Ubuntu)兼容,这意味着您可以在所有这些发行版中使用相同的存储库。

更新源并安装

sudo apt-get update
sudo apt-get install onlyoffice-communityserver

安装完后即可通过ip地址访问,但是如果需要https请继续往下看

开启Https访问

(我使用了二级域名A记录解析了ip)
官方参考:https://helpcenter.onlyoffice.com/server/linux/community/switch-to-https.aspx

脚本自动执行

准备:

  • /var/www/onlyoffice/Data/certs/onlyoffice.crt (必须是.crt下文脚本不识别.cer)
  • /var/www/onlyoffice/Data/certs/onlyoffice.key

如果需要使用letsencrypt新建请参考https://helpcenter.onlyoffice.com/server/enterprise/linux/community/switch-to-https.aspx

这里我使用之前用lnmp脚本从letsencrypt申请的泛域名证书,直接使用fullchain.cerjoooe.xyz.key

注意由于脚本只识别.crt证书,所以编辑.cer证书并把里面的内容复制到新空白文件,注意证书和密钥都改名为onlyoffice,注意文件位置,必须和准备中的位置和名字保持一致,然后运行脚本,脚本会自动完成所有工作.

sudo bash /var/www/onlyoffice/Tools/default-onlyoffice-ssl.sh

完成后,可以通过https://域名 打开控制面板的首次注册页面

注意:如果上述过程中证书或密钥出现问题(如没证书是.cer格式的)导致脚本失败,则根据脚本提供的错误信息逐一排错
nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/includes/onlyoffice-communityserver-common.conf:19报错参考


nginx: [emerg] PEM_read_bio_X509_AUX("/var/www/onlyoffice/Data/certs//onlyoffice.crt") failed (SSL: error:0906D06C:PEM routines:PE 报错参考

手动配置SSL(不推荐)

停止Nginx

sudo service nginx stop

/etc/nginx/includes/onlyoffice-communityserver-common-ssl.conf.template复制到/etc/nginx/sites-available/onlyoffice

sudo cp -f /etc/nginx/includes/onlyoffice-communityserver-common-ssl.conf.template /etc/nginx/sites-available/onlyoffice

编辑/etc/nginx/sites-available/onlyoffice更改实际使用的双花括号{{...}}中的所有参数,按需填写

{{SSL_CERTIFICATE_PATH}} - the path to the SSL certificate you have got;
{{SSL_KEY_PATH}} - the path to the SSL certificate private key;
{{SSL_VERIFY_CLIENT}} - whether or not the verification of client certificates is enabled (with available values of on, off, optional and optional_no_ca);
{{CA_CERTIFICATES_PATH}} - the path to the client certificate which will be verified if enabled with the previous parameter;
{{ONLYOFFICE_HTTPS_HSTS_MAXAGE}} - advanced configuration option for setting the HSTS max-age in the Community Server NGINX vHost configuration, and applicable only when SSL is in use (usually defaults to 31536000 which is considered to be safe enough);
{{SSL_DHPARAM_PATH}} - the path to the Diffie-Hellman parameter;
{{ONLYOFFICE_NGINX_KEEPLIVE}} - the maximum number of idle keepalive connections to upstream servers that are preserved in the cache of each worker process (for more information on this parameter, please see NGINX documentation);
{{DOCKER_ONLYOFFICE_SUBNET}} - the Docker internal subnet value (in case Community Server is installed using Docker);
{{SSL_OCSP_CERTIFICATE_PATH}} - the path to a file with trusted CA certificates in the PEM format used to verify client certificates and OCSP (Online Certificate Status Protocol) responses if ssl_stapling is enabled.

打开/var/www/onlyoffice/Services/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config 配置文件并设置mail.default-api-scheme参数值为https之后重启邮件聚合器服务

onlyofficeMailAggregator restart

如需要将Talk转为TLS协议参考https://helpcenter.onlyoffice.com/server/linux/community/switch-talk-to-tls.aspx
所有更改过后重启Nginx

sudo service nginx start
Port 443 must be opened for correct portal operation.

自动安装

Onlyoffice提供了更快捷自动化的安装方法,但是并未亲自尝试

使用Docker容器安装

官方参考: https://helpcenter.onlyoffice.com/server/docker/opensource/opensource-script-installation.aspx
下载社区版脚本

wget http://download.onlyoffice.com/install/opensource-install.sh

下载后即可执行.

bash opensource-install.sh -md "yourdomain.com"

yourdomain.com是您自己的域名,将用于邮件服务器。如果您没有域名或只是想为本地服务器安装Community Edition,则可以在没有Mail Server的情况下安装它。

要使Community Edition能够运行Docker服务是必要的。安装脚本将检查计算机上是否存在该版本,并且其版本不低于所需的最小值。否则,将自动安装或更新Docker。

Docker默认指定Google DNS服务器。如果您的Community Edition服务器无法访问Internet,我们建议您将默认的Docker DNS地址更改为本地DNS服务器的地址。为此,请转至/ etc / default / docker文件,并将以下行中的IP地址更改为本地网络中DNS服务器的IP地址:
docker_OPTS="--dns 8.8.8.8"

在没有Mail Server的情况下运行Community Edition

bash opensource-install.sh -ims false

安装完成后访问ip即可.

One click install 在线一件安装

访问下面网站将安装社区版服务器和邮件服务器
https://one-click-install.onlyoffice.com/

THE END
最后修改:2022 年 04 月 27 日 21 : 05
本文链接:https://www.j000e.com/linux/onlyofficecommunityserver.html
版权声明:本文『Ubuntu16.04部署ONLYOFFICE Community Server』为『Joe』原创。著作权归作者所有。
转载说明:Ubuntu16.04部署ONLYOFFICE Community Server || Joe's Blog』转载许可类型见文末右下角标识。允许规范转载时,转载文章需注明原文出处及地址。
Last modification:April 27, 2022
If you think my article is useful to you, please feel free to appreciate