OnlyOffice (Win 版) 和 NextCloud 配合实现在线 Office 服务

OnlyOffice (Win 版) 和 NextCloud 配合实现在线 Office 服务

OnlyOffice (Win 版) 和 NextCloud 配合实现在线 Office 服务

独立观察员 2026 年 5 月 3 日

OnlyOffice 社区版安装(Windows 版)

资源

安装文档:https://helpcenter.onlyoffice.com/zh/docs/installation/docs-community-install-windows.aspx 

社区版下载:https://www.onlyoffice.com/zh/download-community#docs-community 

单独必备组件:https://download.onlyoffice.com/install/documentserver/windows/onlyoffice-documentserver-prerequisites.exe 

GitHub:https://github.com/ONLYOFFICE/DocumentServer 

连接器选择:https://www.onlyoffice.com/all-connectors 

 

官方文档

ONLYOFFICE 文档部分下载社区版安装文件

双击您刚刚下载的 onlyoffice-documentserver.exe 文件。

默认情况下,ONLYOFFICE 文档使用端口 80 监听传入连接。从版本 4.3 开始,您可以更改 ONLYOFFICE 文档的端口以替代默认端口。要更改端口,请使用以下参数运行可执行文件:
onlyoffice-documentserver.exe /DS_PORT=<PORT_NUMBER>

其中 <PORT_NUMBER> 是您希望 ONLYOFFICE 文档使用的端口号。

对于离线安装,请单独下载必备组件

文档服务器安装向导将启动。点击下一步 > 按钮以开始安装过程。

getImage
 

默认情况下,ONLYOFFICE 文档将安装到以下文件夹:C:\Program Files\ONLYOFFICE\DocumentServer\。如果需要,您可以通过点击浏览按钮并选择计算机上的所需文件夹来更改它。然后点击下一步 > 按钮。

getImage-1
 

如果您的电脑上缺少 ONLYOFFICE 文档正常工作所需的一些附加组件,这些依赖项将首先下载并安装。选择所需的组件并点击下一步 > 按钮。

getImage-2
 

点击安装按钮并等待缺少的组件安装完成。如果所需组件已安装在您的电脑上,ONLYOFFICE 文档的安装将开始。

getImage-3
 

安装过程完成后,点击完成按钮以关闭向导窗口。

getImage-4
 

如果打开 ONLYOFFICE 文档服务器演示选项被选中,社区版欢迎页面将在您的浏览器中打开。或者,您可以在浏览器的地址栏中输入 http://localhost/example。在这里,您可以找到有关如何启用文档示例或使用提供的 API在线编辑器集成到您的 Web 应用程序中的进一步说明。

 

实践

先安装需求包:

getImage-5

 

完全安装:

getImage-6

getImage-7

 

好像不能选安装目录,所以先做个系统备份:

getImage-8

 

还是会在线下载东西:

getImage-9

安好了:

getImage-10

 

下面开始安装本体(指定端口 7777):

onlyoffice-documentserver.exe /DS_PORT=7777

getImage-11

 

getImage-12

 

安装到 D 盘:

getImage-13

 

又有下载需求包,可能不需要了,不过还是勾着吧:

getImage-14

getImage-15

 

在这卡了好久:

getImage-16

 

可能有一两个小时之后弹出(也有可能是顶部这个弹窗之前没注意):

getImage-17

 

然后就安好了:

getImage-18

 

访问网页:

getImage-19

 

翻译如下:

getImage-20

getImage-21

 

集成前测试:

getImage-22

 

打开的测试页:

getImage-23

 

文档:

getImage-24

 

表格:

getImage-25

 

PPT

getImage-26

 

PDF

getImage-27

 

文件列表:

getImage-28

 

都是可以使用的,不过意思好像是不推荐直接使用这个 Example,需要使用 Connectors 来集成(https://www.onlyoffice.com/all-connectors):

getImage-29

 

可选择的还是挺多的(挑了一些截图下来):

getImage-30

getImage-31

getImage-32

getImage-33

getImage-34

 

我们这里先不管它,先给它添加为自动启动再说:

sc.exe config DsExampleSvc start=auto

getImage-35

 

之后可以用 IP 访问(之前是 localhost):

http://192.168.5.35:7777/example/

 

不过 localhost(左)和 IP(右)访问好像是两套,之前新建的文件在 IP 访问下没有了:

getImage-36

 

还可用 Frp 弄个内网穿透,本地地址写的是 127.0.0.1,最终外网访问走的是和 localhost 一套的数据。不过这个没有密码,最好不要映射到外网。

 

问了下 AI(ima-DSv3.2):

OnlyOffice 社区版(Windows 版)安好之后,可以直接使用 Example 而不是 connectors 吗?

是的,ONLYOFFICE 社区版(Windows 版)安装完成后,可以直接使用 Example 进行文档编辑和协作,而无需通过连接器(connectors)集成到其他系统

关于 Example 的使用说明

访问方式:安装并启动服务后,您可以在浏览器中直接访问 http://localhost/example/ 来打开 Example 页面。如果您在安装时指定了非默认端口(例如 8080),则访问地址应为 http://localhost:8080/example/

核心功能:Example 是一个内置的演示前端,它允许您直接体验 ONLYOFFICE 的核心功能,包括:

  • 创建和编辑文本文档、电子表格和演示文稿。
  • 上传本地文件进行在线编辑。
  • 支持实时协作编辑
  • 支持查看和编辑 PDF 文件

 

与连接器的区别:Example 是 ONLYOFFICE Document Server 自带的一个独立、完整的演示应用。而连接器(如用于 Nextcloud、Confluence、SharePoint 等的官方连接器)的作用是将 ONLYOFFICE 的文档编辑能力集成到现有的第三方平台或系统中。如果您只是想测试或单纯使用 ONLYOFFICE 的功能,而不打算将其嵌入到其他系统里,那么直接使用 Example 是完全足够且最简便的方式。

注意事项

  • JWT 令牌设置:如果您在本地通过 Example 打开文件时遇到错误,可能需要根据您的网络配置调整 JWT(JSON Web Token)设置。例如,在某些本地测试场景下,可能需要将相关配置文件中的 token 下的 enable 值设置为 false 以关闭令牌验证。但请注意,根据官方文档,本地打开文件通常需要使用令牌。
  • 服务启动:确保 ONLYOFFICE 文档服务已成功启动。在 Windows 上,安装完成后通常需要使用管理员权限运行命令 net start DsExampleSvc 来启动服务。

 

总结:对于刚安装好 ONLYOFFICE 社区版(Windows)的用户,如果想立即体验其文档编辑与协作功能,直接访问 http://localhost/example/ 是最快捷、最直接的途径,无需任何额外的连接器配置。

 

OnlyOffice 社区版(Windows 版)生成的文档储存在哪?

OnlyOffice 社区版(Windows 版)本身并不直接 “储存” 你编辑或生成的文档内容 —— 它的 Example 演示页面主要是让你在线打开、编辑和预览文档,文档的来源通常是你手动上传到它的临时会话或示例文件夹中,并不会像常规文件系统那样永久保存到你的电脑固定路径。

具体来说:

  1. 本地文件上传
    当你在 Example 页面上传文档(如 WordExcel、PPT)时,这些文件会被 OnlyOffice Document Server 读取到内存或临时工作目录进行处理和渲染,编辑后的内容如果要保存,需要你手动下载到本地指定位置,否则关闭页面后不会自动保留在服务器。

  2. 默认存储机制
    OnlyOffice 社区版的 Document Server 默认使用 /var/www/onlyoffice/Data(Linux 容器路径)或安装目录下的 data 文件夹作为工作与缓存区,但这些是服务器端临时存储,Windows 版安装包一般会把数据放在安装目录的 DocumentServer/data 或类似路径,仅供服务运行时使用,不建议当作长期文档存储位置。

  3. 持久化保存
    如果需要让文档长期保存,必须由你在编辑完成后点击下载,把文件存到自己的电脑文件夹、局域网共享盘或挂载的外部存储。社区版不自带用户文档库或数据库管理功能,所以不存在像企业版那样的集中文档库存储概念。

  4. 与连接器区别
    如果使用 Nextcloud、OnlyOffice Workspace 等连接器,文档会储存在对应系统的文件存储里(例如 Nextcloud 的 data 目录),但单纯的 Example 演示页面只是一个前端 UI,不涉及后台文档库,因此文件不会自动留存。

 

总结
OnlyOffice 社区版(Windows 版)Example 中的文档只存在于临时会话或缓存目录,编辑后需手动下载才能永久保存;它本身不提供长期文档存储功能,所有生成的文档最终位置由你决定并保存在本地或其他外部存储中。

 

官方的 DocSpace 和 WorkSpace 分别是什么用途?能当做 OnlyOffice Doc 的连接器吗?

ONLYOFFICE DocSpace 和 Workspace 是官方提供的两个核心协作平台,它们都集成了文档编辑能力,但定位和功能侧重点不同。它们本身不是连接器,但都包含并可以作为 ONLYOFFICE Document Server 的连接器使用,将文档编辑功能集成到自身平台中。

一、 核心定位与用途

  1. ONLYOFFICE DocSpace(协作空间)

    • 定位:一个专注于文档协作与安全共享的轻量化平台。它以 “房间” 为核心概念,旨在为敏捷团队、项目组或需要与外部伙伴协作的场景提供快速、安全的文档处理环境。
    • 核心功能:提供协作房间、公共房间、自定义房间和安全(私密)房间等多种房间类型,用于实时协同编辑、外部共享、模板化流程以及端到端加密的机密文件处理。它强调文档的即时协作、权限精细控制和跨组织安全共享。
  2. ONLYOFFICE Workspace

    • 定位:一个功能全面的企业级团队协作与生产力套件。它面向中大型企业,集成了在线办公、项目管理、客户关系管理(CRM)、邮件、日历、聊天等一体化功能,旨在构建一个完整的数字化工作空间。
    • 核心功能:除了包含 DocSpace 的文档协作能力,还提供了强大的项目管理(如甘特图、任务跟踪)、CRM 系统、邮件聚合与管理、以及论坛、博客等团队协作工具。它更侧重于企业工作流的全周期管理。

简单来说,DocSpace 是专注于 “文档协作” 的工具,而 Workspace 是包含文档协作在内的 “企业办公操作系统”

 

二、 与 ONLYOFFICE Document Server 及连接器的关系

ONLYOFFICE Document Server(Doc)是提供核心文档编辑、预览、协作功能的无界面服务端。它本身无法独立管理文件和用户,必须通过 “连接器” 与一个文档管理系统(DMS)集成才能发挥作用。

  1. DocSpace 和 Workspace 本身就是 “官方 DMS”
    DocSpace 和 Workspace 都内置了文件存储、用户管理和权限体系。当您使用它们时,它们就充当了 Document Server 的 “宿主” 或连接器。用户在这些平台内点击文档时,平台会生成参数调用 Document Server 打开编辑器,编辑完成后,Document Server 再通过回调接口将文件保存回平台。因此,它们可以完美地作为 Document Server 的连接器使用

  2. 与其他连接器的对比
    除了官方的 DocSpace 和 Workspace,还有许多第三方系统可以通过开发连接器与 Document Server 集成,例如 NextCloud、OwnCloud 等开源网盘。这些第三方连接器的成熟度、维护状态和体验各不相同。而 DocSpace 和 Workspace 作为官方原生平台,能确保与 Document Server 的最新功能完全兼容,并提供开箱即用的无缝体验。

 

三、 选型建议

  • 如果您的需求纯粹是团队内或跨组织的文档创建、实时编辑、安全共享和版本管理,希望快速上手且运维简单,那么 ONLYOFFICE DocSpace 是更轻量、更聚焦的选择。
  • 如果您需要一个功能完备的企业办公套件,不仅需要文档协作,还希望集成项目管理、CRM、企业邮箱、日程管理等,构建统一的数字工作台,那么 ONLYOFFICE Workspace 是更合适的选择。
  • 如果您已经拥有其他文档管理系统(如 NextCloud),并希望在其中嵌入 ONLYOFFICE 的编辑功能,那么您需要为该系统安装和配置对应的第三方连接器

 

总结:DocSpace 和 Workspace 是 ONLYOFFICE 官方提供的、集成了 Document Server 的协作平台,它们自身就是 Document Server 的 “终极连接器”。选择哪一个取决于您是需要一个专注的文档协作工具,还是一个全面的企业办公解决方案。

 

安装 NextCloud

使用 Web installer 方式安装

官网安装页面:https://nextcloud.com/install/#community-projects 

选择 Web installer 方式:

getImage-37

 

整体方法:

getImage-38

 

下载 setup-nextcloud.php 文件。

 

在 Linux 虚拟机(Hyper-V)中的宝塔面板中添加站点:

getImage-39

 

上传刚才下载的文件到网站文件夹中:

getImage-40

 

确认已经安装了 PHP 并在网站中指定:

getImage-41

 

然后如果直接访问 192.168.5.25:88/setup-nextcloud.php 会变成下载,可以更改网站的默认文档:

getImage-42

 

访问后即可开始安装:

getImage-43

 

需要 PHP 7.3 以上:

getImage-44

 

安排:

getImage-45

 

刷新后进入了下一步:

getImage-46

 

由于之前设置网站目录比较草率,现在先修改一下,先拷贝网站目录为 nextcloud 目录:

getImage-47

 

然后再网站中切换目录:

getImage-48

 

然后继续安装,设置子目录为 Bin:

getImage-49

 

等了一会儿,502 了:

getImage-50

 

刷新一下,说是安装好了,不过顶部有报错,提到了不存在 Bin 目录:

getImage-51

 

点击 Next,404 了:

getImage-52

 

发现安装文件被删除了,重新上传,打算再试一次。

 

又到这一步时,保持默认:

getImage-53

 

还是老样子。再改为点 (.) 试试:

getImage-54

 

还是不行。

在网站目录下手动创建目录:

getImage-55

 

然后再使用同名目录:

getImage-56

 

还是不行,看来要从报错入手:

Warning: ZipArchive::extractTo(): Invalid or uninitialized Zip object in /www/wwwroot/nextcloud/setup-nextcloud.php on line 156 
Warning: ZipArchive::close(): Invalid or uninitialized Zip object in /www/wwwroot/nextcloud/setup-nextcloud.php on line 157 
Warning: rename(tmp-nextcloud1776925416/nextcloud,./nextcloud): No such file or directory in /www/wwwroot/nextcloud/setup-nextcloud.php on line 166

 

问了下 AI,分析了一下,应该是脚本下载压缩包时不成功,直接找到脚本里的地址:

https://download.nextcloud.com/server/releases/

查看页面,得到以下地址:

排序地址:https://download.nextcloud.com/server/releases/?C=M;O=D 

最新 zip 地址:https://download.nextcloud.com/server/releases/latest.zip 

 

使用宝塔的 url 下载,并命名为 nc.zip:

getImage-57

 

下不了,还是浏览器下载吧:

getImage-58

 

改名为 nc.zip 并上传到网站中:

getImage-59

 

再次执行安装过程(访问网址),这次是无错误安装完成了:

getImage-60

 

Next 之后,提示需要 PHP 8.2:

getImage-61

 

这个好办,直接给它安排上 8.5.2:

getImage-62

 

切换网站的 PHP 版本后,刷新网页,出现设置管理员账号、数据文件夹、数据库 的界面,并提示 SQLite 可能会有性能问题:

getImage-63

 

此时先暂停一下,压缩安装好的 nextcloud 目录:

getImage-64

 

并下载下来,和 nc.zip、安装脚本 一起打包,留待以后不时之需(v33):

getImage-65

 

设置了一个用户名、密码,更改了数据目录,数据库保持默认 SQLite,点击安装:

getImage-66

 

提示找不到服务器了:

getImage-67

 

修正地址后可以了:

getImage-68

 

提示无法获取,应该是网络环境问题:

getImage-69

 

使用宝塔面板自带的 AI 服务询问设置代理的方法:

getImage-70

 

题外话:在 PHP-FPM 配置中设置环境变量 要如何做?

📝 配置示例(供参考)

假设您的代理是 http://192.168.1.100:7890,配置如下:

 

方式 1:修改现有池配置(影响所有使用该池的网站)

/www/server/php/85/etc/php-fpm.conf[www] 部分添加:

[www]
; ... 现有配置 ...

; 添加代理环境变量
env[HTTP_PROXY] = http://192.168.1.100:7890
env[HTTPS_PROXY] = http://192.168.1.100:7890
env[NO_PROXY] = 127.0.0.1,localhost,192.168.0.0/16

 

方式 2:创建独立的池配置(只为 NextCloud 设置代理)

创建新文件 /www/server/php/85/etc/php-fpm.d/nextcloud.conf

[nextcloud]
; 基础配置
user = www
group = www
listen = 127.0.0.1:9001
listen.allowed_clients = 127.0.0.1

; 进程管理
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 20

; 代理环境变量
env[HTTP_PROXY] = http://192.168.1.100:7890
env[HTTPS_PROXY] = http://192.168.1.100:7890
env[NO_PROXY] = 127.0.0.1,localhost

; 网站目录
chdir = /www/wwwroot/nextcloud/nextcloud

 

然后在 Nginx 配置中指定使用该 PHP-FPM 池。

 

🔧 操作步骤(获得授权后执行)

  1. 备份原配置文件
  2. 修改或创建 PHP-FPM 配置文件
  3. 修改 Nginx 配置(如果创建新池)
  4. 重启 PHP-FPM 服务
  5. 验证配置是否生效

 

跳过获取推荐的应用,继续

还是不行,直接访问 index.php,显示如下:

getImage-71

 

文件列表是这样的:

getImage-72

 

用户头像菜单:

getImage-73

 

管理设置 — 概览 中有一些警告:

getImage-74

 

修改 PHP 内存限制:

getImage-75

 

PHP 安装 fileinfo 扩展:

getImage-76

 

应用页面还是打不开:

getImage-77

 

修改 JavaScript 模块支持 错误

JavaScript 模块支持 您的网络服务器不使用 JavaScript MIME 类型提供 “.mjs” 文件。 这会阻止浏览器执行 JavaScript 文件,从而破坏某些应用程序。 您应该配置您的网络服务器以使用 “text/javascript” 或 “application/javascript” MIME 类型提供 “.mjs” 文件。

 

在 /www/server/ngnix/conf/mime.types 中新增一行:

application/javascript            mjs;

getImage-78

 

突然 502 了,问了下 AI,是之前设置代理导致的:

getImage-79

 

恢复之后刷新,出现如下界面:

getImage-80

getImage-81

getImage-82

getImage-83

 

管理设置中的概览中只有一个 HTTPS 的错误了(其它是警告):

getImage-84

 

应用页面还是打不开(502)。

 

打开应用页面

按照文章《Nextcloud 应用商店空白加载不出来 / Nextcloud 应用商店无法打开》解决应用页面打不开的问题(网络问题)。

修改 /www/wwwroot/nextcloud/nextcloud/config/config.php 文件,在其中添加如下内容:

'appstoreenabled' => true,
'appstoreurl' => 'https://www.orcy.net/ncapps/v2/',

getImage-85

 

然后刷新应用页面,可以打开了:

getImage-86

 

在 Office & Text 栏目中能找到 OnlyOffice:

getImage-87

 

点击之后显示已安装,但是又提升不兼容:

getImage-88

 

OnlyOffice 的 Nextcloud 连接器

安装应用

开源地址:https://github.com/ONLYOFFICE/onlyoffice-nextcloud 

下载地址:https://github.com/ONLYOFFICE/onlyoffice-nextcloud/releases 

选择 v10.0.0 版本(兼容 Nextcloud 33

getImage-89

 

上传文件到 nextcloud/apps 目录中并解压为 onlyoffice 文件夹:

getImage-90

 

然后打开 已禁用的应用 页面,启用 ONLYOFFICE:

getImage-91

 

在 已启用的应用 页面中就能看到了:

getImage-92

 

配置应用

点击 Nextcloud 的 管理设置 — ONLYOFFICE:

getImage-93

 

填写 OnlyOffice Docs 的地址等信息:

getImage-94

 

其中密钥在 %ProgramFiles%\ONLYOFFICE\DocumentServer\config\local.json 中(安装目录,我的在 D 盘)的 services.CoAuthoring.secret.inbox.string 节点:

getImage-95

 

但是连接发生异常了(Bad healthcheck status):

getImage-96

 

将地址带上 example(之前访问的 Demo 地址),出现 404 错误,所以这个 healthcheck 是 OnlyOffice 的服务:

getImage-97

 

直接访问 http://192.168.5.35:7777/healthcheck ,返回 true(可能是因为重启了下电脑的原因):

getImage-98

 

此时再将地址改回 http://192.168.5.35:7777/ 并保存,果然成功了:

getImage-99

 

此时再到 Nextcloud 的文件列表中,点击 新建 按钮,弹出菜单中多了 新建表格、新建幻灯片、新建文档、新建 PDF 表单,这些之前是没有的,也就是新安装的 OnlyOffice 插件带来的:

getImage-100

 

新建个文档(在当前页打开了):

getImage-101

 

可以在插件设置页面进行设置(取消勾选 在相同的标签页中打开):

getImage-102

 

保存设置后再点开文件,就会在新标签页打开了:

getImage-103

 

有的时候不稳定,提示无法保存,需要下载,如下图所示。这种情况刷新或者重新开一下可能就好了。

getImage-104

 

新建 PPT:

getImage-105

 

新建个 PDF 表单:

getImage-106

 

后续使用问题

基础设置

Nextcloud 中有个 文件设置,可以按需设置一下:

getImage-107

 

文件都存放在 Nextcloud 网站的数据目录中:

getImage-108

 

配置外网访问

通过 frp 给 Nextcloud 做了个外网穿透访问,结果提示 通过不被信任的域名访问:

getImage-109

 

那我们就按提示看看示例配置:

getImage-110

 

然后我们编辑实际使用的 config.php 文件,写法有点不一样,不过影响不大,我们参照已有的一条本地 IP 的续写一条就行了:

getImage-111

 

改完保存之后,我们再刷新一下页面就能正常访问了:

getImage-112

 

外部共享链接

首先在需要共享的文件上,点击 三个点 图标,再点击弹框中的 详细信息,展开右侧的详细信息区域:

getImage-113

 

点击 生成公开链接地址 后,可以设置共享链接的权限(仅查看、可以编辑、自定义权限):

getImage-114

 

访问时提示 ONLYOFFICE 服务器无法连接:

getImage-115

 

这个应该是因为配置 OnlyOffice 的时候填的是内网地址导致的,对于不通过 OnlyOffice 的文件类型是可以的:

getImage-116

 

将 ONLYOFFICE 插件设置中的 Docs 地址改为外网地址:

getImage-117

 

然后刷新共享链接即可:

getImage-118

 

此时是不能编辑的:

getImage-119

 

我们把权限设置为 可以编辑:

getImage-120

 

现在就可以编辑了:

getImage-121

 

还可以自定义权限:

getImage-122

 

支持多人 (访客) 协作:

getImage-123

 

账号安全

目前将网站页面链接或者打开的文件链接(非共享链接)在别的地方打开,都需要登录,而且没有注册入口,应该是符合个人使用场景的:

getImage-124

 

还可以在 快速预设 栏目中设置使用场景:

getImage-125

 

切换成别的,底下会有变化:

getImage-126

 

修复切换快速预设后的错误

切换之后出错了:

getImage-127

 

日志如下:

getImage-128

 

查看配置文件,最后新增了一行,先把它删除吧:

getImage-129

 

但是删除了还是不行。改成 0 也不行。问了 AI ,说是要清除服务器缓存什么的,但是没看到相关缓存。

不过 Chrome 浏览器中没有登录的页面还是能正常访问了,难道是浏览器的缓存问题?

先登录一下试试,还是不行:

getImage-130

尝试升级:

cd /www/wwwroot/nextcloud/nextcloud/

sudo -u www php occ upgrade

没用

getImage-131

 

php occ 输出了一大堆命令

Nextcloud 33.0.2

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --no-warnings     Skip global warnings, show command output only
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  check                                  check dependencies of the server environment
  completion                             Dump the shell completion script
  help                                   Display help for a command
  list                                   List commands
  setupchecks                            Run setup checks and output the results
  status                                 show some status information
  upgrade                                run upgrade routines after installation of a new release. The release has to be installed before.
 activity
  activity:send-mails                    Sends the activity notification mails
 admin-delegation
  admin-delegation:add                   add setting delegation to a group
  admin-delegation:remove                remove settings delegation from a group
  admin-delegation:show                  show delegated settings
 app
  app:disable                            disable an app
  app:enable                             enable an app
  app:getpath                            Get an absolute path to the app directory
  app:install                            install an app
  app:list                               List all available apps
  app:remove                             remove an app
  app:update                             update an app or all apps
 app_api
  app_api:app:config:delete              Delete ExApp configs
  app_api:app:config:get                 Get ExApp config
  app_api:app:config:list                List ExApp configs
  app_api:app:config:set                 Set ExApp config
  app_api:app:disable                    Disable registered external app
  app_api:app:enable                     Enable registered external app
  app_api:app:list                       List ExApps
  app_api:app:register                   Install external App
  app_api:app:unregister                 Unregister external app
  app_api:app:update                     Update ExApp
  app_api:daemon:list                    List registered daemons
  app_api:daemon:register                Register daemon config for ExApp deployment
  app_api:daemon:registry:add            Add deploy daemon Docker registry mapping
  app_api:daemon:registry:list           List the configured deploy daemon Docker registry mappings
  app_api:daemon:registry:remove         Remove deploy daemon Docker registry mapping
  app_api:daemon:unregister              Unregister daemon
 background
  background:cron                        [background:ajax|background:webcron] Use cron, ajax or webcron to run background jobs
 background-job
  background-job:delete                  Remove a background job from database
  background-job:execute                 Execute a single background job manually
  background-job:list                    List background jobs
  background-job:worker                  Run a background job worker
 broadcast
  broadcast:test                         test the SSE broadcaster
 calendar
  calendar:export                        Export calendar data from supported calendars to disk or stdout
  calendar:import                        Import calendar data to supported calendars from disk or stdin
 circles
  circles:check                          Checking your configuration
  circles:maintenance                    Clean stuff, keeps the app running
  circles:manage:config                  edit config/type of a Team
  circles:manage:create                  create a new team
  circles:manage:destroy                 destroy a circle by its ID
  circles:manage:details                 get details about a team by its ID
  circles:manage:edit                    edit displayName or description of a  Team
  circles:manage:join                    emulate a user joining a Team
  circles:manage:leave                   simulate a user joining a Team
  circles:manage:list                    listing current teams
  circles:manage:setting                 edit setting for a Team
  circles:members:add                    Add a member to a Team
  circles:members:details                get details about a member by its ID
  circles:members:level                  Change the level of a member from a Team
  circles:members:list                   listing Members from a Team
  circles:members:remove                 remove a member from a team
  circles:members:search                 Change the level of a member from a Team
  circles:memberships                    index and display memberships for local and federated users
  circles:migrate:customgroups
  circles:remote                         remote features
  circles:shares:files                   listing shares files
  circles:sync                           Sync Circles and Members
  circles:test                           testing some features
 config
  config:app:delete                      Delete an app config value
  config:app:get                         Get an app config value
  config:app:set                         Set an app config value
  config:import                          Import a list of configs
  config:list                            List all configs
  config:preset                          Select a config preset
  config:system:delete                   Delete a system config value
  config:system:get                      Get a system config value
  config:system:set                      Set a system config value
 dav
  dav:absence:get
  dav:absence:set
  dav:clear-calendar-unshares            Clear calendar unshares for a user
  dav:clear-contacts-photo-cache         Clear cached contact photos
  dav:create-addressbook                 Create a dav addressbook
  dav:create-calendar                    Create a dav calendar
  dav:create-subscription                Create a dav subscription
  dav:delete-calendar                    Delete a dav calendar
  dav:delete-subscription                Delete a calendar subscription for a user
  dav:fix-missing-caldav-changes         Insert missing calendarchanges rows for existing events
  dav:list-addressbooks                  List all addressbooks of a user
  dav:list-calendar-shares               List all calendar shares for a user
  dav:list-calendars                     List all calendars of a user
  dav:list-subscriptions                 List all calendar subscriptions for a user
  dav:move-calendar                      Move a calendar from an user to another
  dav:remove-invalid-shares              Remove invalid dav shares
  dav:retention:clean-up
  dav:send-event-reminders               Sends event reminders
  dav:sync-birthday-calendar             Synchronizes the birthday calendar
  dav:sync-system-addressbook            Synchronizes users to the system addressbook
 db
  db:add-missing-columns                 Add missing optional columns to the database tables
  db:add-missing-indices                 Add missing indices to the database tables
  db:add-missing-primary-keys            Add missing primary keys to the database tables
  db:convert-filecache-bigint            Convert the ID columns of the filecache to BigInt
  db:convert-mysql-charset               Convert charset of MySQL/MariaDB to use utf8mb4
  db:convert-type                        Convert the Nextcloud database to the newly configured one
  db:schema:expected                     Export the expected database schema for a fresh installation
  db:schema:export                       Export the current database schema
 encryption
  encryption:change-key-storage-root     Change key storage root
  encryption:decrypt-all                 Disable server-side encryption and decrypt all files
  encryption:disable                     Disable encryption
  encryption:enable                      Enable encryption
  encryption:encrypt-all                 Encrypt all files for all users
  encryption:list-modules                List all available encryption modules
  encryption:migrate-key-storage-format  Migrate the format of the keystorage to a newer format
  encryption:set-default-module          Set the encryption default module
  encryption:show-key-storage-root       Show current key storage root
  encryption:status                      Lists the current status of encryption
 federation
  federation:sync-addressbooks           Synchronizes addressbooks of all federated clouds
  federation:sync-calendars              Synchronize all incoming federated calendar shares
 files
  files:cleanup                          Clean up orphaned filecache and mount entries
  files:copy                             Copy a file or folder
  files:delete                           Delete a file or folder
  files:get                              Get the contents of a file
  files:mount:list                       List of mounts for a user
  files:mount:refresh                    Refresh the list of mounts for a user
  files:move                             Move a file or folder
  files:object:delete                    Delete an object from the object store
  files:object:get                       Get the contents of an object
  files:object:info                      Get the metadata of an object
  files:object:list                      List all objects in the object store
  files:object:multi:rename-config       Rename an object store configuration and move all users over to the new configuration,
  files:object:multi:users               Get the mapping between users and object store buckets
  files:object:orphans                   List all objects in the object store that don't have a matching entry in the database
  files:object:put                       Write a file to the object store
  files:put                              Write contents of a file
  files:recommendations:recommend        Shows recommended files for an account
  files:reminders                        List file reminders
  files:repair-tree                      Try and repair malformed filesystem tree structures (may be necessary to run multiple times for nested malformations)
  files:sanitize-filenames               Renames files to match naming constraints
  files:scan                             rescan filesystem
  files:scan-app-data                    rescan the AppData folder
  files:transfer-ownership               All files and folders are moved to another user - outgoing shares and incoming user file shares (optionally) are moved as well.
  files:windows-compatible-filenames     Enforce naming constraints for windows compatible filenames
 group
  group:add                              Add a group
  group:adduser                          add a user to a group
  group:delete                           Remove a group
  group:info                             Show information about a group
  group:list                             list configured groups
  group:removeuser                       remove a user from a group
 guests
  guests:add                             Add a new guest account
  guests:list                            List created guests
 info
  info:file                              get information for a file
  info:file:space                        Summarize space usage of specified folder
  info:storage                           Get information a single storage
  info:storages                          List storages ordered by the number of files
 integrity
  integrity:check-app                    Check integrity of an app using a signature.
  integrity:check-core                   Check integrity of core code using a signature.
  integrity:sign-app                     Signs an app using a private key.
  integrity:sign-core                    Sign core using a private key.
 l10n
  l10n:createjs                          Create javascript translation files for a given app
 log
  log:file                               manipulate logging backend
  log:manage                             manage logging configuration
  log:tail                               Tail the nextcloud logfile
  log:watch                              Watch the nextcloud logfile
 maintenance
  maintenance:data-fingerprint           update the systems data-fingerprint after a backup is restored
  maintenance:mimetype:update-db         Update database mimetypes and update filecache
  maintenance:mimetype:update-js         Update mimetypelist.js
  maintenance:mode                       Show or toggle maintenance mode status
  maintenance:repair                     repair this installation
  maintenance:repair-share-owner         repair invalid share-owner entries in the database
  maintenance:theme:update               Apply custom theme changes
  maintenance:update:htaccess            Updates the .htaccess file
 memcache
  memcache:distributed:clear             Clear values from the distributed memcache
  memcache:distributed:delete            Delete a value in the distributed memcache
  memcache:distributed:get               Get a value from the distributed memcache
  memcache:distributed:set               Set a value in the distributed memcache
  memcache:redis:command                 Send raw redis command to the configured redis server
 metadata
  metadata:get                           get stored metadata about a file, by its id
 migrations
  migrations:preview                     Get preview of available DB migrations in case of initiating an upgrade
 notification
  notification:delete                    Delete a generated admin notification for the given user
  notification:generate                  Generate a notification for the given user
  notification:test-push                 Generate a notification for the given user
 onlyoffice
  onlyoffice:documentserver              Manage document server
 photos
  photos:albums:add                      Add specified photo to album
  photos:albums:create                   Create a new album for a user
  photos:update-1000-cities              Update the list of 1000 and more inhabitant cities
 preview
  preview:cleanup                        Removes existing preview files
  preview:generate                       generate a preview for a file
  preview:reset-rendered-texts           Deletes all generated avatars and previews of text and md files
 router
  router:list                            Find the target of a route or all routes of an app
  router:match                           Match a URL to the target route
 security
  security:bruteforce:attempts           Show bruteforce attempts status for a given IP address
  security:bruteforce:reset              resets bruteforce attempts for given IP address
  security:certificates                  list trusted certificates
  security:certificates:export           export the certificate bundle
  security:certificates:import           import trusted certificate in PEM format
  security:certificates:remove           remove trusted certificate
 serverinfo
  serverinfo:update-storage-statistics   Triggers an update of the counts related to storages used in serverinfo
 share
  share:list                             List available shares
 sharing
  sharing:cleanup-remote-storages        Cleanup shared storage entries that have no matching entry in the shares_external table
  sharing:delete-orphan-shares           Delete shares where the owner no longer has access to the file
  sharing:expiration-notification        Notify share initiators when a share will expire the next day.
  sharing:fix-share-owners               Fix owner of broken shares after transfer ownership on old versions
 snowflake
  snowflake:decode                       Decode Snowflake IDs used by Nextcloud
 support
  support:report                         Generate a system report
 tag
  tag:add                                Add new tag
  tag:delete                             delete a tag
  tag:edit                               edit tag attributes
  tag:files:add                          Add a system-tag to a file or folder
  tag:files:delete                       Delete a system-tag from a file or folder
  tag:files:delete-all                   Delete all system-tags from a file or folder
  tag:list                               list tags
 taskprocessing
  taskprocessing:task-type:set-enabled   Enable or disable a task type
  taskprocessing:task:cleanup            cleanup old tasks
  taskprocessing:task:get                Display all information for a specific task
  taskprocessing:task:list               list tasks
  taskprocessing:task:stats              get statistics for tasks
  taskprocessing:worker                  Run a dedicated worker for synchronous TaskProcessing providers
 text
  text:reset                             Reset a text document session to the current file content
 theming
  theming:config                         Set theming app config values
 trashbin
  trashbin:cleanup                       Remove deleted files
  trashbin:expire                        Expires the users trashbin
  trashbin:restore                       Restore all deleted files according to the given filters
  trashbin:size                          Configure the target trashbin size
 twofactor_totp
  twofactor_totp:cleanup                 Remove orphaned totp secrets
 twofactorauth
  twofactorauth:cleanup                  Clean up the two-factor user-provider association of an uninstalled/removed provider
  twofactorauth:disable                  Disable two-factor authentication for a user
  twofactorauth:enable                   Enable two-factor authentication for a user
  twofactorauth:enforce                  Enabled/disable enforced two-factor authentication
  twofactorauth:state                    Get the two-factor authentication (2FA) state of a user
 update
  update:check                           Check for server and app updates
 user
  user:add                               adds an account
  user:auth-tokens:add                   [user:add-app-password] Add app password for the named account
  user:auth-tokens:delete                Deletes an authentication token
  user:auth-tokens:list                  List authentication tokens of an user
  user:clear-avatar-cache                clear avatar cache
  user:delete                            deletes the specified user
  user:disable                           disables the specified user
  user:enable                            enables the specified user
  user:info                              show user info
  user:keys:verify                       Verify if the stored public key matches the stored private key
  user:lastseen                          shows when the user was logged in last time
  user:list                              list configured users
  user:profile                           Read and modify user profile properties
  user:report                            shows how many users have access
  user:resetpassword                     Resets the password of the named user
  user:setting                           Read and modify user settings
  user:sync-account-data                 sync user backend data to accounts table for configured users
  user:welcome                           Sends the welcome email
 versions
  versions:cleanup                       Delete versions
  versions:expire                        Expires the users file versions
 webhook_listeners
  webhook_listeners:list                 Lists configured webhook listeners
 workflows
  workflows:list                         Lists configured workflows

 

 

使用 php occ config:preset 命令也不行:

getImage-132

 

还尝试了 php occ maintenance:repair 、php occ memcache:distributed:clear 都不行。

 

执行 php occ user:list 触发了日志中的报错,看来就是用户模块出问题了:

getImage-133

 

最终通过禁用 guests 应用解决了:

php occ app:disable guests

getImage-134

 

网页上也能正常访问了。所以还是先别改快速预设吧,应该是缺少了一些文件。

 

安全与设置警告 问题处理

维护窗口启动

getImage-135

[ima DSv4Flash]

该参数用于指定资源密集型日常后台作业(如文件扫描、缓存清理等)的执行时间段,避免在用户活跃时段影响系统性能。建议将维护窗口设置在服务器低负载时段(例如凌晨),以减轻对用户的影响。

在 Nextcloud 安装目录下的 config/config.php 文件中,添加以下一行配置:

'maintenance_window_start' => 1,

这里 1 表示 UTC 时间凌晨 1 点作为维护窗口的起始时间(即非紧急后台作业将在 01:00 UTC 至 05:00 UTC 之间运行)。你可以根据服务器所在时区和低负载时段调整该数值(例如设置为 2 表示凌晨 2 点开始)

 

实践:

getImage-136

 

可用的 Mimetype 迁移

有一个或多个 mimetype 迁移可用。有时会添加新的 mimetype 以更好地处理某些文件类型。在较大的实例上迁移 mimetype 需要很长时间,因此升级期间不会自动完成此操作。使用命令 “occ Maintenance:repair –include-expensive” 执行迁移。

 

需要使用命令 php occ maintenance:repair --include-expensive 进行修复:

getImage-137

 

修复完成这条警告就没有了。

 

安装缺少的 PHP 模块

getImage-138

 

其中 apcu 由于已安装 opcache,所以不安装:

getImage-139

 

不对,说的是 apc,和我 apcu 有什么关系:

[ima DSv4Flash]:
官方推荐同时开启 OPcache 和 APCu 以实现双重优化。PHP 早期版本中的 APC 扩展同时提供 opcode 缓存和数据缓存功能。自 PHP 5.5 起,OPcache 取代了 APC 的 opcode 缓存部分,而数据缓存功能独立出来成为 APCu。所以两者的分工是明确的。

最佳组合方案

  1. 优先开启 OPcache:这是 PHP 性能优化的基础,几乎所有生产环境都应启用并调优。
  2. 按需添加 APCu:如果应用有需要频繁读取的配置、字典数据或计算结果,可用 APCu 缓存。
  3. 分布式场景用 Redis:如果有多台服务器需要共享缓存,建议使用 Redis 或 Memcached 替代 APCu。

 

所以,apcu 还是要装的。再把 imagemagick 和 exif 安装上:

getImage-140

 

gmp 也安上:

getImage-141

 

现在 Nextcloud 的概览中的警告剩余如下,其中内存缓存相关的需要安装 Redis,就先不安了:

getImage-142

 

过程梳理和资源打包

本文介绍了 OnlyOffice + NextCloud 配合实现在线 Office 功能的搭建和配置流程,包括其中的踩坑过程。其中,OnlyOffice 使用了 Windows 版,NextCloud 是在 Hyper-V 虚拟机(AlmaLinux 系统)上搭建的一个网站(通过宝塔面板创建网站),两者通过 NextCloud 上的 onlyoffice-nextcloud 插件(OnlyOffice 开发)进行连接,NextCloud 提供文件托管服务(搭建好之后可以当网盘使用),OnlyOffice 提供在线查看和编辑 Word、Excel、PPT、PDF 等服务,相互配合、相辅相成。

 

本次使用到的相关文件已整理在一起上传到夸克网盘了,需要的朋友可以在微信公众号 “独立观察员博客” 后台回复 “OnlyOffice” 进行获取:

getImage-143

 

原创文章,转载请注明: 转载自 独立观察员(dlgcy.com)

本文链接地址: [OnlyOffice (Win 版) 和 NextCloud 配合实现在线 Office 服务](https://dlgcy.com/onlyoffice-nextcloud/)

关注微信公众号 独立观察员博客(DLGCY_BLOG) 第一时间获取最新文章

%title插图%num

发表评论