|
Nextcloud 17 on Pogoplug E02 October 20, 2020 06:20PM |
Registered: 5 years ago Posts: 27 |
rm /etc/ssh/ssh_host* ssh-keygen -A passwd apt-get update && apt-get upgrade
update-initramfs: Generating /boot/initrd.img-5.2.9-kirkwood-tld-1Then regenerate the uInitrd boot file as per bodhi's instructions:
cd /boot mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-5.2.9-kirkwood-tld-1 -d initrd.img-5.2.9-kirkwood-tld-1 uInitrd
apt-get install curl ca-certificates locales unzip
dpkg-reconfigure tzdata dpkg-reconfigure localeslocales should have at the minimum en_US.UTF-8 selected. This might vary depending on language preference/system config.
nano /etc/init.d/zrampaste the following into new blank file
# Author: Antonio Galea <antonio.galea@gmail.com> # # Thanks to Przemysław Tomczyk for suggesting swapoff parallelization # Distributed under the GPL version 3 or later, see terms at # https://gnu.org/licenses/gpl-3.0.txt ### BEGIN INIT INFO # Provides: zram # Required-Start: $local_fs # Required-Stop: $local_fs # Default-Start: S # Default-Stop: 0 1 6 # Short-Description: Use compressed RAM as in-memory swap # Description: Use compressed RAM as in-memory swap ### END INIT INFO FRACTION=75 MEMORY=$(perl -ne '/^MemTotal:\s+(\d+)/ && print $1*1024' < /proc/meminfo) CPUS=$(nproc) SIZE=$((MEMORY * FRACTION / 100 / CPUS)) case "$1" in start) param=$(modinfo zram | grep num_devices | cut -f2 -d: | tr -d ' ') modprobe zram $param=$CPUS for n in $(seq $CPUS) do i=$((n - 1)) echo $SIZE > /sys/block/zram$i/disksize mkswap /dev/zram$i swapon /dev/zram$i --priority 10 done ;; stop) for n in $(seq $CPUS) do i=$((n - 1)) swapoff /dev/zram$i && echo "zram: disabled disk $n of $CPUS" & done wait sleep .5 modprobe --remove zram ;; *) echo "Usage: $(basename $0) (start | stop)" exit 1 ;; esac # End of file
chmod +x /etc/init.d/zram
insserv: FATAL: service rpcbind is missed in the runlevels 2 3 4 5 to use service nfs-commonin the next step so it is necessary to perform the following actions to fix it:
apt-get remove --purge rpcbind nfs-common apt-get install rpcbind nfs-common insserv zram
shutdown -r now
apt-get install nginx
rm /etc/nginx/sites-enabled/default
nano /etc/nginx/nginx.conf
fastcgi_connect_timeout 60; fastcgi_send_timeout 1800; fastcgi_read_timeout 1800;
...
events {
worker_connections 768;
# multi_accept on;
}
http {
fastcgi_connect_timeout 60;
fastcgi_send_timeout 1800;
fastcgi_read_timeout 1800;
##
# Basic Settings
##
...
apt-get install php7.3 php7.3-fpm php7.3-mysql php-common php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline php7.3-mbstring php7.3-xml php7.3-gd php7.3-curland
apt-get install php-imagick php7.3-common php7.3-mysql php7.3-fpm php7.3-gd php7.3-json php7.3-curl php7.3-zip php7.3-xml php7.3-mbstring php7.3-bz2 php7.3-intl php7.3-bcmath php7.3-sqlite3
wget https://download.nextcloud.com/server/releases/nextcloud-17.0.10.zipOther versions can be obtained at nextcloud.com/changelog
unzip nextcloud-17.0.10.zip -d /usr/share/nginx/
chown -R www-data:www-data /usr/share/nginx/nextcloud/
nano /etc/nginx/conf.d/nextcloud.conf
server {
listen 80;
listen [::]:80;
server_name _;
# Add headers to serve security related headers
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Referrer-Policy no-referrer;
#I found this header is needed on Ubuntu, but not on Arch Linux.
add_header X-Frame-Options "SAMEORIGIN";
# Path to the root of your installation
root /usr/share/nginx/nextcloud/;
access_log /var/log/nginx/nextcloud.access;
error_log /var/log/nginx/nextcloud.error;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# The following 2 rules are only needed for the user_webfinger app.
# Uncomment it if you're planning to use this app.
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
# last;
location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
location ~ /.well-known/acme-challenge {
allow all;
}
# set max upload size
client_max_body_size 512M;
fastcgi_buffers 64 4K;
# Disable gzip to avoid the removal of the ETag header
gzip off;
# Uncomment if your server is build with the ngx_pagespeed module
# This module is currently not supported.
#pagespeed off;
error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;
location / {
rewrite ^ /index.php;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
deny all;
}
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
try_files $fastcgi_script_name =404;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
#Avoid sending the security headers twice
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
}
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
try_files $uri/ =404;
index index.php;
}
# Adding the cache control header for js and css files
# Make sure it is BELOW the PHP block
location ~* \.(?:css|js)$ {
try_files $uri /index.php$uri$is_args$args;
add_header Cache-Control "public, max-age=7200";
# Add headers to serve security related headers (It is intended to
# have those duplicated to the ones above)
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Referrer-Policy no-referrer;
# Optional: Don't log access to assets
access_log off;
}
location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
try_files $uri /index.php$uri$is_args$args;
# Optional: Don't log access to other assets
access_log off;
}
}
nginx -twhich should respond with:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
service nginx reload
chown -R www-data:www-data /LOCATION/YOU/CHOSE
nano /usr/share/nginx/nextcloud/config/config.phpadd the following to near the bottom of config file:
'enable_previews' => false,
<?php
$CONFIG = array (
'instanceid' => 'ocp#######',
'passwordsalt' => 'c0##########################',
'secret' => 'Jx5############################################',
'trusted_domains' =>
array (
0 => 'Pogo.Plug.IP',
),
'datadirectory' => 'NextCloud/Data/Directory',
'dbtype' => 'sqlite3',
'version' => '17.0.10.1',
'overwrite.cli.url' => 'http://Pogo.Plug.IP';,
'installed' => true,
'enable_previews' => false,
);
service nginx reload
|
Re: Nextcloud 17 on Pogoplug E02 October 20, 2020 11:18PM |
Admin Registered: 13 years ago Posts: 18,564 |
Quote
Home Cloud
OwnCloud optimization
Owncloud 10 on Debian Buster - Pogo V3 OXNAS
Nextcloud 17 on Pogoplug E02
|
Re: Nextcloud 17 on Pogoplug E02 February 15, 2021 08:48PM |
Registered: 13 years ago Posts: 30 |
|
Re: Nextcloud 17 on Pogoplug E02 February 19, 2021 01:33PM |
Registered: 5 years ago Posts: 27 |
|
Re: Nextcloud 17 on Pogoplug E02 February 24, 2021 01:29AM |
Registered: 13 years ago Posts: 30 |
|
Re: Nextcloud 17 on Pogoplug E02 February 25, 2021 12:50AM |
Registered: 13 years ago Posts: 30 |
|
Re: Nextcloud 17 on Pogoplug E02 March 06, 2021 12:12AM |
Registered: 5 years ago Posts: 27 |
|
Re: Nextcloud 17 on Pogoplug E02 March 06, 2021 01:11AM |
Admin Registered: 13 years ago Posts: 18,564 |
|
Re: Nextcloud 17 on Pogoplug E02 March 06, 2021 01:33PM |
Registered: 5 years ago Posts: 27 |
|
Re: Nextcloud 17 on Pogoplug E02 March 06, 2021 06:55PM |
Admin Registered: 13 years ago Posts: 18,564 |