Benutzer-Werkzeuge

Webseiten-Werkzeuge


ncraspi

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
ncraspi [2019/07/21 11:49] noonencraspi [2022/03/24 23:56] (aktuell) noone
Zeile 2: Zeile 2:
  
 ===0. Vorbereitung=== ===0. Vorbereitung===
-aktuelles Raspian-Image auf SD-Karte schreiben [[https://downloads.raspberrypi.org/raspbian_lite_latest|Lite Image für Headless]] oder [[https://downloads.raspberrypi.org/raspbian_latest|volles Image mit Desktop]]\\+aktuelles RaspberryPiOS-Image auf SD-Karte schreiben [[https://downloads.raspberrypi.org/raspbian_lite_latest|Lite Image für Headless]] oder [[https://downloads.raspberrypi.org/raspbian_latest|volles Image mit Desktop]]\\
 ssh aktivieren\\ ssh aktivieren\\
 RasPi starten RasPi starten
Zeile 14: Zeile 14:
   * reboot   * reboot
   * update/upgrade   * update/upgrade
-  * rpi-update installieren und Firmware updaten+[[piwebmin|Webmin]] installieren und anpassen
  
-   sudo apt install rpi-update 
-   sudo rpi-update 
-   sudo reboot 
 Weitere Software installieren Weitere Software installieren
-   sudo apt install mc htop+   sudo apt install mc gpm htop
  
 [[staticip|Feste IP-Adresse zuweisen]] [[staticip|Feste IP-Adresse zuweisen]]
Zeile 30: Zeile 27:
 ===1. Webserver installieren=== ===1. Webserver installieren===
  
-   sudo apt install -y apache2 mariadb-server libapache2-mod-php7.3 install -y php7.3-gd php7.3-json php7.3-mysql php7.3-curl php7.3-intl php-mcrypt php-imagick php7.3-zip php7.3-xml php7.3-mbstring+   sudo apt install -y 
 +      apache2
 +      mariadb-server
 +      mariadb-client\ 
 +      php7.3
 +      php7.3-mysql\ 
 +      php7.3-curl\ 
 +      php7.3-gd\ 
 +      php7.3-zip\ 
 +      php7.3-fpm\ 
 +      php7.3-mbstring\ 
 +      php7.3-xml
 +      php7.3-intl\ 
 +      php-imagick 
 +      libapache2-mod-php 
 + 
 +MariaDB absichern 
 +   sudo mysql_secure_installation 
 + 
 +Datenbank für NextCloud anlegen 
 +   sudo mysql -u root -p 
 +    
 +   create database NextCloud; 
 +   create user 'nextcloud'@'localhost' identified by '<passwort>'; 
 +   grant all on NextCloud.* to 'nextcloud'@'localhost'; 
 +   flush privileges; 
 +   quit 
 NextCloud herunterladen NextCloud herunterladen
    cd ~/Download    cd ~/Download
-   wget https://download.nextcloud.com/server/releases/nextcloud-16.0.3.zip+   wget https://download.nextcloud.com/server/releases/latest.zip
 und entpacken und entpacken
-   unzip nextcloud-16.0.3.zip+   unzip latest.zip
 Verzeichnis nextcloud in den Webserver verschieben und Benutzer anpassen Verzeichnis nextcloud in den Webserver verschieben und Benutzer anpassen
    sudo mv nextcloud /var/www/html    sudo mv nextcloud /var/www/html
Zeile 43: Zeile 67:
    sudo nano /etc/apache2/sites-available/nextcloud.conf    sudo nano /etc/apache2/sites-available/nextcloud.conf
 mit dem Inhalt mit dem Inhalt
-   Alias /nextcloud "/var/www/html/nextcloud/" 
-   <Directory /var/www/html/nextcloud/> 
-      Options +FollowSymlinks 
-      AllowOverride All 
-      <IfModule mod_dav.c> 
-         Dav on 
-      </IfModule> 
-      SetEnv HOME /var/www/html/nextcloud 
-      SetEnv HTTP_HOME /var/html/www/nextcloud 
-   </Directory> 
    <VirtualHost *:80>    <VirtualHost *:80>
-      ServerName pegasus37,no-ip.info +      ServerName p37.ddnss.de 
-      ServerAdmin ukruege@gmx.de +      ServerAdmin pegasus37@gmx.net 
-      DocumentRoot /var/www/htmlnextcloud/+      DocumentRoot /var/www/html 
 +       
 +      ErrorLog ${APACHE_LOG_DIR}/hostname.tld_error.log 
 +      CustomLog ${APACHE_LOG_DIR}/hostname.tld_access.log combined 
 +       
 +      <Directory /var/www/html> 
 +         Options +FollowSymlinks 
 +         AllowOverride All 
 +          
 +         <IfModule mod_dav.c> 
 +            Dav off 
 +         </IfModule> 
 +          
 +         SetEnv HOME /var/www/html 
 +         SetEnv HTTP_HOME /var/www/html 
 +      </Directory>
    </VirtualHost>    </VirtualHost>
 +
 +Webserver neustarten
 +   sudo systemctl restart apache2
 +
 +===2. Zertifikat einrichten===
 +
 +Pakete installieren
 +   sudo apt install certbot python-certbot-apache
 +Zertifikat anfordern
 +**Achtung:** Der Raspberry pi muss aus dem Internet auf Port 80 und Port 443 erreichbar sein. Vor diesem Schritt müssen die Ports im Router eingerichtet werden.
 +   sudo certbot --apache
 +Automatische Zertifikas-Erneuerung anlegen
 +Mit
 +   sudo crontab -e
 +die Cron-Tabelle öffnen und neuen Job eintragen
 +   0 3 * * * /usr/bin/certbot renew --quiet
 +Nach dem Speichern wird das Zertifikat rechtzeitig vor Ablauf automatisch erneuert.
 +
 +Für die Hintergrundarbeiten der NextCloud ist noch ein weiterer Cronjob anzulegen, diesmal für den Benutzer www-data:
 +   sudo crontab -u www-data -e
 +   */5 * * * * php -f /var/www/html/nextcloud/cron.php
 +
 +===3. Nextcloud einrichten===
 +
 +Webseite aufrufen
 +   <ip des Raspberry Pi>/nextcloud
 +
 +===PHP-Optimierungen===
 +
 +OPCache aktivieren
 +   sudo nano /etc/php/7.3/apach2/php.ini
 +
 +Einträge aktivieren
 +   opcache.enable=1
 +   opcache.enable_cli=1
 +   opcache.interned_strings_buffer=8
 +   opcache.max_accelerated_files=10000
 +   opcache.memory_consumption=128
 +   opcache.save_comments=1
 +   opcache.revalidate_freq=1
 +
 +Filegrössen anpassen
 +   post_max_size = 2G
 +   upload_max_filesize = 2G
 +   max_file_uploads = 200
 +   memory_limit = 512M
 +
 +===PHP-Memory-Cache===
 +
 +Redis-Server inklusive passendes PHP-Modul installieren
 +   sudo apt install php-redis redis-server
  
ncraspi.1563702587.txt.gz · Zuletzt geändert: 2019/07/21 11:49 von noone

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki