Benutzer-Werkzeuge

Webseiten-Werkzeuge


linux:anwendungen:nextcloud:installation

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
linux:anwendungen:nextcloud:installation [2023/12/04 15:38] – angelegt rootlinux:anwendungen:nextcloud:installation [2024/01/03 14:18] (aktuell) max
Zeile 1: Zeile 1:
 +====== Nextcloud ======
 +
 +
 +<code bash>
 +
 +# Deinstallation von benötigten Programmen für den Webserver
 +apt purge apache2 apache2-utils apache2-common
 +apt autoremove
 +
 +# Installation von benötigten Programmen für den Webserver
 +sudo apt install apache2 
 +
 +a2dissite /etc/apache2/sites-available/nextcloud_ssl.conf
 +a2enssite /etc/apache2/sites-available/nextcloud_ssl.conf
 +
 +
 +# Installation von benötigten Programmen für die PHP Kompatibilität
 +sudo apt install libapache2-mod-php8.2 libapache2-mod-php php-gd php-mysql php-curl php-mbstring php-intl php-gmp php-bcmath php-xml php-imagick php-zip php-apcu
 +
 +# Aktivieren der PHP-Module
 +sudo a2enmod php8.2 php
 +sudo a2enmod rewrite dir mime env headers
 +
 +# Installation von einem Datenbankserver MariaDB
 +sudo apt install mariadb-server
 +
 +</code>
 +
 +<WRAP center round important 60%>
 +Achtung die Konfiguration fehlt Konfiguration wird ergänzt.
 +</WRAP>
 +
 +<code bash>
 +wget https://download.nextcloud.com/server/releases/latest.zip
 +mkdir /var/www/
 +cp latest.zip /var/www
 +cd /var/www
 +
 +chown www-data:www-data -R /var/www/nextcloud
 +
 +</code>
 +
 +<WRAP center round tip 60%>
 +Nun sollte alles soweit konfiguriert sein. Bitte schau unter [[linux:services:apache|Apache/Apache2/httpd]] oder [[linux:services:nginx|Nginx]] für weitere Infos zur Konfiguration eines Webservers.
 +</WRAP>
 +
 +<code bash>
 +
 +sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:mode --on
 +
 +
 +docker exec -u www-data app-server php occ app:update --all
 +docker exec -u www-data app-server php occ db:add-missing-indices
 +docker exec -u www-data app-server php occ db:add-missing-columns
 +docker exec -u www-data app-server php occ db:add-missing-primary-keys
 +
 +
 +sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:repair
 +sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:repair
 +sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ db:add-missing-columns
 +sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:mode --off
 +sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ db:add-missing-columns
 +sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ db:add-missing-indices
 +sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:update:htaccess
 +
 +docker exec -u www-data app-server php occ security:bruteforce:reset 111.111.18.18
 +
 +sudo -u www-data php occ upgrade
 +
 +sudo systemctl restart apache2
 +systemctl resatrt php*
 +
 +sudo apt install certbot python3-certbot-apache
 +certbot --apache
 +
 +</code>
 +
 +====== Rechte der Nextcloud Struktur setzen ======
 +Dies sollte manuell funktionieren, ansonsten dient das nachfolgende Nextcloud Skript dazu:
 +
 +<code bash>
 +#!/bin/bash
 +nextcloudpath='/webserver/cloud'
 +webuser='www-data'
 +webgroup='www-data'
 +rootuser='root'
 +
 +printf "Creating possible missing Directories\n"
 +mkdir -p $nextcloudpath/data
 +mkdir -p $nextcloudpath/assets
 +mkdir -p $nextcloudpath/updater
 +
 +printf "chmod Files and Directories\n"
 +find ${nextcloudpath}/ -type f -print0 | xargs -0 chmod 0640
 +find ${nextcloudpath}/ -type d -print0 | xargs -0 chmod 0750
 +
 +printf "chown Directories\n"
 +chown -R ${rootuser}:${webgroup} ${nextcloudpath}
 +chown -R ${webuser}:${webgroup} ${nextcloudpath}/apps/
 +chown -R ${webuser}:${webgroup} ${nextcloudpath}/assets/
 +chown -R ${webuser}:${webgroup} ${nextcloudpath}/config/
 +chown -R ${webuser}:${webgroup} ${nextcloudpath}/data/
 +chown -R ${webuser}:${webgroup} ${nextcloudpath}/themes/
 +chown -R ${webuser}:${webgroup} ${nextcloudpath}/updater/
 +
 +chmod +x ${nextcloudpath}/occ
 +
 +printf "chmod/chown .htaccess\n"
 +if [ -f ${nextcloudpath}/.htaccess ]
 + then
 +  chmod 0644 ${nextcloudpath}/.htaccess
 +  chown ${rootuser}:${webgroup} ${nextcloudpath}/.htaccess
 +fi
 +if [ -f ${nextcloudpath}/data/.htaccess ]
 + then
 +  chmod 0644 ${nextcloudpath}/data/.htaccess
 +  chown ${rootuser}:${webgroup} ${nextcloudpath}/data/.htaccess
 +fi
 +</code>
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki