软件:onlyoffice

这是本文档旧的修订版!


onlyoffice

https://www.onlyoffice.com/zh/download-community

#访问
https://github.com/ONLYOFFICE/DocumentServer/releases
#下载ONLYOFFICE-DocumentServer-9.2.0
https://github.com/ONLYOFFICE/DocumentServer/releases/download/v9.2.0/onlyoffice-documentserver_amd64.deb
sha256:2a42e5c47080650a70d2d5e7f9df9c126a37bbd5786e3bffb8adb88e8a01843e
onlyoffice-documentserver_amd64.deb
scp .\onlyoffice-documentserver_amd64.deb user@example.com:/home/user

sudo apt install postgresql libstdc++6 nginx
sudo apt install redis-server
sudo apt install rabbitmq-server
sudo apt install nginx-extras

#/etc/apt/sources.list 添加 contrib non-free
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-backports main contrib non-free non-free-firmware
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
sudo apt install ttf-mscorefonts-installer

sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH PASSWORD 'onlyoffice';"
sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice OWNER onlyoffice;"
sudo -i -u postgres psql -c "ALTER ROLE onlyoffice WITH LOGIN CREATEDB;"


scp .\onlyoffice-documentserver_amd64.deb user@example.com:/home/user
sudo apt install ./onlyoffice-documentserver_amd64.deb
软件包设置Database Password:输入数据库密码
sudo systemctl start ds-*
http://example.com/welcome/
sudo systemctl start ds-example
sudo systemctl enable ds-example
sudo systemctl start ds-adminpanel
sudo systemctl enable ds-adminpanel
http://example.com/admin/

sudo vi /etc/onlyoffice/documentserver/local.json
services.CoAuthoring.secret.browser.string

PASSWORD="YourPassword"; I=600000; S=$(openssl rand -base64 16 | tr -d '\n'); H=$(openssl kdf -binary -keylen 32 -kdfopt digest:SHA256 -kdfopt pass:UTF8:"$PASSWORD" -kdfopt salt:base64:"$S" -kdfopt iter:$I PBKDF2 | base64 | tr -d '\n'); echo "\$pbkdf2-sha256\$$I\$$S\$$H"




#修改端口 <PORT_NUMBER>=80
echo onlyoffice-documentserver onlyoffice/ds-port select <PORT_NUMBER> | sudo debconf-set-selections
echo onlyoffice-documentserver onlyoffice/db-host string <DB_HOST> | sudo debconf-set-selections
echo onlyoffice-documentserver onlyoffice/db-user string <DB_USER> | sudo debconf-set-selections
echo onlyoffice-documentserver onlyoffice/db-pwd password <DB_PASSWORD> | debconf-set-selections
echo onlyoffice-documentserver onlyoffice/db-name string <DB_NAME> | sudo debconf-set-selections

sudo systemctl start ds-example
sudo systemctl enable ds-example
http://example.com/example/
sudo systemctl start ds-adminpanel
sudo systemctl enable ds-adminpanel
http://example.com/admin/
sudo systemctl status ds-docservice
sudo vi /etc/onlyoffice/documentserver/local.json

{
  "services": {
    "CoAuthoring": {
      "secret": {
        "inbox": {
          "string": "secret"
        },
        "outbox": {
          "string": "secret"
        }
      },
      "token": {
        "enable": {
          "browser": true,
          "request": {
            "inbox": true,
            "outbox": true
          }
        }
      }
    }
  }
}

systemctl restart ds-*

<?php
function jwtEncode($payload) {
    return \Firebase\JWT\JWT::encode($payload, $GLOBALS["DOC_SERV_JWT_SECRET"]);
}
?>
  • 软件/onlyoffice.1766168823.txt.gz
  • 最后更改: 2026/01/02 02:07
  • (外部编辑)