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
sesipod:linux:debian-9:nextcloud15 [2019/03/14 15:15]
sesipod
sesipod:linux:debian-9:nextcloud15 [2019/06/25 06:34] (current)
sesipod [Download Nextcloud 15.0.5]
Line 1: Line 1:
 +====== Setting up Nextcloud 15! ======
 +
 +My setup is going to be base on a server with more than 4 GB of ram! If you are using a server with less than 4GB of ram you will need to make some tweaks as you go. 
 +
 +  OS: Debian 9.5
 +  CPU: 6x @ 2.5GHZ
 +  RAM: 16GB
 +  SSD: 150GB
 +
 +----
 ==== Installing required items (Apache3, Php7.2, MySQL) ==== ==== Installing required items (Apache3, Php7.2, MySQL) ====
  
Line 4: Line 14:
   wget -q https://​packages.sury.org/​php/​apt.gpg -O- | apt-key add -   wget -q https://​packages.sury.org/​php/​apt.gpg -O- | apt-key add -
   echo "deb https://​packages.sury.org/​php/​ stretch main" | tee /​etc/​apt/​sources.list.d/​php.list   echo "deb https://​packages.sury.org/​php/​ stretch main" | tee /​etc/​apt/​sources.list.d/​php.list
 +  apt-get update
  
   apt-get -y install apache2 unzip mariadb-server libapache2-mod-php7.2   apt-get -y install apache2 unzip mariadb-server libapache2-mod-php7.2
Line 11: Line 22:
   apt-get install -y php7.2 php7.2-common php7.2-dom php7.2-gd php7.2-json php7.2-xml php7.2-zip php7.2-mbstring php7.2-mysql php7.2-smbclient php7.2-imagick php7.2-gmp php7.2-imap php7.2-intl php7.2-bz2 php7.2-curl php7.2-mysql php7.2-fpm php7.2-cgi php7.2-cli   apt-get install -y php7.2 php7.2-common php7.2-dom php7.2-gd php7.2-json php7.2-xml php7.2-zip php7.2-mbstring php7.2-mysql php7.2-smbclient php7.2-imagick php7.2-gmp php7.2-imap php7.2-intl php7.2-bz2 php7.2-curl php7.2-mysql php7.2-fpm php7.2-cgi php7.2-cli
  
-php 7.2 7.3-common -- replaces the follwing ​ +<color #ff7f27>php 7.2 7.3-common -- replaces the following</​color>​ 
-  PHP module ctype +  ​PHP module ctype 
-  PHP module iconv +  ​PHP module iconv 
-  PHP module posix +  ​PHP module posix 
-  PHP module iconv +  ​PHP module iconv 
-  PHP module ftp +  ​PHP module ftp 
-  PHP module fileinfo +  ​PHP module fileinfo 
-  PHP module ctype +  ​PHP module ctype 
-  PHP module exif+  ​PHP module exif
  
-php 7.2 7.3-xml -- replaces the following +<color #ff7f27>php 7.2 7.3-xml -- replaces the following</​color>​ 
-  PHP module SimpleXML +  ​PHP module SimpleXML 
-  PHP module XMLReader +  ​PHP module XMLReader 
-  PHP module XMLWriter +  ​PHP module XMLWriter
- +
-==== Enable Needed Apache2 Modules ====+
  
 ---- ----
 +==== Enable Needed Apache2 Modules ====
  
   a2enmod rewrite   a2enmod rewrite
Line 80: Line 90:
 ---- ----
  
- +==== Download Nextcloud ​16.0.====
- +
- +
-==== Download Nextcloud ​15.0.====+
  
   cd /var/www   cd /var/www
  
-  ​mkdir nextcloud+  ​wget https://​download.nextcloud.com/​server/​releases/​nextcloud-16.0.1.zip && unzip nextcloud-16.0.1.zip
  
-  ​wget https://​download.nextcloud.com/​server/​releases/​nextcloud-15.0.5.zip && unzip nextcloud-15.0.5.zip +  rm nextcloud-16.0.1.zip
- +
-  ​rm nextcloud-15.0.5.zip+
  
 ---- ----
Line 97: Line 102:
 ==== Set proper Apache2 Permissions ==== ==== Set proper Apache2 Permissions ====
  
-  chown -R www-data:​www-data /var/www/cloud.sesipod.info +  chown -R www-data:​www-data /var/www/nextcloud
 ---- ----
  
 ==== Setup MySQL server ==== ==== Setup MySQL server ====
  
-  mysql -e "​CREATE DATABASE ​nc_2018;"+  mysql -e "​CREATE DATABASE ​nc_2019;"
  
-  mysql -e "GRANT ALL PRIVILEGES ON nc_2018.* TO '​ncuser'​@'​localhost'​ IDENTIFIED BY '​ncpass';"​+  mysql -e "GRANT ALL PRIVILEGES ON nc_2019.* TO '​ncuser'​@'​localhost'​ IDENTIFIED BY '​ncpass';"​
  
   mysql -e "FLUSH PRIVILEGES;"​   mysql -e "FLUSH PRIVILEGES;"​
Line 127: Line 131:
  
 ---- ----
-==== Setup Redis Cache ====+==== Setup PHP APCu and Redis Cache ====
  
-  apt-get install redis-server php-redis ​-y +  apt-get install redis-server php-redis php-apcu -y
- +
-  systemctl start redis-server +
- +
-  systemctl enable redis-server +
- +
-  ​php --ri redis +
-   See if redis is enabled. +
- +
-  systemctl restart apache2+
  
   nano /​var/​www/​nextcloud/​config/​config.php   nano /​var/​www/​nextcloud/​config/​config.php
Line 144: Line 139:
 Add the below before the last ** ); ** Add the below before the last ** ); **
  
-  ​'​memcache.distributed'​ => '​\OC\Memcache\Redis',​ +  '​memcache.local'​ => '​\OC\Memcache\APCu', 
-  ​'​memcache.local'​ => '​\OC\Memcache\Redis', +  '​memcache.locking'​ => '\\OC\\Memcache\\Redis',​
-  '​memcache.locking'​ => '​\OC\Memcache\Redis',​+
   '​redis'​ => array(   '​redis'​ => array(
-       '​host'​ => '​localhost',​ +  ​'​host'​ => '​localhost',​ 
-       ​'​port'​ => 6379, +  '​port'​ => 6379, 
-       ​),+  ), 
 + 
 +systemctl restart apache2
  
 {{:​sesipod:​linux:​debian-9:​2121.jpg?​nolink&​400|}} {{:​sesipod:​linux:​debian-9:​2121.jpg?​nolink&​400|}}
Line 156: Line 152:
 ---- ----
  
-==== Change PHP Memory Limit ====+==== Change PHP Memory ​/ upload ​Limit ====
  
-  nano /etc/php/7.0/​apache2/​php.ini+  nano /etc/php/7.2/​apache2/​php.ini
  
 ctrl+w and find **memory_limit** ctrl+w and find **memory_limit**
Line 164: Line 160:
 Change memory_limit=512M to at least %25 of your total ram. Change memory_limit=512M to at least %25 of your total ram.
  
-   ​memory_limit=2048M+   ​memory_limit=4096M 
 + 
 +Now lets change the upload limit. 
 + 
 +ctrl+w and find **upload_max_filesize** 
 + 
 +  upload_max_filesize = 99999M 
 + 
 +ctrl+w and find **post_max_size** 
 + 
 +  post_max_size = 99999M
  
   systemctl restart apache2   systemctl restart apache2
Line 180: Line 186:
   opcache.enable=1   opcache.enable=1
   opcache.enable_cli=1   opcache.enable_cli=1
-  opcache.interned_strings_buffer=8+  opcache.interned_strings_buffer=1024     Ram limit
   opcache.max_accelerated_files=10000   opcache.max_accelerated_files=10000
-  opcache.memory_consumption=1024+  opcache.memory_consumption=4096          Ram limit
   opcache.save_comments=1   opcache.save_comments=1
   opcache.revalidate_freq=1   opcache.revalidate_freq=1
Line 212: Line 218:
   systemctl restart apache2   systemctl restart apache2
  
-==== updating nextcloud ====+----
  
-occ command for updating NextCloud +==== Finished ====
-  sudo -u www-data php occ upgrade+
  
-----+At this point you should have All Checks Passes. Settings ​-> Overview ​
  
 +{{:​sesipod:​linux:​debian-9:​checkpass.jpg?​nolink&​600|}}
  
 +----
  
-<color #​ed1c24>​----------</​color>​+====== Extras ======
  
-====== Fixes ======+**NFS Support? How to get it working?**
  
-<color #​ed1c24>​----------</​color>​+Install the following:
  
-**Force HTTPS Logins**+  apt-get install nfs-common
  
-<color #​ffaec9>​This might also fix (Access forbidden: invalid request.)</​color>​+You should now mount NFS share directly to the VM.
  
-Add the following ​to the config file.+Create a mount point for each NFS share that you want to mount to your server.
  
-  ​nano /var/www/​nextcloud/​config/​config.php+  ​mkdir /mnt/somefolder
  
-  ​'​overwriteprotocol'​ => '​https',​+  ​nano /etc/fstab
  
-Reboot your server+  192.168.1.4:/​mnt/​RAID-Z2/​Stuff /​mnt/​somefolder nfs rw,​async,​hard,​intr,​sec=sys 0 0
  
 ---- ----
Line 259: Line 266:
 ---- ----
  
 +==== updating nextcloud ====
 +
 +occ command for updating NextCloud
 +  sudo -u www-data php occ upgrade
 +
 +----
 +
 +====== Fixes ======
 +
 +**Force HTTPS Logins**
 +
 +<color #​ffaec9>​This might also fix (Access forbidden: invalid request.)</​color>​
 +
 +Add the following to the config file.
 +
 +  nano /​var/​www/​nextcloud/​config/​config.php
 +
 +  '​overwriteprotocol'​ => '​https',​
 +
 +Reboot your server
 +
 +----
 +
 +** Missing Database sections (filecache.mtime & filecache.storage_mtime) **
 +
 +  cd /​var/​www/​nextcloud
 +
 +  sudo -u www-data php occ db:​convert-filecache-bigint
 +
 +----
  
 ** Keepweb fix ** ** Keepweb fix **
Line 289: Line 326:
  
   sudo -u www-data php /​var/​www/​nextcloud/​occ user:​resetpassword admin   sudo -u www-data php /​var/​www/​nextcloud/​occ user:​resetpassword admin
 +
 +----