7/07/2021

Next cloud Update : 15 To 21 Ubuntu 18.04

Next cloud Update : 15 To 21 Ubuntu 18.04

แก้ Wranning
MySQL is used as database but does not support 4-byte characters. To be able to handle 4-byte characters (like emojis) without issues in filenames or comments for example it is recommended to enable the 4-byte support in MySQL. For further details read the documentation page about this.
  1. mysql -V
  2. /etc/mysql/mariadb.conf.d/50-server.cnf

เพิ่ม ไว้ใต้ [mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1
  1. service mysqld restart
  2. mysql -u root -p
  3. Enter password: database

show databases;
  1. SELECT NAME, SPACE, FILE_FORMAT FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME like "nextcloud%";

https://www.allerstorfer.at/enabling-my ... ntu-18-04/

ทำต่อ
  1. show variables like 'innodb_file_per_table';

เข้าใน Terminal ไม่ต้องเข้า sql
  1. cd /var/www/nextcloud
  2. sudo -u www-data php occ maintenance:mode --on

Run ใน mysql
  1. ALTER DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

Run ใน Terminal
  1. sudo -u www-data php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
  2. sudo -u www-data php occ maintenance:repair

รอสักพัก เสร็จ Run ใน Terminal
  1. sudo -u www-data php occ maintenance:mode --off

https://docs.nextcloud.com/server/21/ad ... pport.html

The PHP memory limit is below the recommended value of 512MB.
  1. php -v
  2. nano /etc/php/7.0/apache2/php.ini
หา memory_limit จาก 128 เป็น 512
  1. nano /etc/php/7.0/cli/php.ini
หา memory_limit จาก 128 เป็น 512
  1. restart apache
  2. /etc/init.d/apache2 restart

https://help.nextcloud.com/t/the-php-me ... 12mb/42719
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.
Missing index "parent_index" in table "oc_share".
Missing index "owner_index" in table "oc_share".
Missing index "initiator_index" in table "oc_share".
Missing index "fs_mtime" in table "oc_filecache".
แก้
  1. cd /var/www/nextcloud
  2. sudo -u www-data php occ db:add-missing-indices
ต้องแก้ memory_limit
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 36864 bytes) in /var/www/nextcloud/3rdparty/composer/autoload_static.php on line 2439
  1. nano /etc/php/7.0/apache2/php.ini
memory_limit จาก 512 เป็น 2048M
  1. nano /etc/php/7.0/cli/php.ini
memory_limit จาก 512 เป็น 2048M (ใส่ M ด้วย)
  1. /etc/init.d/apache2 restart 
แล้วค่อย Run
  1. sudo -u www-data php occ db:add-missing-indices

https://help.nextcloud.com/t/some-indic ... ally/37852
Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running 'occ db:convert-filecache-bigint' those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read the documentation page about this.

filecache.mtime
filecache.storage_mtime
mounts.storage_id
mounts.root_id
mounts.mount_id
แก้
  1. sudo -u www-data php occ db:convert-filecache-bigint
ตอบ y แล้วenter
Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the documentation.
Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the documentation.
วิธีแก้
https://help.nextcloud.com/t/caldav-and ... ving/39435

เพิ่ม Redirect 301 ไว้ในไฟล์
  1. nano /etc/apache2/sites-available/000-default.conf

เพิ่มไว้ล่างสุด
Redirect 301 /.well-known/carddav https://nextcloud.sci.com/remote.php/dav
Redirect 301 /.well-known/caldav https://nextcloud.sci.com/remote.php/dav
  1. /etc/init.d/apache2 restart

https://stackoverflow.com/questions/644 ... g-to-redis

  1. nano /var/www/nextcloud/config/config.php
เพิ่ม เข้าไปในไฟล์ ก่อน 'redis' => array (
'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.distributed' => '\OC\Memcache\Redis',

The "X-Content-Type-Options" HTTP header is not set to "nosniff". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
  1. nano /etc/apache2/conf-enabled/ssl-params.conf
ใส่ # หน้า
#Header always set X-Content-Type-Options nosniff
ถ้าไม่หายในไฟล์ .htaccess ด้วย

Update Version 15.0.14 --> 16.0.11
ไม่มีปุ่ม ต้อง Update PHP 7.0 --> 7.1

Update php 7.0 to 7.1
  1. sudo apt install -y php7.1 php7.1-cli libapache2-mod-php7.1
  2. sudo apt install -y php-imagick php-gettext php-memcache php-apcu php-pear php-xml php-xmlrpc
  3. sudo apt install -y php-memcached php-mysql php-intl php-mbstring php-curl php-gd php-imagick
  4. sudo apt install -y php7.1-common php7.1-mysql php7.1-cgi
  5. sudo apt install -y php7.1-curl php7.1-zip php7.1-mbstring php7.1-xmlrpc php7.1-gd php7.1-xml php7.1-xsl
  6. sudo apt install -y php7.1-dev php7.1-bz2 php7.1-intl php7.1-json php7.1-opcache php7.1-readline
  7. sudo apt install -y php7.1-imap php7.1-pspell php7.1-recode php7.1-sqlite3 php7.1-tidy php7.1-bcmath php7.1-mcrypt

# Update the Apache's PHP version
  1. sudo a2dismod php7.0
  2. sudo a2enmod php7.1
  3. sudo systemctl restart apache2.service

# Update the CLI PHP version
  1. sudo update-alternatives --set php /usr/bin/php7.1

Restart apache

https://itectec.com/ubuntu/ubuntu-upgra ... ntu-16-04/
OC\ServerNotAvailableException: Connection to LDAP server could not be established
ติดตั้ง php7.1-ldap
  1. apt-get install php7.1-ldap
  1. sudo -u apache /usr/bin/php /var/www/html/nextcloud/occ upgrade

Restart apache
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.]

Missing index "twofactor_providers_uid" in table "oc_twofactor_providers".
Missing index "version" in table "oc_whats_new".
Missing index "cards_abid" in table "oc_cards".
Missing index "cards_prop_abid" in table "oc_cards_properties".
แก้
  1. sudo -u www-data php occ db:add-missing-indices

Update Version 16 --> 17 แก้คำเตือน
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.

Missing index "twofactor_providers_uid" in table "oc_twofactor_providers".
Missing index "version" in table "oc_whats_new".
Missing index "cards_abid" in table "oc_cards".
Missing index "cards_prop_abid" in table "oc_cards_properties".
  1. sudo -u www-data php occ db:add-missing-indices

Update Version 17 --> 18 ไม่มีปุ่ม
1. Update php 7.1 --> 7.3 Up ข้ามไป 7.4 ไม่ได้เพราะ Vesion nexcloud 17 ไม่รองรับ
ไม่มีปุ่ม ต้อง Update PHP 7.1 --> 7.3

Update php 7.1 to 7.3
  1. sudo apt install -y php7.3 php7.3-cli libapache2-mod-php7.3 php7.3-ldap
  2. sudo apt install -y php-imagick php-gettext php-memcache php-apcu php-pear php-xml php-xmlrpc
  3. sudo apt install -y php-memcached php-mysql php-intl php-mbstring php-curl php-gd php-imagick
  4. sudo apt install -y php7.3-common php7.3-mysql php7.3-cgi
  5. sudo apt install -y php7.3-curl php7.3-zip php7.3-mbstring php7.3-xmlrpc php7.3-gd php7.3-xml php7.3-xsl
  6. sudo apt install -y php7.3-dev php7.3-bz2 php7.3-intl php7.3-json php7.3-opcache php7.3-readline
  7. sudo apt install -y php7.3-imap php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-bcmath php7.3-mcrypt
# Update the Apache's PHP version
  1. sudo a2dismod php7.1
  2. sudo a2enmod php7.3
  3. sudo systemctl restart apache2.service
# Update the CLI PHP version
  1. sudo update-alternatives --set php /usr/bin/php7.3
Restart apache

2. Run
sudo -u www-data /usr/bin/php7.3 occ upgrade

Update version 18 --> 19 แก้คำเตือน
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.

Missing index "calendarobject_calid_index" in table "oc_calendarobjects_props".
Missing index "schedulobj_principuri_index" in table "oc_schedulingobjects".
  1. sudo -u www-data php occ db:add-missing-indices
Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running 'occ db:convert-filecache-bigint' those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read the documentation page about this.

filecache_extended.fileid
  1. sudo -u www-data php occ db:convert-filecache-bigint
ตอบ y แล้ว enter

Update version 19 --> 20 แก้คำเตือน
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.

Missing index "properties_path_index" in table "oc_properties".
  1. sudo -u www-data php occ db:add-missing-indices
The database is missing some optional columns. Due to the fact that adding columns on big tables could take some time they were not added automatically when they can be optional. By running "occ db:add-missing-columns" those missing columns could be added manually while the instance keeps running. Once the columns are added some features might improve responsiveness or usability.

Missing optional column "reference_id" in table "oc_comments".
  1. sudo -u www-data php occ db:add-missing-columns
This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them.

gmp
ติดตั้ง
  1. apt-get install php7.3-gmp
  2. /etc/init.d/apache2 restart

 

Update version 20.0.11 --> 21.0.3 แก้ Error

PHP configuration option output_buffering must be disabled
แก้
  1. nano /etc/php/7.3/apache2/php.ini
output_buffering = 4096
เป็น
output_buffering = off

https://www.a2hosting.com/kb/developer- ... -directive
ถ้าไม่หายใน .htaccess file
https://help.nextcloud.com/t/false-outp ... ing/102791
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.

Missing index "cards_abiduri" in table "oc_cards".
  1. sudo -u www-data php occ db:add-missing-indices
The database is missing some primary keys. Due to the fact that adding primary keys on big tables could take some time they were not added automatically. By running "occ db:add-missing-primary-keys" those missing primary keys could be added manually while the instance keeps running.

Missing primary key on table "oc_federated_reshares".
Missing primary key on table "oc_systemtag_object_mapping".
Missing primary key on table "oc_comments_read_markers".
Missing primary key on table "oc_collres_resources".
Missing primary key on table "oc_collres_accesscache".
Missing primary key on table "oc_filecache_extended".
  1. sudo -u www-data php occ db:add-missing-primary-keys
Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running 'occ db:convert-filecache-bigint' those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read the documentation page about this.

federated_reshares.share_id
share_external.id
share_external.parent
  1. sudo -u www-data php occ db:convert-filecache-bigint
แก้คำเตือน
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.

Missing index "fs_size" in table "oc_filecache".
  1.  
  2. sudo -u www-data php occ db:add-missing-indices
Module php-imagick in this instance has no SVG support. For better compatibility it is recommended to install it.
  1.  
  2. apt-get install php7.3-imagick imagemagick
  3. /etc/init.d/apache2 restart


https://help.nextcloud.com/t/how-to-ena ... k/108646/5
Your web server is not properly set up to resolve "/.well-known/webfinger". Further information can be found in the documentation.
Your web server is not properly set up to resolve "/.well-known/nodeinfo". Further information can be found in the documentation.
  1. nano /etc/apache2/sites-available/000-default.conf

เพิ่มไว้ล่าง
Redirect 301 /.well-known/webfinger https://nextcloud.sci.com/index.php/.well-known/webfinger
Redirect 301 /.well-known/nodeinfo https://nextcloud.sci.com/index.php/.well-known/nodeinfo
Your installation has no default phone region set. This is required to validate phone numbers in the profile settings without a country code. To allow numbers without a country code, please add "default_phone_region" with the respective ISO 3166-1 code ↗ of the region to your config file.

แก้
  1. nano /var/www/nextcloud/config/config.php


เพิ่ม ไว้ล่างสุดก่อนปิด );
'default_phone_region' => 'TH',
https://www.reddit.com/r/NextCloud/comm ... ud_server/
A background job is pending that checks for user imported SSL certificates. Please check back later.

1. ที่ menu Basic settings ส่วน Background jobs เลือกเป็น Cron
2. ติดตั้ง php-cgi
  1. apt-get install php-cgi

3. เพิ่ม Cron
  1. crontab -u www-data -e
เพิ่ม
*/5 * * * * php -f /var/www/nextcloud/cron.php
run คำสั่งตรวจความถูกต้อง
  1. crontab -u www-data -l
https://docs.nextcloud.com/server/21/ad ... ation.html

No comments:

Post a Comment