os_nextcloud

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
os_nextcloud [2025/03/18 02:12] – [PHP imagick module] Júne Parkos_nextcloud [2025/04/14 08:48] (current) – [Edit - Panel] Júne Park
Line 1: Line 1:
-====== Nextcloud™ ====== +====== Nextcloud™ ======
  
 ----  ---- 
  
 +===== Required packages ===== 
 +
 +<code bash> 
 +sudo apt install php8.x php8.x-common php8.x-gmp php8.x-mbstring php8.x-readline php8.x-xmlrpc php8.x-bcmath php8.x-curl php8.x-igbinary php8.x-mcrypt php8.x-redis php8.x-zip php8.x-bz2 php8.x-fpm php8.x-imagick php8.x-mysql php8.x-soap php8.x-cli php8.x-gd php8.x-intl php8.x-opcache php8.x-xml    
 +</code> 
 +
 +----
 ==== Optimized PHP Configuration ==== ==== Optimized PHP Configuration ====
  
Line 135: Line 142:
 === Additional PHP-FPM Settings ===  === Additional PHP-FPM Settings === 
  
 +Edit ''/etc/php/8.1/fpm/pool.d/www.conf'' 
 +
 +<accordion> 
 <code ini>  <code ini> 
 request_terminate_timeout = 300 request_terminate_timeout = 300
Line 145: Line 155:
 ---- ----
  
 +Optimal configuration for ''/etc/php/8.2/fpm/conf.d/10-opcache.ini '' 
 +
 +<panel title="Optimal configuration for 10-opcache.ini">
 +<code ini> 
 +; configuration for php opcache module
 +; priority=10
 +opcache.enable = 1
 +; Enable OPcache.
 +
 +opcache.memory_consumption = 128
 +; Memory for cached scripts (128 MB is a good starting point; increase to 256 MB if RAM allows).
 +
 +opcache.interned_strings_buffer = 8
 +; Memory for string interning (8 MB is sufficient for most cases).
 +
 +opcache.max_accelerated_files = 10000
 +; Max number of files to cache; adjust based on Nextcloud’s file count.
 +
 +opcache.revalidate_freq = 60
 +; How often to check for file changes (60 seconds balances performance and freshness).
 +
 +opcache.save_comments = 1
 +; Required by Nextcloud to preserve code comments in bytecode.
 +
 +zend_extension=opcache.so 
 +opcache.enable_cli = 1
 +; Disable for CLI to avoid unnecessary overhead in cron jobs.
 +;
 +opcache.jit_buffer_size = 100M
 +opcache.jit = tracing
 +; "tracing" mode offers the best performance for web apps like Nextcloud.
 +;
 +opcache.interned_strings_buffer = 16
 +opcache.memory_consumption = 256
 +</code> 
 +</panel>
 +</accordion> 
 +
 +
 +----
 ==== Nextcloud-Specific Tweaks ====  ==== Nextcloud-Specific Tweaks ==== 
  
Line 230: Line 280:
  
 ---- ----
 +===== Alter datadirectory after installation ===== 
 +
 +<code ini> 
 +ncdir='/path/to/nextcloud'
 +olddata='/old/path/to/data'
 +newdata='/new/path/to/data'
 +</code> 
 +
 +Turn maintenance mode on 
 +
 +<code bash> 
 +sudo -u www-data php "$ncdir/occ" maintenance:mode --on
 +</code> 
 +
 +Move / Copy datadirectory for your purpose. 
 +
 +Change ''datadirectory'' value in ''.../config/config.php'' 
 +
 +<code bash> 
 +sudo sed -i "s|$olddata|$newdata|" "$ncdir/config/config.php"
 +</code> 
 +
 +Before change database dataset, backup database for your safety. 
 +
 +Adjust ''oc_storages'' database table to reflect the new data folder location. 
 +
 +<code mysql> 
 +mysql -u"$dbuser" -p"$dbpass" -e "update $dbname.oc_storages set id='local::$newdata/' where id='local::$olddata/';"
 +</code> 
 +
 +----
 +
 ===== Solved Problems =====  ===== Solved Problems ===== 
  
Line 269: Line 351:
 sudo apt install php-imagick imagemagick sudo apt install php-imagick imagemagick
 </code>  </code> 
 +
 +----
 +
 +==== Incorrect row format found ==== 
 +
 +== Error description == 
 + 
 +<text type="danger">Incorrect row format found in your database. ROW_FORMAT=Dynamic offers the best database performances for Nextcloud. Please update row format on the following list: ... </text> 
 +
 +== Solution == 
 +
 +Create the script and run with root permission with following: 
 +
 +<code bash> 
 +#!/bin/bash
 +
 +# Prompt for database credentials
 +read -p "Enter Database Name: " DB_NAME
 +read -p "Enter Username: " DB_USER
 +read -s -p "Enter Password: " DB_PASS
 +echo
 +
 +# Execute all ALTER TABLE statements in one query
 +mysql -u "$DB_USER" -p"$DB_PASS" "$DB_NAME" -Bse "
 +SELECT CONCAT('ALTER TABLE \`', TABLE_NAME, '\` ROW_FORMAT=DYNAMIC;'
 +FROM INFORMATION_SCHEMA.TABLES 
 +WHERE TABLE_SCHEMA = '$DB_NAME' 
 +AND ENGINE = 'InnoDB'
 +" | mysql -u "$DB_USER" -p"$DB_PASS" "$DB_NAME"
 +
 +</code>
  
 ---- ----
  • os_nextcloud.1742263961
  • Last modified: 2025/03/18 02:12
  • by Júne Park