sudo apt install rsyslog
php (nextCloudのルートフォルダ)/occ log:file
php (nextCloudのルートフォルダ)/occ log:manage --level=info --timezone Asia/Tokyo
sudo yum install php74-php-opcache php74-php-pecl-apcu
find /opt -name "*opcache*"
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/
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
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
sudo yum install php74-php-pecl-apcu
find /opt -name "*apcu*"
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/
'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, │ ], │ );
sudo systemctl restart httpd
sudo yum install php74-php-pecl-redis
find /opt -name "*redis.so*"
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/
find /opt -name "*igbinary*"
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/
find /opt -name "*msgpack*"
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/
'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, ], );
sudo systemctl restart httpd
opcache.interned_strings_buffer=32
sudo systemctl restart httpd
pm = static pm.max_children = 120 pm.start_servers = 12 pm.min_spare_servers = 6 pm.max_spare_servers = 18
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 OpenJDK Runtime Environment (build 17.0.14+7-Debian-1deb12u1) OpenJDK 64-Bit Server VM (build 17.0.14+7-Debian-1deb12u1, mixed mode, sharing) |
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
sudo apt-get install apt-transport-https
sudo apt update apt -y install elasticsearch
sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-kuromoji
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
sudo vim /etc/elasticsearch/elasticsearch.yml
# 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 # keystore.path: certs/http.p12 # xpack.security.http.ssl: enabled: false # keystore.path: certs/http.p12 # Enable encryption and mutual authentication between cluster nodes #xpack.security.transport.ssl: # enabled: true # verification_mode: certificate # keystore.path: certs/transport.p12 # truststore.path: certs/transport.p12 xpack.security.transport.ssl: 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 -------------------------
sudo systemctl restart elasticsearch sudo systemctl enable elasticsearch
curl http://localhost:9200
sudo -u www-data php occ fulltextsearch:check sudo -u www-data php occ fulltextsearch:test
sudo -u www-data php occ fulltextsearch:index
sudo -u www-data php occ fulltextsearch:index "{\"errors\": \"reset\"}"
#!/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
[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
sudo systemctl unmask nextCloudFullTextSearch.service
sudo systemctl enable nextCloudFullTextSearch.service sudo systemctl restart nextCloudFullTextSearch.service
$ 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
<?php phpinfo(); ?>
sudo chown apache: -R /var/lib/php/session
sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin
sudo chown apacheUser:ApacheUsers /var/lib/php/sessions -R
sudo gpasswd -a apacheUser redis
systemctl restart redis systemctl restart apache2
/usr/bin/php -f /var/www/nextcloud/cron.php --define apc.enable_cli=1
sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/updater/updater.phar
sudo chown www-data:www-data -R /var/www/nextcloud/*
sudo vim /var/www/nextcloud/config/config.php
'maintenance' => false,
sudo systemctl restart apache2