#author("2025-06-07T16:01:07+09:00","default:dramsukohome","dramsukohome")
#author("2025-06-07T16:39:34+09:00","default:dramsukohome","dramsukohome")
[[LinuxServer]]

#shadowheader(1,"nextcloud");

#contents




* 初回設定、参考サイト [#p3618aa5]
-このサイトが一番わかりやすそうかな。。。~
自分は既存の環境(LAMP)にインストール、設定しました。
--[[NextCloud : インストール:https://www.server-world.info/query?os=CentOS_7&p=nextcloud]]




* rsyslogのインストール [#n2a6b87d]
 sudo apt install rsyslog




* Log出力設定の変更 [#ie24b2e0]

 

** 参考サイト [#we05392c]
-[[【techblog】Nextcloudの管理用CLI「occ」詳細: ログ管理に関するコマンド:https://nextcloud.stylez.co.jp/blog/techblog/occ_details_log.html]]



** ログの出力、確認 [#gda26f11]
 php (nextCloudのルートフォルダ)/occ log:file



** ログの出力方式変更 [#l736066e]
 php (nextCloudのルートフォルダ)/occ log:manage --level=info --timezone Asia/Tokyo




* Install後のセキュリティ&セットアップ警告 [#yd6b5317]
-&color(red,){''自分の環境に特化した内容が含まれますので、あくまでご参考です''};



** 「.soファイル」のコピー先の確認方法 [#f9eea653]
-phpinfo で「extension_dir」を確認



** OPcache [#g37d322d]


*** Install [#p20b5ae0]
 sudo yum install php74-php-opcache php74-php-pecl-apcu


*** 必要なファイルをApacheが参照しているディレクトリへコピー [#o4d4dced]
+必要なファイルの検索1
 find /opt -name "*opcache*"
+必要なファイルの検索2
 find /etc -name "*opcache*"
+ファイルのコピー
 sudo cp /etc/opt/remi/php74/php.d/10-opcache.ini /etc/php.d/
 sudo cp /opt/remi/php74/root/usr/lib64/php/modules/opcache.so /usr/lib64/php/modules/


*** 設定変更 [#m6fa9c49]
+sudo vim /etc/php.d/10-opcache.ini
 zend_extension=opcache
 opcache.enable=1
 opcache.interned_strings_buffer=8
 opcache.max_accelerated_files=10000
 opcache.memory_consumption=128
 opcache.save_comments=1
 opcache.revalidate_freq = 60
 opcache.validate_timestamps = 0


***確認 [#o892298a]
+php -v
++結果例
 PHP 7.4.33 (cli) (built: Apr 10 2024 09:34:29) ( NTS )
 Copyright (c) The PHP Group
 Zend Engine v3.4.0, Copyright (c) Zend Technologies
     with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
+phpinfoにも「Zend OPcache」の項目として出てきます



** APCu [#h69a73a4]


*** Install [#i8258739]
 sudo yum install php74-php-pecl-apcu


*** 必要なファイルをApacheが参照しているディレクトリへコピー [#h86464df]
+必要なファイルの検索1
 find /opt -name "*apcu*"
+必要なファイルの検索2
 find /etc -name "*apcu*"
+ファイルのコピー
 sudo cp /etc/opt/remi/php74/php.d/40-apcu.ini /etc/php.d/
 sudo cp /opt/remi/php74/root/usr/lib64/php/modules/apcu.so /usr/lib64/php/modules/


*** 設定変更 [#vfc31d5b]
+sudo vim (nextCloudのルートフォルダ)/config/config.php
--「'memcache.local' => '\OC\Memcache\APCu',」を追加
   'installed' => true,                                                                                                    │
   'default_phone_region' => 'JP',                                                                                         │
   'memcache.local' => '\OC\Memcache\APCu',                                                                                │
   'memcache.distributed' => '\OC\Memcache\Redis',                                                                         │
   'memcache.locking' => '\OC\Memcache\Redis',                                                                             │
   'redis' => [                                                                                                            │
        'host' => 'localhost',                                                                                             │
        'port' => 6379,                                                                                                    │
   ],                                                                                                                      │
 );    


***確認 [#pe9ef05a]
+httpdを再起動
 sudo systemctl restart httpd
+phpinfoに「apcu」の項目として出てきます。



** redis [#z0120fd3]


*** Install [#e2a8ffa9]
 sudo yum install php74-php-pecl-redis


*** 必要なファイルをApacheが参照しているディレクトリへコピー [#w3e0141c]
+redis関連
++必要なファイルの検索1
 find /opt -name "*redis.so*"
++必要なファイルの検索2
 find /etc -name "*redis*"
++ファイルのコピー
 sudo cp /etc/opt/remi/php74/php.d/50-redis.ini /etc/php.d/
 sudo cp /opt/remi/php74/root/usr/lib64/php/modules/redis.so /usr/lib64/php/modules/
+igbinary.so
++必要なファイルの検索1
 find /opt -name "*igbinary*"
++必要なファイルの検索2
 find /etc -name "*igbinary*"
++ファイルのコピー
 sudo cp /etc/opt/remi/php74/php.d/40-igbinary.ini /etc/php.d/
 sudo cp /opt/remi/php74/root/usr/lib64/php/modules/igbinary.so /usr/lib64/php/modules/
+msgpack.so
++必要なファイルの検索1
 find /opt -name "*msgpack*"
++必要なファイルの検索2
 find /etc -name "*msgpack*"
++ファイルのコピー
 sudo cp /etc/opt/remi/php74/php.d/40-msgpack.ini /etc/php.d/
 sudo cp /opt/remi/php74/root/usr/lib64/php/modules/msgpack.so /usr/lib64/php/modules/



*** 設定変更 [#xbc91c06]
+sudo vim (nextCloudのルートフォルダ)/config/config.php
--「'memcache.distributed' => '\OC\Memcache\Redis',」以下を追加
   'installed' => true,
   'default_phone_region' => 'JP',
   'memcache.local' => '\OC\Memcache\APCu',
   'memcache.distributed' => '\OC\Memcache\Redis',
   'memcache.locking' => '\OC\Memcache\Redis',
   'redis' => [
        'host' => 'localhost',
        'port' => 6379,
   ],
 );


***確認 [#g53e5f09]
+httpdを再起動
 sudo systemctl restart httpd
+phpinfoに「redis」の項目として出てきます。



** OPcacheのインターン化文字列バッファーがまもなく一杯になります。全てのスクリプトをキャッシュに保管できるようにするには、opcache.interned_strings_bufferの値を8より多い値で、PHP設定に適用することを推奨します。 [#a821c6d5]
-sudo vim /etc/php.d/10-opcache.ini
 opcache.interned_strings_buffer=32
-restart httpd
 sudo systemctl restart httpd



** php-fpm のチューニング [#ad171cf5]
- [[参考サイト(nextcloudが速くなるチューニングポイント):https://blog.future.ad.jp/nextcloud%E3%81%8C%E9%80%9F%E3%81%8F%E3%81%AA%E3%82%8B%E3%83%81%E3%83%A5%E3%83%BC%E3%83%8B%E3%83%B3%E3%82%B0%E3%83%9D%E3%82%A4%E3%83%B3%E3%83%88]]
- sudo vim /etc/php/8.2/fpm/pool.d/www.conf
- 設定値参考
 pm = static
 pm.max_children = 120
 pm.start_servers = 12
 pm.min_spare_servers = 6
 pm.max_spare_servers = 18



** ssl証明書関連 [#va99c0ce]
+ ディレクトリ
-- 設定ファイル
 /etc/apache2/mods-enabled/ssl.conf
-- 証明書ファイルが入っているディレクトリ
 /etc/ssl/private/
+関連ファイル
++ csr(元)
 server.csr
++ 証明書
 server.crt
++ keyファイル
 server.key
++ 中間証明書
 server-chain.crt




* 全文検索機能を組み込む(elasticsearch,Full text search) [#g3cf3572]



** 環境 [#dd9b58d6]
-NextCloud純正のVMイメージから仮想マシンを作ってます。~
elasticsearchはNextCloudのサーバに同居させてます。
|debian|12.9|
|nextcloud|Nextcloud Hub 9 (30.0.6)|
|elasticsearch|Version: 8.17.2, Build: deb/747663ddda3421467150de0e4301e8d4bc636b0c/2025-02-05T22:10:57.067596412Z, JVM: 23|
|java|openjdk version "17.0.14" 2025-01-21&br;OpenJDK Runtime Environment (build 17.0.14+7-Debian-1deb12u1)&br;OpenJDK 64-Bit Server VM (build 17.0.14+7-Debian-1deb12u1, mixed mode, sharing)|



** elasticsearchサーバの構築 [#gc64b426]


*** install [#if1ec6eb]
+レポジトリkeyのインストール
 wget https://artifacts.elastic.co/GPG-KEY-elasticsearch -O /etc/apt/keyrings/GPG-KEY-elasticsearch.key
 echo "deb [signed-by=/etc/apt/keyrings/GPG-KEY-elasticsearch.key] https://artifacts.elastic.co/packages/8.x/apt stable main" | tee /etc/apt/sources.list.d/elastic-8.x.list 
+関連パッケージのインストール(ただあとでsslは無効化するので不要かも。。。)
 sudo apt-get install apt-transport-https
+install
 sudo apt update
 apt -y install elasticsearch
+アナライザ トークナイザ、「analysis-kuromoji」のインストール
 sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-kuromoji


*** メモリ関連の設定 [#qf100bdf]
 sudo vim /etc/elasticsearch/jvm.options 
+以下を追加(値は各自のサーバ状況に合わせて下さい)
 ################################################################
 ## IMPORTANT: JVM heap size
 ################################################################
 ##
 ## The heap size is automatically configured by Elasticsearch
 ## based on the available memory in your system and the roles
 ## each node is configured to fulfill. If specifying heap is
 ## required, it should be done through a file in jvm.options.d,
 ## which should be named with .options suffix, and the min and
 ## max should be set to the same value. For example, to set the
 ## heap to 4 GB, create a new file in the jvm.options.d
 ## directory containing these lines:
 ##
 ## -Xms4g
 ## -Xmx4g
 ##
 ## See https://www.elastic.co/guide/en/elasticsearch/reference/8.17/heap-size.html
 ## for more information
 ##
 ################################################################
 
 -Xms1g
 -Xmx2g


*** sslの無効化(これ以降、pluginのインストールもできなくなります) [#vced3bb6]
*** sslの無効化 [#i727f2aa]
 sudo vim /etc/elasticsearch/elasticsearch.yml

 # ======================== Elasticsearch Configuration =========================
 #
 # NOTE: Elasticsearch comes with reasonable defaults for most settings.
 #       Before you set out to tweak and tune the configuration, make sure you
 #       understand what are you trying to accomplish and the consequences.
 #
 # The primary way of configuring a node is via this file. This template lists
 # the most important settings you may want to configure for a production cluster.
 #
 # Please consult the documentation for further information on configuration options:
 # https://www.elastic.co/guide/en/elasticsearch/reference/index.html
 #
 # ---------------------------------- Cluster -----------------------------------
 #
 # Use a descriptive name for your cluster:
 #
 #cluster.name: my-application
 #
 # ------------------------------------ Node ------------------------------------
 #
 # Use a descriptive name for the node:
 #
 #node.name: node-1
 #
 # Add custom attributes to the node:
 #
 #node.attr.rack: r1
 #
 # ----------------------------------- Paths ------------------------------------
 #
 # Path to directory where to store the data (separate multiple locations by comma):
 #
 path.data: /var/lib/elasticsearch
 #
 # Path to log files:
 #
 path.logs: /var/log/elasticsearch
 #
 # ----------------------------------- Memory -----------------------------------
 #
 # Lock the memory on startup:
 #
 #bootstrap.memory_lock: true
 #
 # Make sure that the heap size is set to about half the memory available
 # on the system and that the owner of the process is allowed to use this
 # limit.
 #
 # Elasticsearch performs poorly when the system is swapping the memory.
 #
 # ---------------------------------- Network -----------------------------------
 #
 # By default Elasticsearch is only accessible on localhost. Set a different
 # address here to expose this node on the network:
 #
 #network.host: 192.168.0.1
 #
 # By default Elasticsearch listens for HTTP traffic on the first free port it
 # finds starting at 9200. Set a specific HTTP port here:
 #
 #http.port: 9200
 #
 # For more information, consult the network module documentation.
 #
 # --------------------------------- Discovery ----------------------------------
 #
 # Pass an initial list of hosts to perform discovery when this node is started:
 # The default list of hosts is ["127.0.0.1", "[::1]"]
 #
 #discovery.seed_hosts: ["host1", "host2"]
 #
 # Bootstrap the cluster using an initial set of master-eligible nodes:
 #
 #cluster.initial_master_nodes: ["node-1", "node-2"]
 #
 # For more information, consult the discovery and cluster formation module documentation.
 #
 # ---------------------------------- Various -----------------------------------
 #
 # Allow wildcard deletion of indices:
 #
 #action.destructive_requires_name: false
 
 #----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
 #
 # The following settings, TLS certificates, and keys have been automatically
 # generated to configure Elasticsearch security features on 07-06-2025 05:58:45
 #
 # --------------------------------------------------------------------------------
 
 ## Enable security features
 #xpack.security.enabled: true
 xpack.security.enabled: false
 
   #xpack.security.enrollment.enabled: true
 xpack.security.enrollment.enabled: false
 
 # Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
 xpack.security.http.ssl:
   ##enabled: true
   enabled: false
   # keystore.path: certs/http.p12
   #
   ## Enable encryption and mutual authentication between cluster nodes
 xpack.security.transport.ssl:
   #   enabled: true
   enabled: false
   #   verification_mode: certificate
   #   keystore.path: certs/transport.p12
   #   truststore.path: certs/transport.p12
 
   ## Create a new cluster with the current node only
   ## Additional nodes can still join the cluster later
 cluster.initial_master_nodes: ["serverName"]
 
   ## Allow HTTP API connections from anywhere
   ## Connections are encrypted and require user authentication
 http.host: 0.0.0.0
   #
   ## Allow other nodes to join the cluster from anywhere
   ## Connections are encrypted and mutually authenticated
   ##transport.host: 0.0.0.0
   #
 #----------------------- END SECURITY AUTO CONFIGURATION -------------------------
  

*** elasticsearchデーモンの起動と自動起動設定 [#m144ae35]
 sudo systemctl restart elasticsearch 
 sudo systemctl enable elasticsearch 


*** 動作確認 [#d40e98d3]
+なんかしら帰ってきます。ブラウザでも確認可能。
 curl http://localhost:9200



** nextcloud側の設定 [#k91666f3]


*** 関連アプリのインストール [#ff580305]
+右上のイニシャルボタンから「アプリ」を選択
--&imgr(./image/nextCloud/nextCloudApp01.png,100%);
+左側の「ダッシュボード」を選択し、上の検索から「full text」で検索~
下の画像の3つを有効にしてインストールします。
--&imgr(./image/nextCloud/nextCloudApp02.png,100%);


*** 設定 [#a6d7c376]
+右上のイニシャル・アイコンから「管理者設定」を選択
--&imgr(./image/nextCloud/nextCloudApp03.png,100%);
+左側から全文検索を選択
--&imgr(./image/nextCloud/nextCloudApp04.png,100%);
+設定イメージ
--&imgr(./image/nextCloud/nextCloudApp05.png,100%);
--&imgr(./image/nextCloud/nextCloudApp06.png,100%);
+設定値(コピペできるように)
--http://localhost:9200/
--nextcloud
---これ、はまりました。。。この文字列でないとelasticsearchが動かないです。。。
--analysis-kuromoji



** 全文検索、index作成テストと作成 [#n74b0712]
-occ は、/var/www/nextcloud/occ かもしれない。
 sudo -u www-data php occ fulltextsearch:check
 sudo -u www-data php occ fulltextsearch:test
-indexの作成
 sudo -u www-data php occ fulltextsearch:index
-エラー数をリセットしたい場合
 sudo -u www-data php occ fulltextsearch:index "{\"errors\": \"reset\"}"



** daemon化 [#i6dcb3c9]


*** scriptの作成 [#ud6b6f62]
+sudo vi /usr/local/bin/nextCloudFullTextSearch.sh
 #!/bin/sh
 
 # Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
 set -e
 
 # Must be a valid filename
 NAME=fulltextsearch-daemon
 PIDFILE=/var/run/$NAME.pid
 #This is the command to be run, give the full pathname
 DAEMON="/usr/bin/php"
 DAEMON_OPTS="/var/www/nextcloud/occ fulltextsearch:live"
 
 export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
 
 case "$1" in
   start)
         echo -n "Starting daemon: "$NAME
         start-stop-daemon --start --background --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
         echo "."
         ;;
   stop)
         echo -n "Stopping daemon: "$NAME
         start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
         echo "."
         ;;
   restart)
         echo -n "Restarting daemon: "$NAME
         start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE
         start-stop-daemon --start --background --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
         echo "."
         ;;
 
   *)
         echo "Usage: "$1" {start|stop|restart}"
         exit 1
 esac
 
 exit 0
+実行権限の追加
 sudo chmod +x /usr/local/bin/nextCloudFullTextSearch.sh


*** systemctlへ登録 [#kb68eec9]
- [[参考サイト1(systemdの.serviceファイルで、実行ユーザーを指定する):https://qiita.com/todanano/items/f66f1a3ad76f76de0772]]
- [[参考サイト2(systemd のユニットファイルの作り方):https://tex2e.github.io/blog/linux/create-my-systemd-service]]
+ sudo vi /etc/systemd/system/nextCloudFullTextSearch.service
 [Unit]
 Description = nextCloudFullTextSearch
 
 [Service]
 Restart = no
 Type = forking
 User=www-data
 Group=www-data
 ExecStart = /usr/local/bin/nextCloudFullTextSearch.sh start
 ExecReload = /usr/local/bin/nextCloudFullTextSearch.sh reload
 ExecStop = /usr/local/bin/nextCloudFullTextSearch.sh stop
 
 [Install]
 WantedBy = multi-user.target
+ 登録できたか確認
 sudo systemctl list-unit-files --type=service  | grep next
+ maskの解除
 sudo systemctl unmask nextCloudFullTextSearch.service
-- 何故か上記のファイルが消えたので再度作成


*** 起動と自動起動化 [#o3c8d902]
 sudo systemctl enable nextCloudFullTextSearch.service
 sudo systemctl restart nextCloudFullTextSearch.service


*** 実行されているか確認 [#o1b541ba]
- ps ax | grep occ


*** インデックス化するファイルの拡張子について [#w80fd76a]
- 設定項目はありません。ElasticSearchがファイルの中身を見て勝手にインデックスを作成します。



** エラー対応 [#rb73b766]


*** Testing search platform. fail [#q498f982]
-エラー内容
 $ sudo docker exec --user www-data nextcloud php occ fulltextsearch:test
 .Testing your current setup:
 Creating mocked content provider. ok
 Testing mocked provider: get indexable documents. (2 items) ok
 Loading search platform. (Elasticsearch) ok
 Testing search platform. fail
 .Testing your current setup:
 Creating mocked content provider. ok
 Testing mocked provider: get indexable documents. (2 items) ok
 Loading search platform. (Elasticsearch) ok
 Testing search platform. fail
-原因
--多分、ssl関連
-対策
--elasticsearchの非ssl化(https -> http)


*** retrieving content from a big index (license). fail [#z807c189]
-原因
--「インデックス,インデックスの名前」が間違えている
-- &imgr(./image/nextCloud/nextCloudApp07.png,100%);
-対策
-- インデックス名を正しい文字列へ
-- NextCloud -> &br; -> 右上(イニシャル・アイコン)から「管理者設定」-> &br; -> 左側「全文検索」-> &br; -> 「インデックス,インデックスの名前」




* その他 [#a7b320c1]



** sessionディレクトリへ権限追加 [#z716795d]
-参考サイト[[【Nextcloud】ログインループ (3) -アッサリ解決-:https://diary.d-yoshi.com/%E3%80%90nextcloud%E3%80%91%E3%83%AD%E3%82%B0%E3%82%A4%E3%83%B3%E3%83%AB%E3%83%BC%E3%83%97-3-%E3%82%A2%E3%83%83%E3%82%B5%E3%83%AA%E8%A7%A3%E6%B1%BA/]]


*** sessionディレクトリの確認 [#k4f34570]
-phpinfo()で確認する
 <?php
 
 phpinfo();
 
 ?>


*** sessionディレクトリへアクセス兼を設定 [#u0bacdbf]
 sudo chown apache: -R /var/lib/php/session



** パスワード・リセット [#l342e888]
 sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin



** WebDav [#xf4dde6b]


*** WindowsのExplorer(エクスプローラー)でマウント [#g43934d8]
-なんとなくできなくなった?あるいはできなくなる?
--[[Microsoft、WebDAVを含む3つの機能をWindowsから非推奨へ:https://news.mynavi.jp/techplus/article/20231108-2812731/#:~:text=Microsoft%E3%81%AFWindows%E5%90%91%E3%81%91%E3%81%AE,%E3%81%A8%E8%AA%AC%E6%98%8E%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%80%82&text=%E4%BB%8A%E5%9B%9E%E3%80%81%E9%9D%9E%E6%8E%A8%E5%A5%A8%E3%81%AE%E3%83%AA%E3%82%B9%E3%83%88,%E6%A6%82%E8%A6%81%E3%81%AF%E4%BB%A5%E4%B8%8B%E3%81%AE%E9%80%9A%E3%82%8A%E3%80%82&text=Computer%20Browser%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E3%81%AFWindows,%E6%98%8E%E3%82%89%E3%81%8B%E3%81%AB%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%81%AA%E3%81%84%E3%80%82]]
-[[参考サイト:https://qiita.com/legitwhiz/items/9ec7d672874ca8ce35bb]]


*** サードパーティのWebDavクライアントソフトを使います。 [#eb612d86]
-[[WebDavクライアントのまとめサイト:https://www.nminoru.jp/~nminoru/pc/webdav_clients.html]]
-- 個人的には「RaiDrive」が良いかな、と思いました。
--- [[RaiDrive download site:https://www.raidrive.com/download]]



** Apache実行ユーザーの変更 [#u3efce90]


***ログインできない [#w8acd740]
-大体、sessionフォルダへのアクセス権の問題
 sudo chown apacheUser:ApacheUsers /var/lib/php/sessions -R


*** redis エラー [#m1c11177]
-redis グループへApache2実行ユーザーを追加
 sudo gpasswd -a apacheUser redis
-daemon再起動
 systemctl restart redis
 systemctl restart apache2


***cron実行ユーザーの変更 [#u5ae7346]
- sudo vim /etc/cron.d/nextcloud



** 詳細ログ(ログイン、ログオフなど)の記録 [#pc5e887a]
+NextCloudへ「Auditing / Logging」アプリのインストール
+ログレベルを1(info)へ変更
-- sudo vi /var/www/nextcloud/config/config.php
  'log_type' => 'file',
  'logfile' => '/var/www/nextcloud-data/nextcloud.log',
  'loglevel' => 1,
+以下のディレクトリ内、2つのファイルに記録される
 /var/www/nextcloud-data/nextcloud.log
 /var/www/nextcloud-data/audit.log



** upgrade後のレストア(restore)、バックアップから戻す [#b5f22786]


*** 参考サイト(公式) [#m7e339db]
-[[Restoring backup:https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html]]


*** restoreコマンド例 [#z9a3e831]
+最初にメンテンスモードをオン
 sudo vi /var/www/nextcloud/config/config.php
   'maintenance' => true,
+rsyncコマンドでバックップディレクトリからコピーする。
 sudo rsync -Aaxv /var/www/nextcloud-data/updater-563ec6d8383a3/backups/nextcloud-30.0.6.2-1740524203/* /var/www/nextcloud/*
+メンテナンス・モードをオフ
 sudo vi /var/www/nextcloud/config/config.php
    'maintenance' => false
+apache2のリスタート
 systemctl restart apache2



** NextCloudクライアント(Windows)、仮想ファイルのローカルPathを変更 [#rb98b3b9]
+以下のファイルを編集
 %appdata%\nextcloud\nextcloud.cfg
+以下の場所を変更~
(フォルダのデリミッタはスラッシュなので注意。~
バックスラッシュ(\)ではない)
 0\FoldersWithPlaceholders\1\localPath
--例
 0\FoldersWithPlaceholders\1\localPath=D:/nextCloud



** Ubuntuでのマウント [#u8afa4ef]
+ sudo apt install davfs2
+ /etc/fstab
 https://nextcloud.example.com/remote.php/dav/files/myuser/ /mnt/nextcloud davfs rw,nofail,user,uid=myuser 0 0
+ /etc/davfs2/secrets
 https://nextcloud.example.com/remote.php/dav/files/myuser/ myuser APP_PASSWORD




* エラー対処 [#g0b254b3]



** 参考サイト [#a7bad03f]
-[[Linuxで様々なサービスを構築しよう!!!:https://www.bigbang.mydns.jp/nextcloud-x.htm]]

 

** cron.phpが実行されない [#g5e94c4d]
+以下に変更(/dev/null 2>&1を消し、apc.enable を追加)
+sudo vim /etc/cron.d/nextcloud
 /usr/bin/php -f /var/www/nextcloud/cron.php --define apc.enable_cli=1
+設定変更後は少し時間がかかる事がありますが、何回か実行していると5分以内に収まるようになります。
+実行されているかの確認は、NextCloudの「管理者設定」->「基本設定」で確認可能です。
+updateの失敗でなくても以下のコマンドは基本。実行してみる。~
(自分はこれでcronが動くようになりました)
 sudo chown www-data:www-data -R /var/www/nextcloud/*


** updateに失敗する(create backup failed) [#c9e0f87d]
+最初に「対応バージョンがないアプリ」を確認。対応してないと動かなくなります。
+以下のコマンドで確認
 sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/updater/updater.phar
+バックアップの失敗はpermissionエラーの場合が多い。~
以下のコマンドを実行
 sudo chown www-data:www-data -R /var/www/nextcloud/*



** メンタンス・モード(Maintenanceモード)が解除されない。 [#k7c3ec42]
+以下のファイルを編集
 sudo vim /var/www/nextcloud/config/config.php
+以下の場所
  'maintenance' => false,



** Downgrading is not supported and is likely to cause unpredictable issues [#g8e26f06]
+apacheの再起動
 sudo systemctl restart apache2



** 同期エラーで修正しようとしても「ローカルファイルコピー元のファイルが存在しません」となる [#n8dd5369]
+NextCloud側にゴミが残っているので、ブラウザでNextCloudにアクセスし、当該ファイルを削除する。~
(F5キーなど最新の情報に更新するのを忘れずに。。。)



** Windows用, NextCloud ファイル・クライアントで VCOMP140.DLLが見つからないエラー [#d581ec3a]
+以下をインストール
--[[Visual C++ Redistributable for Visual Studio 2015:https://www.microsoft.com/en-ca/download/details.aspx?id=48145]]




* 以下、効果が無く間違い(勘違い)でした。。。Windowsの仮想ファイル同期には影響しません。。。 [#xc3644d7]



** 仮想ファイルのgroupfolders同期(Team folders, Group folders) [#jba5e082]


*** Group folders(Team folders)機能の有効化 [#g0be7b88]
+ネットの記事では Group folders として載ってることが多いですが、 Team foldersへ名称に変更なったようです。
+右上、ユーザーアイコンから、「+アプリ」を選択
+左のメニューから「ダッシュボード」を検索
+右上、ユーザーアイコンの3つ左、虫めがねマークをクリック
+「Team」で検索
+「Team folders」を有効化


*** Teamフォルダの作成 [#yb63da56]
+右上、ユーザーアイコンをクリック -> 「管理者設定」
+左メニューから「チームフォルダー」を選択
+任意の名前でチームフォルダーを作成する


*** groupfolder同期したいフォルダを、作成したチームフォルダーへ移動 [#f84dea85]


*** file同期からgroupfolders同期へ変更 [#v0b5210a]
+nextcloudのサーバへsshでログイン
+nextcloudのフォルダへ移動
 cd /var/www/nextcloud/
+ group IDの確認~
一番左の「Folder Id」がグループIDです。
 sudo -u www-data php occ groupfolders:list
+ 以下のコマンドを実行してgroupfolders同期へ変更~
(20万ファイル位で25分位かかりました)
(これで設定は完了です)
 sudo -u apacheUser php occ groupfolders:scan 1

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS