顯示頁面舊版反向連結Fold/unfold all回到頁頂 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== NextCloud 安裝設定紀錄 ====== ===== 使用 Ubuntu + Docker 安裝方式 ===== * 參考 - https://github.com/nextcloud/all-in-one * 安裝 docker <cli> curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt install docker.io docker-compose-plugin </cli> * 將 jonathan 加入 docker <cli> sudo usermod -aG docker jonathan </cli> * 依據 [[https://github.com/nextcloud/all-in-one/blob/main/compose.yaml|compose.yaml]] 檔案內容進行調整<cli> services: nextcloud-aio-mastercontainer: image: nextcloud/all-in-one:latest init: true restart: always container_name: nextcloud-aio-mastercontainer volumes: - nextcloud_aio_mastercontainer:/mnt/docker-aio-config - /var/run/docker.sock:/var/run/docker.sock:ro ports: - 8080:8080 environment: - SKIP_DOMAIN_VALIDATION=true - NEXTCLOUD_DATADIR=/opt/stacks/nextcloud/ncdata - NEXTCLOUD_MOUNT=/mnt/ volumes: nextcloud_aio_mastercontainer: name: nextcloud_aio_mastercontainer </cli> * 連上 https://server_ip:8080 <note tip> * 如果第一時間沒有看到 AIO password 可以透過以下方式取得 <cli> sudo docker exec nextcloud-aio-mastercontainer grep password </cli> </note> ==== 參考網址 ==== * https://github.com/nextcloud/all-in-one/discussions/1786 ===== 使用 PVE 內的 CT Templates 安裝方式 ===== * 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 <cli> cd /var/www/nextcloud vi config/config.php </cli><file> : 'trusted_domains' => array ( 0 => 'localhost', 1 => 'nextcloud.ichiayi.com', 2 => '192.168.11.24', ), 'datadirectory' => '/var/www/nextcloud-data', 'dbtype' => 'mysql', : </file> ===== 解決安全設定警告項目 ===== * 缺少安裝 bcmath PHP 套件問題 * 安裝 php-bcmath<cli> apt install php-bcmath </cli> * 重啟 apache <cli> systemctl restart apache2 </cli> * 新增「default_phone_region」 * 編輯 config.php <cli>vi /var/www/nextcloud/config/config.php</cli><file> : : 'default_phone_region' => 'TWN', ); </file> ===== 重新設定 admin 密碼 ===== * 參考 - https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/reset_admin_password.html * 在主機內使用 www-data 身分直接用命令執行重設密碼 <cli> apt install sudo sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin </cli> * ++實際操作紀錄|<cli> root@nextcloud ~# sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin Enter a new password: Confirm the new password: Successfully reset password for admin </cli>++ ===== 設定 Let's Encrypt SSL 憑證 ===== * 參考 - https://nextcloudpi-documentation-taiwan-traditional-chinese.readthedocs.io/zh_TW/latest/Configure/How-to-get-certificate-with-Letsencrypt-using-DNS-to-verify-domain/ * Exp. 使用 Cloudflare 管理 DNS , 要申請 nextcloud.ichiayi.com 的 SSL 憑證, 執行方式 - <cli> apt install certbot python-certbot-apache certbot -d nextcloud.ichiayi.com --manual --preferred-challenges dns certonly </cli> - 需要依照訊息顯示至 DNS 增加 TXT Record Exp. <cli> _acme-challenge.nextcloud.ichiayi.com yWQSKEASom2ngmRnohuDjVGJPA08d1DfZovl-JKnk-U </cli> - 編輯 nextcloud.conf 定義憑證檔路徑 <cli> vi /etc/apache2/sites-enabled/nextcloud.conf </cli><file> : <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> : </file> - 編輯 config 檔案將正式憑證的網址設定為 trusted_domains 的第一項 <cli> vi /var/www/nextcloud/config/config.php</cli><file> : 'trusted_domains' => array ( 0 => 'nextcloud.ichiayi.com', 1 => '192.168.11.24', ), 'datadirectory' => '/var/www/nextcloud-data', 'dbtype' => 'mysql', : </file> - 重新啟動 apache2 <cli> service apache2 restart </cli> {{tag>nextcloud tips}} tech/nextcloud.txt 上一次變更: 2023/11/21 08:59由 jonathan