[] Nextcloud xx.x.x - Sicherheitswarnungen - Probleme lösen - Shared-Hosting-Angebot

Als “Leidensgenosse” bei 1blu konnte ich dennoch diese Warnungen alle beheben:

  1. PHP-Speichergrenze
    Anpassung in ‘.user.ini’ (im Ordner der Nextcloud-Installation)
    Dort hinzugefügt:


memory_limit=512M

  1. PHP-Memory-Cache
    Ergänzung in ‘config/config.php’
    Dort hinzugefügt (vor der schließenden Klammer der letzten Zeile):


‘memcache.local’ => ‘\OC\Memcache\APCu’,

  1. PHP-Version
    Neue Datei ‘php.conf’ (oberhalb der www-Basisordners)
    Inhalt:

php_version=74

Evtl. könnten die genannten PHP-Konfigurationdatei zu 1. und 3. auch oberhalb des www-Basisordners oder im www-Basisordner oder im Nextcloud-Installationsordner liegen, bei mir funktioniert es wie beschrieben.

2 Likes

Eine Lösung für https die auch mit dem Shared-Hosting-Angebot funtkioniert:

http s://faq.1blu.de/content/488/980/de/wie-leite-ich-den-aufruf-meiner-domain-von-http-auf-https-um.html

.htaccess

<IfModule mod_headers.c>
  <IfModule mod_setenvif.c>
<IfModule mod_fcgid.c>
   SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
   RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
</IfModule>
<IfModule mod_proxy_fcgi.c>
   SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
</IfModule>
  </IfModule>

  <IfModule mod_env.c>
# Add security and privacy related headers

# Avoid doubled headers by unsetting headers in "onsuccess" table,
# then add headers to "always" table: https://github.com/nextcloud/server/pull/19002
Header onsuccess unset Referrer-Policy
Header always set Referrer-Policy "no-referrer"

Header onsuccess unset X-Content-Type-Options
Header always set X-Content-Type-Options "nosniff"

Header onsuccess unset X-Download-Options
Header always set X-Download-Options "noopen"

Header onsuccess unset X-Frame-Options
Header always set X-Frame-Options "SAMEORIGIN"

Header onsuccess unset X-Permitted-Cross-Domain-Policies
Header always set X-Permitted-Cross-Domain-Policies "none"

Header onsuccess unset X-Robots-Tag
Header always set X-Robots-Tag "none"

Header onsuccess unset X-XSS-Protection
Header always set X-XSS-Protection "1; mode=block"

SetEnv modHeadersAvailable true
  </IfModule>

  # Add cache control for static resources
  <FilesMatch "\.(css|js|svg|gif)$">
Header set Cache-Control "max-age=15778463"
  </FilesMatch>

  # Let browsers cache WOFF files for a week
  <FilesMatch "\.woff2?$">
Header set Cache-Control "max-age=604800"
  </FilesMatch>
</IfModule>
<IfModule mod_php7.c>
  php_value mbstring.func_overload 0
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
SetEnv htaccessWorking true
  </IfModule>
</IfModule>
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_USER_AGENT} DavClnt
  RewriteRule ^$ /remote.php/webdav/ [L,R=302]
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/webfinger /public.php?service=webfinger [QSA,L]
  RewriteRule ^\.well-known/nodeinfo /public.php?service=nodeinfo [QSA,L]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/.*
  RewriteRule ^(?:\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>
<IfModule mod_mime.c>
  AddType image/svg+xml svg svgz
  AddEncoding gzip svgz
</IfModule>
<IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule>
AddDefaultCharset utf-8
Options -Indexes
<IfModule pagespeed_module>
  ModPagespeed Off
</IfModule>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

ErrorDocument 403 //
ErrorDocument 404 //

:cold_face: :green_apple: 1blu :cold_face: :green_apple: ist nicht für Anfänger zu empfehlen**, die 1blu - easyApps werden nicht wirklich gepflegt. Support gibt es keinen, bzw. die haben selbst keinen Plan. Man bekommt das, was man bezahlt.

Wer Probleme, ohne Support vom Shared-Hosting-Provider lösen möchte ist bei 1blu richtig.

Eine weitere Lösung:

http s ://goneuland.de/nextcloud-server-mit-docker-compose-und-traefik-installieren/#6_3_Nextcloud_komplett_auf_HTTPs_umstellen

Um dies zu lösen öffnen wir wieder die Konfigurationsdatei:

nano /opt/containers/nextcloud/app/config/config.php

Hier ändert ihr nun folgende Zeile:

vorher:

‘overwrite.cli.url’ => ‘http://nextcloud.euredomain.de’,

nachher:

‘overwrite.cli.url’ => ‘https://nextcloud.euredomain.de’,

Anschließend fügt ihr noch folgenden Zeilen hinzu:

‘overwriteprotocol’ => ‘https’,

‘overwritehost’ => ‘nextcloud.euredomain.de’,

Hallo Forum,

heue wird mir in GUI von Nextcloud 20.0.0 ein Update auf Nextcloud 20.0.1 angeboten.

Current version is 20.0.0.
Update to Nextcloud 20.0.1 available. (channel: “stable”)

Will das annehmen, erhalte ich folgende Meldungen:

Initializing

Current version is 20.0.0.
Update to Nextcloud 20.0.1 available. (channel: “stable”)
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-20.0.1.zip
Open changelog :arrow_upper_right:

Check for expected files
The following extra files have been found:

.ht0n5aka.appconfig.php
.htaccess.pre-20.0.0
.htoskrf0qatscx.data

Wie gehe ich damit um?

MfG
nc-kay

Die Dateien einfach löschen. Oder falls sie wichtig sein könnten, vorher irgendwo sichern.

Die Dateien finde ich nicht, wo könnten die liegen?

Ich bin mit ftp auf dem Webspace.
Die Sucherfunktion bringt keine Ergebnisse.
Oder ist der “.” auch einzugeben?

Gefunden habe die Dateien “.ht0n5aka.appconfig.php”, “.htaccess.pre-20.0.0” und den Ordner “.htoskrf0qatscx.data” jetzt manuell.

Wirklich löschen?

verschiebe das in einen Ordner außerhalb der NC-Installation

Lösche, verschiebe ich die Dateien gibt es bei Aufruf der www.Nextcloud folgende Meldung:

Fehler
Ihr Datenverzeichnis ist ungültig.

Stellen Sie sicher, dass eine Datei “.ocdata” im Wurzelverzeichnis des data-Verzeichnisses existiert.

dann musst du deinen Provider fragen, wie du mit Updates umgehst

Bei mir ist die Datei .ocdata leer. Lege doch eine leere Datei an. Was hast du zu verlieren?

Die Datei .ocdata habe ich jetzt neu angelegt in:

/www/admin/data/

Die Fehlermeldung ist immer noch da:

Fehler

Dein Datenverzeichnis ist ungültig

Stelle sicher, dass eine Datei ".ocdata" im Wurzelverzeichnis des data-Verzeichnisses existiert.

Was nun?

https://help.nextcloud.com/search?q=Stelle%20sicher%2C%20dass%20eine%20Datei%20%22.ocdata%22%20im%20Wurzelverzeichnis

Die Lösungen kann ich nicht umsetzen.

Wie nun weiter?

Das Verzeichnis ist in der config.php auch als ‘datadirectory’ eingetragen?

Ich glaube ich war völlig falsch.

/www/nextcloud/data/

Da richtig?

Fehler scheint trotzdem noch:

Fehler

  • Ihr Datenverzeichnis ist ungültig.Stellen Sie sicher, dass eine Datei “.ocdata” im Wurzelverzeichnis des data-Verzeichnisses existiert.

Es kommt darauf an, was in der config.php steht. Ich habe hier keine Glaskugel, um Dir sagen zu können, ob das Verzeichnis richtig ist.

1 Like

Auszug config.php

 'datadirectory' => '/hp/cz/aa/bp/www/nextcloud/.htoskrf0qatscx.data',

Entweder passt du dann in der config.php den Pfad auf […]nextcloud/data an oder du legst die .ocdata in das dort aktuell verwendete Verzeichnis.

In welchem Verzeichnis liegen denn deine Daten tatsächlich auf dem Server?

sftp://ftp123456789-123456789@webhosting81.1blu.de:22/hp/cz/aa/bp/www/nextcloud/data/

Auf ein Backup habe ich Zugriff.

Wie passe ich die Rechte der Datei “.ocdata” an?

Warum ist im Backup die Datei “.ocdata” nicht enhalten?
Das Backup wurde von 1blu automatisch erstellt.

Lösung, richtiger Pfad:

sftp://ftp123456789-123456789@webhosting81.1blu.de:22/hp/cz/aa/bp/www/nextcloud/.htoskrf0qatscx.data/

Im falschen Ordner hatte ich die “.ocdata” angelegt.

2 Likes

Hallo, beim Update auf 20.02 gibt es folgendes Problem:

Es gibt einige Warnungen zu Ihrer Systemkonfiguration.

In der Datenbank fehlen einige Primärschlüssel. Aufgrund der Tatsache, dass das Hinzufügen von Primärschlüsseln bei großen Tabellen einige Zeit dauern konnte, wurden sie nicht automatisch hinzugefügt. Durch Ausführen von "occ db:add-missing-primary-keys" können diese fehlenden Primärschlüssel manuell hinzugefügt werden, während die Instanz weiter läuft.
    Fehlender Primärschlüssel auf Tabelle "oc_federated_reshares".
    Fehlender Primärschlüssel auf Tabelle "oc_systemtag_object_mapping".
    Fehlender Primärschlüssel auf Tabelle "oc_comments_read_markers".
    Fehlender Primärschlüssel auf Tabelle "oc_collres_resources".
    Fehlender Primärschlüssel auf Tabelle "oc_collres_accesscache".
    Fehlender Primärschlüssel auf Tabelle "oc_filecache_extended".

Wie löse ich das Problem?

Dann schaue ich mal hier:

Ich weiß nicht wie ich damit beim Shared-Hosting Angebot umgehe.

Wo gebe ich das ein: Register new command db:add-missing-primary-keys

Danke für euere Hilfe vorab.

MfG
nc-kay

OCC Web

von Adphi AGPL-Lizenziert

OCCWEb aus dem Appstore ist keine Lösung.

Thu Nov 19 2020 12:13:50
Press Enter for more information on occ commands.
occ $ occ db:add-missing-primary-keys

Command “occ” is not defined.

Help occ web

cc $
Nextcloud 20.0.2
Usage:
command [options [arguments]
]Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
–ansi Force ANSI output
–no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
–no-warnings Skip global warnings, show command output only
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
check check dependencies of the server environment
help Displays help for a command
list Lists commands
status show some status information
upgrade run upgrade routines after installation of a new release. The release has to be installed before.
activity
activity:send-mails Sends the activity notification mails
app
app:check-code check code to be compliant
app:disable disable an app
app:enable enable an app
app:getpath Get an absolute path to the app directory
app:install install an app
app:list List all available apps
app:remove remove an app
app:update update an app or all apps
background
background:ajax Use ajax to run background jobs
background:cron Use cron to run background jobs
background:webcron Use webcron to run background jobs
broadcast
broadcast:test test the SSE broadcaster
config
config:app:delete Delete an app config value
config:app:get Get an app config value
config:app:set Set an app config value
config:import Import a list of configs
config:list List all configs
config:system:delete Delete a system config value
config:system:get Get a system config value
config:system:set Set a system config value
dav
dav:create-addressbook Create a dav addressbook
dav:create-calendar Create a dav calendar
dav:list-calendars List all calendars of a user
dav:move-calendar Move a calendar from an user to another
dav:remove-invalid-shares Remove invalid dav shares
dav:send-event-reminders Sends event reminders
dav:sync-birthday-calendar Synchronizes the birthday calendar
dav:sync-system-addressbook Synchronizes users to the system addressbook
db
db:add-missing-columns Add missing optional columns to the database tables
db:add-missing-indices Add missing indices to the database tables
db:add-missing-primary-keys Add missing primary keys to the database tables
db:convert-filecache-bigint Convert the ID columns of the filecache to BigInt
db:convert-mysql-charset Convert charset of MySQL/MariaDB to use utf8mb4
db:convert-type Convert the Nextcloud database to the newly configured one
documentserver
documentserver:flush Flush all pending changes made to documents
documentserver:fonts Manage custom fonts
encryption
encryption:change-key-storage-root Change key storage root
encryption:decrypt-all Disable server-side encryption and decrypt all files
encryption:disable Disable encryption
encryption:enable Enable encryption
encryption:encrypt-all Encrypt all files for all users
encryption:list-modules List all available encryption modules
encryption:migrate-key-storage-format Migrate the format of the keystorage to a newer format
encryption:set-default-module Set the encryption default module
encryption:show-key-storage-root Show current key storage root
encryption:status Lists the current status of encryption
federation
federation:sync-addressbooks Synchronizes addressbooks of all federated clouds
files
files:cleanup cleanup filecache
files:recommendations:recommend
files:scan rescan filesystem
files:scan-app-data rescan the AppData folder
files:transfer-ownership All files and folders are moved to another user - shares are moved as well.
group
group:add Add a group
group:adduser add a user to a group
group:delete Remove a group
group:list list configured groups
group:removeuser remove a user from a group
integrity
integrity:check-app Check integrity of an app using a signature.
integrity:check-core Check integrity of core code using a signature.
integrity:sign-app Signs an app using a private key.
integrity:sign-core Sign core using a private key.
l10n
l10n:createjs Create javascript translation files for a given app
log
log:file manipulate logging backend
log:manage manage logging configuration
log:tail Tail the nextcloud logfile
log:watch Watch the nextcloud logfile
mail
mail:account:create creates IMAP account
mail:account:diagnose Diagnose a user’s IMAP connection
mail:account:export Exports a user’s IMAP account(s)
mail:account:export-threads Exports a user’s account threads
mail:account:sync Synchronize an IMAP account
mail:account:train Train the classifier of new messages
mail:clean-up clean up all orphaned data
mail:thread Build threads from the exported data of an account
maintenance
maintenance:data-fingerprint update the systems data-fingerprint after a backup is restored
maintenance:mimetype:update-db Update database mimetypes and update filecache
maintenance:mimetype:update-js Update mimetypelist.js
maintenance:mode set maintenance mode
maintenance:repair repair this installation
maintenance:theme:update Apply custom theme changes
maintenance:update:htaccess Updates the .htaccess file
migrations
migrations:execute Execute a single migration version manually.
migrations:generate
migrations:generate-from-schema
migrations:migrate Execute a migration to a specified version or the latest available version.
migrations:status View the status of a set of migrations.
notification
notification:generate Generate a notification for the given user
notification:test-push Generate a notification for the given user
onlyoffice
onlyoffice:documentserver Manage document server
preview
preview:repair distributes the existing previews into subfolders
security
security:bruteforce:reset resets bruteforce attemps for given IP address
security:certificates list trusted certificates
security:certificates:import import trusted certificate
security:certificates:remove remove trusted certificate
sharing
sharing:cleanup-remote-storages Cleanup shared storage entries that have no matching entry in the shares_external table
sharing:expiration-notification Notify share initiators when a share will expire the next day.
talk
talk:active-calls Allows you to check if calls are currently in process
talk:command:add Add a new command
talk:command:add-samples Adds some sample commands: /wiki, …
talk:command:delete Remove an existing command
talk:command:list List all available commands
talk:command:update Add a new command
talk:room:add Adds users to a room
talk:room:create Create a new room
talk:room:delete Deletes a room
talk:room:demote Demotes participants of a room to regular users
talk:room:promote Promotes participants of a room to moderators
talk:room:remove Remove users from a room
talk:room:update Updates a room
talk:signaling:add Add an external signaling server.
talk:signaling:delete Remove an existing signaling server.
talk:signaling:list List external signaling servers.
talk:stun:add Add a new STUN server.
talk:stun:delete Remove an existing STUN server.
talk:stun:list List STUN servers.
talk:turn:add Add a TURN server.
talk:turn:delete Remove an existing TURN server.
talk:turn:list List TURN servers.
text
text:reset Reset a text document
theming
theming:config Set theming app config values
trashbin
trashbin:cleanup Remove deleted files
trashbin:expire Expires the users trashbin
trashbin:size Configure the target trashbin size
twofactorauth
twofactorauth:cleanup Clean up the two-factor user-provider association of an uninstalled/removed provider
twofactorauth:disable Disable two-factor authentication for a user
twofactorauth:enable Enable two-factor authentication for a user
twofactorauth:enforce Enabled/disable enforced two-factor authentication
twofactorauth:state Get the two-factor authentication (2FA) state of a user
update
update:check Check for server and app updates
user
user:add adds a user
user:delete deletes the specified user
user:disable disables the specified user
user:enable enables the specified user
user:info show user info
user:lastseen shows when the user was logged in last time
user:list list configured users
user:report shows how many users have access
user:resetpassword Resets the password of the named user
user:setting Read and modify user settings
versions
versions:cleanup Delete versions
versions:expire Expires the users file versions
workflows
workflows:list Lists configured workflows
occ $

Wie löse ich das Problem?