Nextcloud Installation Teil 2 - Einstellungen Anpassungen

Zurück zu Nextcloud Installation Teil 1

Nach der Installation auf dem Heimserver können einige Fehler / Warnmeldungen in der Adminübersicht zusehen sein.

Einstellungen -> Übersicht

Es gibt einige Fehler in Ihrer Systemkonfiguration.

Speicher zuordnung für die PHP Module. Am Verfügbaren Speicher des Servers Orientieren.

root@nc:~# vi /etc/php/8.1/apache2/php.ini

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 2048M 
systemctl restart apache2

Pufferung von Ausgabedaten deaktivieren, die von einem PHP-Skript generiert werden, bevor sie an den Webbrowser gesendet werden.

root@nc:~# vi /etc/php/8.1/apache2/php.ini

; output_buffering = 4096
output_buffering = Off
systemctl restart apache2

vi /etc/apache2/sites-available/nextcloud.conf

<VirtualHost *:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/nextcloud

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory "/var/www/nextcloud">
        Require all granted
        AllowOverride All
        Options FollowSymLinks MultiViews
    </Directory>

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


s.h. SSL Certificate

vim /etc/apache2/sites-available/nextcloud.conf

<IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
a2enmod headers
systemctl restart apache2

Anpassung:

a2enmod rewrite
systemctl restart apache2

vim /var/www/nextcloud/config/config.php

'default_phone_region' => 'DE',

root@nc:~# apt install php-apcu

systemctl restart apache2

vi /var/www/nextcloud/config/config.php

....
letzte Zeile:
'memcache.local' => '\\OC\\Memcache\\APCu', 

OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

vi /etc/php/8.1/mods-available/apcu_bc.ini
vi /etc/php/8.1/mods-available/apcu.ini


apc.enable_cli=1

root@nc:~# systemctl restart apache2

apt install php-intl php-bcmath php-gmp php-imagick

systemctl restart apache2

php -r "phpinfo();" | grep format
Es fehlt das SVG Modul

apt install libmagickcore-6.q16-6-extra
systemctl restart apache2

Fehler auf der CLI beim Aufruf von occ Kommandos

vi /etc/php/8.1/mods-available/apcu.ini
extension=apcu.so
apc.enable_cli=1

vi /etc/php/8.1/apache2/php.ini
opcache.interned_strings_buffer=16

Zusatz Pakete Installieren / Einrichen

EMail Program RainLoop

Standard EMail von Nextcloud deaktivieren.

Default Passwort admin/12345
Admin Login und die Domain anpassen.

Kalender

Kalender mit dem Android Smartphon / Thunderbird verbinden.

http://192.168.178.110/remote.php/dav/calendars/Admin/personal/

SSL Certificate

openssl
Mit dem Kommando openssl wird das SSL-Zertifikat für den Heimgebrauch erstellt.

openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privateKey.key -out certificate.crt

Danach die Zertifikate an den Richtigen Ort kopiert:

   cp certificate.crt /etc/ssl/certs/
   cp privateKey.key /etc/ssl/private/
   openssl x509 -in certificate.crt -text
   a2enmod ssl
   systemctl restart apache2

Apache Webserver anpassen

vi /etc/apache2/sites-available/nextcloud.conf

<VirtualHost *:443>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/nextcloud

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory "/var/www/">
        Require all granted
        AllowOverride All
        Options FollowSymLinks MultiViews
    </Directory>

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/certificate.crt
    SSLCertificateKeyFile /etc/ssl/private/privateKey.key

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Aktiviert site-enable

a2ensite nextcloud.conf

Update Fehler

Nach einem Update wird php nicht richtig erkannt.

a2enmod php8.1 (PHP Version)
systemctl restart apache2
vi /etc/php/8.1/apache2/php.ini

; Maximum amount of memory a script may consume
; https://php.net/memory-limit
memory_limit = 1024M 

root@t-ubu-2004:/var/www/nextcloud/updater# a2enmod php8.1
Considering dependency mpm_prefork for php8.1:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php8.1:
Enabling module php8.1.
To activate the new configuration, you need to run:
  systemctl restart apache2
root@t-ubu-2004:/var/www/nextcloud/updater# systemctl restart apache2

https://askubuntu.com/questions/1406082/apache-php-modules-not-upgraded-in-22-04