Nextcloud/OwnCloud 内置了配置检查工具,错误信息会被显示在管理页面的顶端。本文列举了一些可能会看到的警告及其解决方案。
缓存警告
如果没有配置内存缓存,就会看到以下提示:
或者是
ownCloud/Nextcloud 支持以下几种内存缓存方式:
- APCu (PHP4.0.6+)
- Memcached
- Redis (PHP2.2.6+)
相关教程
APCu:VPS 配置 ownCloud_memcache【APCu】、Nextcloud/ownCloud 配置 APCu 本地缓存+Memcached 分布式缓存
Memcache:ownCloud 配置 memcache、Nextcloud/ownCloud 配置 APCu 本地缓存+Memcached 分布式缓存
Redis:【ownCloud】配置 Redis 内存缓存
其它警告
注:{Cache}至内存缓存方式,{Version}为相应版本
如果你所安装的版本太低或没有安装和启用缓存,就会看到以上警告。可以通过升级版本或彻底删除缓存工具的方式来解决。
Transactional file locking is disabled
这是事务文件锁定功能被禁用的缘故。
Nextcloud 的事务文件锁定机制能够锁定文件以避免在正常操作期间文件损坏。更多信息可以查看:Transactional File Locking
建议使用 HTTPS
如果使用 HTTP 协议访问 Nextcloud/OwnCloud,就会看到以下警告
或者是
HTTPS 是大势所趋,更何况是牵涉文件安全的网页应用。如果你的 Nextcloud/Owncloud 在外网上跑,使用 HTTPS 是相当有必要的,而且如果不使用 HTTP,就会有部分功能受到限制。
以下是一些开启 HTTPS 的教程:
The test with getenv(“PATH”) only returns an empty response
某些环境没有将有效的 PATH 变量传递给 Nextcloud。 可以阅读php-fpm 配置注意事项。
解决方法:The test with getenv(“PATH”) only returns an empty response 报错解决办法
“Strict-Transport-Security(HSTS)”HTTP 头没有配置
开启 HTTPS 后,会出现这个提示
错误在于虽然开启了 HTTPS,却使用传统 301 方式跳转或没有进行强制跳转。
HSTS(HTTP Strict Transport Security)国际互联网工程组织 IETE 正在推行一种新的 Web 安全协议。HSTS 的作用是强制客户端(如浏览器)使用 HTTPS 与服务器创建连接。不同于传统 301 跳转,HSTS 不会在跳转过程遭遇网络渗透。
有关 HSTS 的设置可以参考官方文档:Enable HTTP Strict Transport Security,我也会在以后发布相关中文教程。
/dev/urandom is not readable by PHP
错误原因在于 PHP 无法读取/dev/urandom。这是个严重的问题,可以参考官方文档: Give PHP read access to /dev/urandom
Your Web server is not yet set up properly to allow file synchronization
有关这个问题,在 ownCloud 官方论坛有详细说明:How to fix CalDAV|CardDAV|WebDAV problems
Outdated NSS / OpenSSL version
早期的 OpenSSL 和 NSS 版本中存在 BUG,导致与使用 SNI 的远程主机相连接的方式不正确。解决这个问题需要将 OpenSSL 至少升级为 1.0.2b 或 1.0.1d。
Your Web server is not set up properly to resolve /.well-known/caldav/ or /.well-known/carddav/
错误原因:/.well-known/caldav/和 /.well-known/carddav/没有正确地重定向到 Nextcloud 的 DAV 端点
有关这个问题,可以参考官方文档:Service discovery
文件完整性检查
这是一个很常见的错误,一般提示为:
或
出现这个错误的往往是因为文件缺失、多余。注意:
往往还会有下面的提示信息:
对于强迫症患者,可以考虑删掉整个程序,重新下载安装。有耐心者可以按照下面的过程查找核对错误文件:
点击”List of invalid files…”查看错误文件列表,你可能看到下面的信息(已标注处理方法):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.
Results
=======
– core #核心文件核验
– INVALID_HASH #错误的文件,需要使用正确的替换
– /index.php
– /version.php
– EXTRA_FILE #多余的文件,需要删除
– /test.php
– calendar #日历
– EXCEPTION #错误信息
– OC\IntegrityCheck\Exceptions\InvalidSignatureException
– Signature data not found.
Raw output
==========
Array
(
[core] => Array
(
[INVALID_HASH] => Array
(
[/index.php] => Array
(
[expected] =>
f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3
c2521b050955d9d452769f61454c9ddfa9c308146ade10546c
fa829794448eaffbc9a04a29d216
[current] =>
ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d321
42cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec2
31d4a230559d4f3e2c471d3ea094
)
[/version.php] => Array
(
[expected] =>
c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4
b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7
d5685c3b45aee373b09be54742ea
[current] =>
88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3
b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300
c478e6c156c5955ed53c40d06585
)
)
[EXTRA_FILE] => Array
(
[/test.php] => Array
(
[expected] =>
[current] =>
09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b
935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522
b4af8db0ae269d73432e9a01e63a
)
)
)
[calendar] => Array
(
[EXCEPTION] => Array
(
[class] => OC\IntegrityCheck\Exceptions\InvalidSignature
Exception
[message] => Signature data not found.
)
)
)
|
Your database does not run with “READ COMMITED” transaction isolation level
有关这个问题,可以查看官方文档: Database “READ COMMITED” transaction isolation level 来了解如何设置数据库。