這是本文件的舊版!


NextCloud 安裝設定紀錄

  • 使用 PVE 內的 CT Templates : debian-10-turnkey-nextcloud_16.1-1_amd64.tar.gz
  • 如果沒有正式 SSL 憑證, 須將設定安裝 NextCloud 的 Domain Name 或 IP 必須要加入 config 定義的 trusted_domains 內 Exp. 192.168.11.24

    cd /var/www/nextcloud
    vi config/config.php

    :
      'trusted_domains' =>
      array (
        0 => 'localhost',
    1 => 'nextcloud.ichiayi.com',
    2 => '192.168.11.24',
      ),
      'datadirectory' => '/var/www/nextcloud-data',
      'dbtype' => 'mysql',
    :
  • 缺少安裝 bcmath PHP 套件問題
    • 安裝 php-bcmath

      apt install php-bcmath

    • 重啟 apache

      systemctl restart apache2

  • 新增「default_phone_region」
    • 編輯 config.php

      vi /var/www/nextcloud/config/config.php

      :
      :
        'default_phone_region' => 'TWN',
      );
  • Exp. 使用 Cloudflare 管理 DNS , 要申請 nextcloud.ichiayi.com 的 SSL 憑證, 執行方式
    1. apt install certbot python-certbot-apache
      certbot -d nextcloud.ichiayi.com --manual --preferred-challenges dns certonly

    2. 需要依照訊息顯示至 DNS 增加 TXT Record Exp.

      _acme-challenge.nextcloud.ichiayi.com
      
      yWQSKEASom2ngmRnohuDjVGJPA08d1DfZovl-JKnk-U

    3. 編輯 nextcloud.conf 定義憑證檔路徑

      vi /etc/apache2/sites-enabled/nextcloud.conf 

      :
      <VirtualHost *:443>
          SSLEngine on
          ServerAdmin webmaster@localhost
          DocumentRoot /var/www/nextcloud/
      
          SSLCertificateFile    /etc/letsencrypt/live/nextcloud.ichiayi.com/fullchain.pem
          SSLCertificateKeyFile /etc/letsencrypt/live/nextcloud.ichiayi.com/privkey.pem
      
          <IfModule mod_headers.c>
      :
    4. 編輯 config 檔案將正式憑證的網址設定為 trusted_domains 的第一項

      vi /var/www/nextcloud/config/config.php

      :
        'trusted_domains' =>
        array (
          0 => 'nextcloud.ichiayi.com',
      1 => '192.168.11.24',
        ),
        'datadirectory' => '/var/www/nextcloud-data',
        'dbtype' => 'mysql',
      :
    5. 重新啟動 apache2

      service apache2 restart

  • tech/nextcloud.1626141449.txt.gz
  • 上一次變更: 2021/07/13 09:57
  • jonathan