NextCloud 更新到正式版 v17.3 了,网上教程很多安装起来也比它的前支 ownCloud 方便,基本一步到位,ownCloud 时隔多年是没再成功过 ::quyin:fue::
NextCloud 的 Nginx 配置
# nextcloud.conf
add_header Referrer-Policy"no-referrer";
add_header X-Frame-Options"SAMEORIGIN";
include /usr/local/nginx/conf/rewrite/nextcloud.conf;
NextCloud 默认中文
# config.php
'default_language' => 'zh_CN',
'force_language' => 'zh_CN',
'force_locale' => 'zh_CN',
NextCloud 安装 APCu 扩展
'memcache.local' => '\OC\Memcache\APCu',
NextCloud 安装 redis 缓存
安装
# 来自 https://www.wenjinyu.me/zh/deal-with-nextcloud-warning-memory-cache-is-not-configured/
# 安装 redis-server 以及 redis 的 PHP 扩展
Redis-server installed successfully!
redis install dir: /usr/local/redis/etc/redis.conf
修改 redis.conf 配置
# 监听端口改为0
port 0
# 只监听本地端口
bind 127.0.0.1
# 添加unix socket监听,/dev/shm/是挂载在内存的临时文件夹,具体可搜索tmpfs
unixsocket /dev/shm/redis.sock
# 设置socket权限
unixsocketperm 770
# 为了提高安全,给 redis 设置密码
requirepass Cp$#9kLNnY@N5U09FV6098#
成功测试
root@df41:# redis-cli -s /dev/shm/redis.sock -a 'Cp$#9kLNnY@N5U09FV6098#'
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
redis /dev/shm/redis.sock> ping # 输入 ping 测试
PONG # 返回 PONG 即成功
返回 NextCloud 配置
'redis' => array(
'host' => '/dev/shm/redis.sock',
'port' => 0,
'dbindex' => 0,
# 密码要和服务器上 redis.conf 中的一致,否则报错 500
'password' => 'Cp$#9kLNnY@N5U09FV6098#',
'timeout' => 1.5,
),