Docker Nextcloud 常见问题解决方案

本文介绍了如何在安全连接环境下解决实例生成不安全URL的问题,包括PHP模块的安装、服务器维护窗口设置、Nginx配置调整、OPcache优化以及国际区号设置,以提升网站性能和安全性。
摘要由CSDN通过智能技术生成

你正通过安全连接访问你的实例,然而你的实例正生成不安全的 URL

config.php 中添加

'overwriteprotocol' => 'https',

该实例缺少一些推荐的 PHP 模块,强烈建议您安装以下模块以提升性能和兼容性:bz2

参考 Github Issue #2118,进入容器后运行,安装后重启容器

apt-get update && apt-get install -y libbz2-dev && rm -rf /var/lib/apt/lists/*
docker-php-ext-install bz2

Server has no maintenance window start time configured.

Server has no maintenance window start time configured. This means resource intensive daily background jobs will also be executed during your main usage time. We recommend to set it to a time of low usage, so users are less impacted by the load caused from these heavy tasks.

参考官方文档,在 config.php 中添加

'maintenance_window_start' => 1,

您的网页服务器未正确设置以解析

您的网页服务器未正确设置以解析 “/.well-known/caldav”,“/.well-known/carddav””/.well-known/webfinger”,”/.well-known/nodeinfo”

修改 Nginx 配置文件

location ^~ /.well-known {
        rewrite ^/\.well-known/host-meta\.json  $scheme://$host:$server_port/public.php?service=host-meta-json  last;
        rewrite ^/\.well-known/host-meta        $scheme://$host:$server_port/public.php?service=host-meta       last;
        rewrite ^/\.well-known/webfinger        $scheme://$host:$server_port/public.php?service=webfinger       last;
        rewrite ^/\.well-known/nodeinfo         $scheme://$host:$server_port/public.php?service=nodeinfo        last;

        location = /.well-known/carddav     { return 301 $scheme://$host:$server_port/remote.php/dav/; }
        location = /.well-known/caldav      { return 301 $scheme://$host:$server_port/remote.php/dav/; }

        try_files $uri $uri/ =404;
    }

或者,在 config.php 中添加

'check_for_working_wellknown_setup' => false,

当前正在使用数据库处理事务性文件锁定,若有内存缓存可用,请进行配置以提升性能

通过进入容器查看 PHP 扩展,发现官方镜像已经安装了 Redis 扩展,则只需在 config.php 中添加

'memcache.local' => '\OC\Memcache\Redis',
'redis' => [
	'host' => 'localhost',
    'port' => 6379,
],
'memcache.locking' => '\OC\Memcache\Redis',

您在安装过程中未设置默认的国际区号

config.php 中添加

'default_phone_region' => 'CN',

The OPcache buffer is nearly full.

The PHP OPcache module is not properly configured. The OPcache buffer is nearly full. To assure that all scripts can be hold in cache, it is recommended to apply “opcache.memory_consumption” to your PHP configuration with a value higher than “128”

参考Github Issue #1692,进入容器后运行,安装后重启容器

sed -i "s/opcache.interned_strings_buffer=8/opcache.interned_strings_buffer=16/g" /usr/local/etc/php/conf.d/opcache-recommended.ini |grep opcache.interned_strings_buffer /usr/local/etc/php/conf.d/opcache-recommended.ini
  • 9
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
首先,你需要在树莓派上安装Docker。可以按照以下步骤进行安装: 1. 打开终端,更新软件包列表: ``` sudo apt update ``` 2. 安装Docker的依赖包: ``` sudo apt install -y apt-transport-https ca-certificates curl software-properties-common ``` 3. 添加Docker的官方GPG密钥: ``` curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg ``` 4. 添加Docker的APT源: ``` echo "deb [arch=armhf signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/raspbian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null ``` 5. 更新软件包列表并安装Docker引擎: ``` sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io ``` 6. 验证Docker是否成功安装: ``` sudo docker run hello-world ``` 接下来,你可以使用Docker来安装Nextcloud。可以按照以下步骤进行安装: 1. 创建一个目录来存储Nextcloud的数据: ``` sudo mkdir /opt/nextcloud_data ``` 2. 创建一个Docker网络以供使用: ``` sudo docker network create nextcloud_network ``` 3. 运行Nextcloud容器: ``` sudo docker run -d \ --name nextcloud \ -p 8080:80 \ -v /opt/nextcloud_data:/var/www/html \ --network nextcloud_network \ nextcloud ``` 这将在树莓派上启动一个Nextcloud容器,并将其绑定到本地的8080端口。你可以通过访问 http://树莓派的IP地址:8080 来访问Nextcloud
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

JasperXzy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值