FreeBSD 中文社区 2025 第二季度问卷调查
FreeBSD 中文社区(CFC)
VitePress 镜像站QQ 群 787969044视频教程Ⅰ视频教程Ⅱ
  • FreeBSD 从入门到追忆
  • 中文期刊
  • 状态报告
  • 发行说明
  • 手册
  • 网络文章集锦
  • 笔记本支持报告
  • Port 开发者手册
  • 架构手册
  • 开发者手册
  • 中文 man 手册
  • 文章与书籍
  • UNIX 四分之一世纪
  • Unix 痛恨者手册
  • FreeBSD 从入门到追忆(第三版:草稿)
  • 编辑日志
  • 贡献指南与开放任务
  • 目录
  • 前言
    • 致读者
    • 致谢
    • 初版序言:好望角与塔吊
    • 再版序言:回到复制粘贴,面向教程本身
    • 三版序言:且有大觉而后知此其大梦也(草稿)
    • 本书的组织结构
    • 本书中使用的一些约定
  • 第 1 章 FreeBSD 初见
    • 第 1.1 节 操作系统的历程:UNIX、BSD、Linux 的演化
    • 第 1.2 节 欢迎来到 FreeBSD
    • 第 1.3 节 关于 FreeBSD 项目
    • 第 1.4 节 George Berkeley(乔治·贝克莱)与 BSD 命名的文化背景
    • 第 1.5 节 加州大学伯克利分校与“Fiat Lux”(要有光)
  • 第 2 章 安装 FreeBSD
    • 第 2.1 节 安装前的准备工作
    • 第 2.2 节 使用 bsdinstall 开始安装
    • 第 2.3 节 键盘布局和主机名
    • 第 2.4 节 选择安装组件
    • 第 2.5 节 分配磁盘空间
    • 第 2.6 节 设置 root 密码
    • 第 2.7 节 网络设置
    • 第 2.8 节 时区、服务、安全、固件和账户
    • 第 2.9 节 完成安装
    • 第 2.10 节 故障排除
  • 第 3 章 FreeBSD 基础
    • 第 3.1 节 Windows 用户迁移指南
    • 第 3.2 节 Linux 用户迁移指南
    • 第 3.3 节 虚拟控制台和终端
    • 第 3.4 节 认识 shell
    • 第 3.5 节 命令行基础
    • 第 3.6 节 文本编辑器
    • 第 3.7 节 用户和基本账户管理
    • 第 3.8 节 权限
    • 第 3.9 节 sudo 与 doas
    • 第 3.10 节 文件系统的挂载与卸载
    • 第 3.11 节 磁盘结构
    • 第 3.12 节 目录结构
  • 第 4 章 软件管理与系统升级
    • 第 4.1 节 FreeBSD 镜像站现状
    • 第 4.2 节 更换 FreeBSD 软件源
    • 第 4.3 节 gitup 的用法
    • 第 4.4 节 使用 pkg 管理二进制包
    • 第 4.5 节 使用 Ports 以源代码方式安装软件
    • 第 4.6 节 使用 DVD 安装软件
    • 第 4.7 节 使用 freebsd-update 更新 FreeBSD
    • 第 4.8 节 使用源代码更新 FreeBSD
    • 第 4.9 节 使用 pkgbase 更新 FreeBSD
  • 第 5 章 桌面环境
    • 第 5.1 节 Intel 与 AMD 显卡驱动
    • 第 5.2 节 NVIDIA 显卡驱动
    • 第 5.3 节 KDE6
    • 第 5.4 节 GNOME
    • 第 5.5 节 Mate
    • 第 5.6 节 Xfce
    • 第 5.7 节 Cinnamon
    • 第 5.8 节 Lumina
    • 第 5.9 节 LXQt
    • 第 5.10 节 Budgie
    • 第 5.11 节 CDE
    • 第 5.12 节 LXDE
    • 第 5.13 节 主题美化
    • 第 5.14 节 远程桌面
    • 第 5.15 节 启用 root 桌面登录
  • 第 6 章 本地化——i18n/L10n
    • 第 6.1 节 本地化环境变量
    • 第 6.2 节 Fcitx 输入法框架
    • 第 6.3 节 IBus 输入法框架
    • 第 6.4 节 五笔输入法
    • 第 6.5 节 网络浏览器
    • 第 6.6 节 QQ(Linux 版)
    • 第 6.7 节 更换字体
    • 第 6.8 节 金山 WPS(Linux 版)
    • 第 6.9 节 压缩与解压
    • 第 6.10 节 微信(Linux 版)
  • 第 7 章 多媒体与外部设备
    • 第 7.1 节 音频设备配置
    • 第 7.2 节 蓝牙
    • 第 7.3 节 打印机
    • 第 7.4 节 触摸板
    • 第 7.5 节 音频播放器
    • 第 7.6 节 视频播放器
    • 第 7.7 节 多媒体处理工具
  • 第 8 章 代理服务器
    • 第 8.1 节 HTTP 代理
    • 第 8.2 节 V2ray
    • 第 8.3 节 Mihomo(原 Clash)
    • 第 8.4 节 OpenVPN
  • 第 9 章 Jail
    • 第 9.1 节 配置 Jail
    • 第 9.2 节 更新 jail
    • 第 9.3 节 使用 Qjail 管理 Jail
    • 第 9.4 节 Linux Jail
  • 第 10 章 虚拟化与容器
    • 第 10.1 节 通过 BVCP 以网页管理 BHyve
    • 第 10.2 节 使用 bhyve 安装 Windows 11(vm-bhyve)
    • 第 10.3 节 Podman
    • 第 10.4 节 在 FreeBSD 上安装 VirtualBox
  • 第 11 章 FreeBSD 安装实践
    • 第 11.1 节 使用 Hyper-V 安装 FreeBSD
    • 第 11.2 节 使用 VMware Workstation Pro 安装 FreeBSD
    • 第 11.3 节 使用 Virtual Box 安装 FreeBSD
    • 第 11.4 节 手动安装双系统(先安装 FreeBSD)
    • 第 11.5 节 手动安装双系统(后安装 FreeBSD)
    • 第 11.6 节 基于 Apple M1 & Parallels Desktop 20 安装 FreeBSD
    • 第 11.7 节 基于 Apple M1 & VMware Fusion Pro 安装 FreeBSD
    • 第 11.8 节 使用 Qemu 安装 RISC-V FreeBSD(基于 x86 Windows)
    • 第 11.9 节 云服务器安装 FreeBSD(基于腾讯云轻量云)
    • 第 11.10 节 配置 rEFInd(双系统用)
  • 第 12 章 窗口管理器
    • 第 12.1 节 bspwm
    • 第 12.2 节 IceWM
    • 第 12.3 节 i3wm
    • 第 12.4 节 Hyprland
    • 第 12.5 节 Window Maker
    • 第 12.6 节 Fluxbox
  • 第 13 章 FreeBSD 系统管理
    • 第 13.1 节 引导界面与虚拟控制台
    • 第 13.2 节 管理 FreeBSD 中的服务
    • 第 13.3 节 bsdconfig 系统配置工具
    • 第 13.4 节 SSH 配置与相关工具
    • 第 13.5 节 单用户模式与密码重置
    • 第 13.6 节 Grub & UEFI 与 efibootmgr
  • 第 14 章 网络管理
    • 第 14.1 节 设置网络
    • 第 14.2 节 无线网络
    • 第 14.3 节 USB 网络共享(USB tethering)
    • 第 14.4 节 TCP 堆栈
  • 第 15 章 FreeBSD 防火墙
    • 第 15.1 节 Fail2Ban(基于 IPFW、PF、IPF)
    • 第 15.2 节 Packet Filter(PF)
    • 第 15.3 节 IPFilter(IPF)
    • 第 15.4 节 ipfirewall(IPFW)
  • 第 16 章 服务器
    • 第 16.1 节 FTP 服务器
    • 第 16.2 节 MinIO 对象存储服务
    • 第 16.3 节 Gitlab-EE
    • 第 16.4 节 时间服务
    • 第 16.5 节 WildFly
    • 第 16.6 节 Rsync 同步服务
    • 第 16.7 节 Samba 服务器
    • 第 16.8 节 NFS 服务器
    • 第 16.9 节 Webmin
  • 第 17 章 Web 服务器与监控平台
    • 第 17.1 节 Apache
    • 第 17.2 节 Nginx
    • 第 17.3 节 PHP 8.X
    • 第 17.4 节 Zabbix 监控(基于 PostgreSQL)
    • 第 17.5 节 NextCloud——基于 PostgreSQL
    • 第 17.6 节 Telegraf+InfluxDB+Grafana 监控平台
    • 第 17.7 节 AList
    • 第 17.8 节 Prometheus 监控部署
    • 第 17.9 节 Tomcat
    • 第 17.10 节 Caddy
    • 第 17.11 节 OnlyOffice(基于 PostgreSQL)
  • 第 18 章 嵌入式平台
    • 第 18.1 节 树莓派简介与配件选用
    • 第 18.2 节 树莓派安装 FreeBSD
    • 第 18.3 节 树莓派 FreeBSD 配置
    • 第 18.4 节 树莓派与 Linux 兼容层
    • 第 18.5 节 Radxa X4(x86)
  • 第 19 章 数据库管理
    • 第 19.1 节 PostgreSQL
    • 第 19.2 节 pgAdmin4
    • 第 19.3 节 MySQL 5.X
    • 第 19.4 节 MySQL 8.X
    • 第 19.5 节 MongoDB 8.0
  • 第 20 章 游戏、科学计算与专业工具
    • 第 20.1 节 游戏
    • 第 20.2 节 我的世界(Minecraft)
    • 第 20.3 节 科研与专业工具
  • 第 21 章 Linux 二进制兼容层
    • 第 21.1 节 Linux 兼容层实现
    • 第 21.2 节 RockyLinux 兼容层(FreeBSD Port)
    • 第 21.3 节 Ubuntu/Debian 兼容层
    • 第 21.4 节 ArchLinux 兼容层(基于 ArchLinux bootstrap)
    • 第 21.5 节 ArchLinux 兼容层(基于 archlinux-pacman)
    • 第 21.6 节 OpenSUSE 兼容层
    • 第 21.7 节 Gentoo Linux 兼容层
    • 第 21.8 节 Rocky Linux 兼容层
    • 第 21.9 节 Slackware Linux 兼容层
    • 第 21.10 节 Deepin 兼容层
    • 第 21.11 节 故障排除与未竟事宜
  • 第 22 章 开发生态与贡献社区
    • 第 22.1 节 如何报告 Bug
    • 第 22.2 节 如何开发一个 Port
    • 第 22.3 节 如何参与 FreeBSD 开发
    • 第 22.4 节 C/C++ 环境的配置
    • 第 22.5 节 Java 环境的配置
    • 第 22.6 节 QT 环境的配置
    • 第 22.7 节 Python 与 VS Code
    • 第 22.8 节 Rust/Go 环境的配置
    • 第 22.9 节 配置 Shell
    • 第 22.10 节 通过 IDA 7 调试 FreeBSD
    • 第 22.11 节 如何订阅 FreeBSD 的邮件列表
    • 第 22.12 节 code-server 和 clangd
    • 第 22.13 节 Node.js
    • 第 22.14 节 利用脚本自动生成 BSDlibc 库文本
  • 第 23 章 存储管理与文件系统
    • 第 23.1 节 自动挂载文件系统
    • 第 23.2 节 ZFS 文件系统
    • 第 23.3 节 磁盘扩容与分区调整
    • 第 23.4 节 Windows 文件系统
    • 第 23.5 节 Swap 交换分区的设置
    • 第 23.6 节 Linux 文件系统
  • 第 24 章 DragonFly BSD 入门
    • 第 24.1 节 DragonFly BSD 概述
    • 第 24.2 节 安装 DragonFly BSD
    • 第 24.3 节 配置 DragonFly BSD
  • 第 25 章 TwinCAT/BSD 入门
    • 第 25.1 节 TwinCAT/BSD 系统安装与基本配置
    • 第 25.2 节 TwinCAT/BSD 开发环境配置
  • 第 26 章 OpenBSD 入门
    • 第 26.1 节 OpenBSD 概述
    • 第 26.2 节 安装 OpenBSD
    • 第 26.3 节 配置 OpenBSD
    • 第 26.4 节 OpenBSD 包管理器
    • 第 26.5 节 桌面与其他软件
    • 第 26.6 节 在 RISC-V 开发板上安装 OpenBSD
    • 第 26.7 节 树莓派与 OpenBSD
  • 第 27 章 NetBSD 入门
    • 第 27.1 节 NetBSD 概述
    • 第 27.2 节 NetBSD 安装图解
    • 第 27.3 节 NetBSD 换源与包管理器
    • 第 27.4 节 桌面与中文环境常用软件
  • 附录 Ⅰ 计算机概论
    • 存储卡参数简介与测试
    • 总线接口与协议
    • 网络基础
    • 操作系统
    • MySQL 数据库
  • 附录 Ⅱ 工具与资源
    • 适用于 FreeBSD 的以太网卡、USB 以太网卡和 USB 无线网卡
    • BSD 许可证概览
    • FreeBSD 桌面发行版评述
  • 附录 Ⅲ 文学故事
    • 我与 FreeBSD 的故事
    • 两次告别
    • 小说:大教堂与集市
    • 小说:吾乡何处
    • 小说:你与暗
    • 诗歌选
    • 杂记
  • 附录 Ⅳ 参考文献与术语
    • 参考书目
    • 术语表
由 GitBook 提供支持
LogoLogo

FreeBSD 中文社区(CFC) 2025

在本页
  • 安装
  • 查看安装后配置
  • 配置服务
  • 配置数据库
  • 配置 rabbitmq
  • 允许局域网访问
  • 配置 nginx
  • 配置 supervisord
  • 启动文档
  • 配置 NextCloud
  • 完成
  • 参考文献
  • 故障排除与未竟事宜
在GitHub上编辑
导出为 PDF
  1. 第 17 章 Web 服务器与监控平台

第 17.11 节 OnlyOffice(基于 PostgreSQL)

首先在其他机器上安装 nextcloud。

安装

# pkg install onlyoffice-documentserver

或者

# cd /usr/ports/www/onlyoffice-documentserver/ 
# make install clean

查看安装后配置

root@ykla:~ # pkg info -D onlyoffice-documentserver
onlyoffice-documentserver-8.2.0.143_4:
On install:
CONFIGURATION:
-------------
# 配置:
# 以下是有关如何配置 OnlyOffice 文档服务器的详细说明。

The configuration file can be found (or created) at the following path:
  /usr/local/etc/onlyoffice/documentserver/local.json
# 配置文件位于以下路径(或创建):
# /usr/local/etc/onlyoffice/documentserver/local.json

The default values are available in the default.json configuration file,
which is available in the folders above. Please do not edit the contents of the
default.json file directly. The default values will be restored each time you
upgrade Document Server to a new version and all your changes will be lost.
# 默认值可以在 default.json 配置文件中找到,该文件位于上述文件夹中。
# 请不要直接编辑 default.json 文件的内容,因为每次升级文档服务器时,所有更改都会丢失,恢复默认值。

1. Enable services at startup in the /etc/rc.conf file:
  nginx_enable="YES"
  rabbitmq_enable="YES"
  supervisord_enable="YES"
# 1. 在 /etc/rc.conf 文件中启用启动时的服务:
#   设置 nginx_enable="YES"
#   设置 rabbitmq_enable="YES"
#   设置 supervisord_enable="YES"

  Optionally in case of a jail with local IP and no internet access:
    update /etc/hosts in order to resolve your nextcloud server to its local IP
# 如果在没有互联网访问的 jail 环境中运行(本地 IP),可以选择:
# 更新 /etc/hosts 文件,以将 Nextcloud 服务器解析到其本地 IP。

2. Install a database server and set up the database (either PostgreSQL or MySQL):
  For PostgreSQL (don't forget to change the password):
    # service postgresql initdb
    # service postgresql start
    # psql -U postgres -c "CREATE DATABASE onlyoffice;"
    # psql -U postgres -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
    # psql -U postgres -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
    # psql -U postgres -c "ALTER DATABASE onlyoffice OWNER to onlyoffice;"
    # psql -hlocalhost -Uonlyoffice -d onlyoffice -f /usr/local/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
# 2. 安装数据库服务器并设置数据库(可选 PostgreSQL 或 MySQL):
# 对于 PostgreSQL(别忘了更改密码):
#   初始化数据库、启动 PostgreSQL 服务并创建所需数据库和用户。

    Optionally in case of a jail with local IP:
      update /var/db/postgres/data13/pg_hba.conf accordingly
# 如果是在本地 IP 的 jail 环境中运行,还可以选择更新 /var/db/postgres/data13/pg_hba.conf 文件。

  For MySQL don't forget to change the password):
    # service mysql-server start
    # mysql -u root -p -e "CREATE DATABASE onlyoffice DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;"
    # mysql -u root -p -e "CREATE USER 'onlyoffice'@'localhost' IDENTIFIED BY 'onlyoffice';"
    # mysql -u root -p -e "GRANT ALL privileges ON  onlyoffice.* TO 'onlyoffice'@'localhost';"
    # mysql -u onlyoffice -D onlyoffice -p < /usr/local/www/onlyoffice/documentserver/server/schema/mysql/createdb.sql
# 对于 MySQL(别忘了更改密码):
#   启动 MySQL 服务并创建所需数据库、用户及权限。

3. Create a new rabbitmq user for the ONLYOFFICE Document Server configuration (don't forget to change the password):
  # service rabbitmq start
  # rabbitmqctl --erlang-cookie `cat /var/db/rabbitmq/.erlang.cookie` add_user onlyoffice password
  # rabbitmqctl --erlang-cookie `cat /var/db/rabbitmq/.erlang.cookie` set_user_tags onlyoffice administrator
  # rabbitmqctl --erlang-cookie `cat /var/db/rabbitmq/.erlang.cookie` set_permissions -p / onlyoffice ".*" ".*" ".*"
  and change it in /usr/local/etc/onlyoffice/documentserver/local.json accordingly.
# 3. 为 ONLYOFFICE 文档服务器配置创建新的 rabbitmq 用户(别忘了更改密码):
#   启动 rabbitmq 服务并添加新用户并设置权限,确保在配置文件 `/usr/local/etc/onlyoffice/documentserver/local.json` 中做相应更改。

4. Set up supervisord in order to execute documentserver services:
  - let supervisord.conf load files contained in this directory by adding to
    /usr/local/etc/supervisord.conf:
[include]
files = /usr/local/etc/onlyoffice/documentserver/supervisor/*.conf

  - start supervisord:
    # service supervisord start
# 4. 设置 supervisord 来执行文档服务器服务:
#   配置 supervisord 加载文件,并启动 supervisord 服务。

5. Set up nginx:
  - For HTTP include the following in your /usr/local/etc/nginx/nginx.conf file:
      include /usr/local/etc/onlyoffice/documentserver/nginx/ds.conf;
# 5. 设置 nginx:
#   为 HTTP 设置 Nginx 配置,确保在 nginx.conf 文件中包含 ds.conf 配置。

NOTE: documentserver-update-securelink.sh will only update ./nginx/ds.conf and local.json under /usr/local/etc/onlyoffice/documentserver/!
  - run documentserver-update-securelink.sh once for creationg a verysecretstring

  - start nginx:
    # service nginx start
# 注意:documentserver-update-securelink.sh 仅会更新 ./nginx/ds.conf 和 /usr/local/etc/onlyoffice/documentserver/ 下的 local.json 文件!
#   运行该脚本一次以生成一个 secret 字符串,并启动 nginx 服务。

6. Follow the following doc If you want to use Onlyoffice with Nextcloud:
  - https://api.onlyoffice.com/editors/nextcloud
# 6. 如果你想将 OnlyOffice 与 Nextcloud 配合使用,请参考以下文档:
#   https://api.onlyoffice.com/editors/nextcloud

7. Install OnlyOffice plugins (you'll need internet):
  # /usr/local/bin/documentserver-pluginsmanager.sh --update=/usr/local/www/onlyoffice/documentserver/sdkjs-plugins/plugin-list-default.json
# 7. 安装 OnlyOffice 插件(需要互联网连接):
#   使用插件管理器更新插件列表。

8. Enjoy.
# 8. 完成安装,享受使用 OnlyOffice 的体验。

On upgrade from onlyoffice-documentserver<7.1.0.215:
If you are upgrading onlyoffice-documentserver from a version prior to 7.1.0.215,
you need to update the database schema:
  For PostgreSQL:
    psql -U postgres -d onlyoffice -f /usr/local/www/onlyoffice/documentserver/server/schema/postgresql/upgrade/upgradev710.sql
  For MySQL:
    mysql -u onlyoffice -D onlyoffice -p < /usr/local/www/onlyoffice/documentserver/server/schema/mysql/upgrade/upgradev710.sql
# 从 onlyoffice-documentserver<7.1.0.215 升级:
#   如果是从较旧版本(7.1.0.215 之前)升级,需要更新数据库模式:
#   PostgreSQL 和 MySQL 的更新命令。

On upgrade from onlyoffice-documentserver>7.1.0.215<7.2.1.34:
If you are upgrading onlyoffice-documentserver from a version prior to 7.2.1.34,
you need to update the database schema:
  For PostgreSQL:
    psql -U postgres -d onlyoffice -f /usr/local/www/onlyoffice/documentserver/server/schema/postgresql/upgrade/upgradev720.sql
  For MySQL:
    mysql -u onlyoffice -D onlyoffice -p < /usr/local/www/onlyoffice/documentserver/server/schema/mysql/upgrade/upgradev720.sql
# 从 onlyoffice-documentserver>7.1.0.215<7.2.1.34 升级:
#   如果是从 7.2.1.34 之前的版本升级,需要更新数据库模式:
#   PostgreSQL 和 MySQL 的更新命令。

配置服务

# service nginx enable
# service rabbitmq enable
# service supervisord enable

配置数据库

# pkg install postgresql16-server
# service postgresql enable
# service postgresql initdb
# service postgresql start
# psql -U postgres -c "CREATE DATABASE onlyoffice;"
# psql -U postgres -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
# psql -U postgres -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
# psql -U postgres -c "ALTER DATABASE onlyoffice OWNER to onlyoffice;"
# psql -hlocalhost -Uonlyoffice -d onlyoffice -f /usr/local/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql

配置 rabbitmq

开启服务:

# service rabbitmq start

第一步:

# rabbitmqctl --erlang-cookie `cat /var/db/rabbitmq/.erlang.cookie` add_user onlyoffice password  # 注意:会卡几分钟,下同

Error: unable to perform an operation on node 'rabbit@ykla'. Please see diagnostics information and suggestions below.

Most common reasons for this are:

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
 * Target node is not running

In addition to the diagnostics info below:

 * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@ykla
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact: [rabbit@ykla]

rabbit@ykla:
  * connected to epmd (port 4369) on ykla
  * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
  * can't establish TCP connection to the target node, reason: timeout (timed out)
  * suggestion: check if host 'ykla' resolves, is reachable and ports 25672, 4369 are not blocked by firewall

Current node details:
 * node name: 'rabbitmqcli-719-rabbit@ykla'
 * effective user's home directory: /root
 * Erlang cookie hash: mmhdcv/DKEfjrCrCEaZMvQ==

第二步:

# rabbitmqctl --erlang-cookie `cat /var/db/rabbitmq/.erlang.cookie` set_user_tags onlyoffice administrator
Error: unable to perform an operation on node 'rabbit@ykla'. Please see diagnostics information and suggestions below.

Most common reasons for this are:

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
 * Target node is not running

In addition to the diagnostics info below:

 * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@ykla
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact: [rabbit@ykla]

rabbit@ykla:
  * connected to epmd (port 4369) on ykla
  * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
  * can't establish TCP connection to the target node, reason: timeout (timed out)
  * suggestion: check if host 'ykla' resolves, is reachable and ports 25672, 4369 are not blocked by firewall

Current node details:
 * node name: 'rabbitmqcli-882-rabbit@ykla'
 * effective user's home directory: /root
 * Erlang cookie hash: mmhdcv/DKEfjrCrCEaZMvQ==

第三步:

root@ykla:~ #  rabbitmqctl --erlang-cookie `cat /var/db/rabbitmq/.erlang.cookie` set_permissions -p / onlyoffice ".*" ".*" ".*"
Error: unable to perform an operation on node 'rabbit@ykla'. Please see diagnostics information and suggestions below.

Most common reasons for this are:

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
 * Target node is not running

In addition to the diagnostics info below:

 * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@ykla
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact: [rabbit@ykla]

rabbit@ykla:
  * connected to epmd (port 4369) on ykla
  * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
  * can't establish TCP connection to the target node, reason: timeout (timed out)
  * suggestion: check if host 'ykla' resolves, is reachable and ports 25672, 4369 are not blocked by firewall

Current node details:
 * node name: 'rabbitmqcli-636-rabbit@ykla'
 * effective user's home directory: /root
 * Erlang cookie hash: mmhdcv/DKEfjrCrCEaZMvQ==

允许局域网访问

onlyoffice 默认的配置,不允许私有地址访问。故需将以下片段加入 /usr/local/etc/onlyoffice/documentserver/local.json:

  "request-filtering-agent" : {
				"allowPrivateIPAddress": true,
				"allowMetaIPAddress": true
			},

即:

{
  "services": {
    "CoAuthoring": {
      "sql": {
        "type": "postgres",
        "dbHost": "localhost",
        "dbPort": "5432",
        "dbName": "onlyoffice",
        "dbUser": "onlyoffice",
        "dbPass": "onlyoffice"
      },
  "request-filtering-agent" : {
				"allowPrivateIPAddress": true,
				"allowMetaIPAddress": true
			},
      "token": {
        "enable": {
          "request": {
            "inbox": false,
            "outbox": false
          },
          "browser": false

……省略……

配置 nginx

编辑 /usr/local/etc/nginx/nginx.conf

把

include /usr/local/etc/onlyoffice/documentserver/nginx/ds.conf;

放到 http 的括号里:

示例:

……省略……
http {
    include       mime.types;
    default_type  application/octet-stream;
    include /usr/local/etc/onlyoffice/documentserver/nginx/ds.conf;

……省略……

配置 supervisord

编辑 /usr/local/etc/supervisord.conf,翻到最底下,找到 ;[include],并删去前面的分号:

即:

[include]
;files = relative/directory/*.ini
files = /usr/local/etc/onlyoffice/documentserver/supervisor/*.conf
# service supervisord start

启动文档

root@ykla:~ # documentserver-update-securelink.sh
ds:docservice: stopped
ds:docservice: started
ds:converter: stopped
ds:converter: started
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful

直接打开 IP 地址,应如下图所示:

配置 NextCloud

打开 NextCloud:

安装 onlyoffice 插件,可以直接访问 ip/nextcloud/index.php/settings/apps/office/onlyoffice:

点击头像——> 管理设置,找到 onlyoffice,设置如下(注意看看那个密钥是不是真的为空)

完成

随便预览几个文件:

参考文献

  • How to allow Private IP to access onlyOffice documentServer?

故障排除与未竟事宜

可以看日志 cat /var/log/onlyoffice/documentserver/converter/out.log。

上一页第 17.10 节 Caddy下一页第 18.1 节 树莓派简介与配件选用

最后更新于1天前

Document Server is running
onlyoffice
onlyoffice
onlyoffice
onlyoffice
onlyoffice