Benutzer-Werkzeuge

Webseiten-Werkzeuge


raspi4

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
raspi4 [15.03.2022]
hochrath
raspi4 [27.12.2023] (aktuell)
hochrath [WLan deaktivieren]
Zeile 26: Zeile 26:
 passwd passwd
  
 +apt-get update
 +apt-get upgrade
 +</code>
 +
 +Das System wird auf die gwünschte Zeitzone und Sprache eingestellt:
 <code> <code>
 +raspi-config
 + Locales: de_DE.UTF-8 UTF-8
 +
 +reboot
 +</code>
 +
 +\\
 +\\
 +==== Webserver einrichten ====
 +
 +<code>
 +sudo apt install apache2 -y
 +sudo apt install php -y
 +
 +sudo su
 +cd /var/www/html
 +mv index.html indexorg.html
 +echo "hallo welt">index.html
 +
 +apt install mariadb-server php-mysql -y
 +service apache2 restart
 +
 +service apache2 status
 +service mysql status
 +
 +
 +</code>
 +
 +<code>
 +mysql_secure_installation
 +</code>
 +Immer mit Y bestätigen und root-Passwort setzen.\\
 +
 +<code>
 +apt install phpmyadmin -y
 +</code>
 +
 +<code>
 +phpenmod mysqli
 +service apache2 restart
 +
 +ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
 +</code>
 +
 +
 +<code>
 +mysql --user=root --password
 +
 + create user admin@localhost identified by 'your_password';
 +
 + grant all privileges on *.* to admin@localhost;
 +
 + FLUSH PRIVILEGES;
 +
 + exit;
 +</code>
 +
 +Das Passwort läst nich nach der Anmeldung über http://192.168.178.30/phpmyadmin links oben über das Zahnrad ändern.\\
 +
 +
 +\\
 +\\
 +==== RAMDisk ====
 +
 +Eien RAMDisk ist schnell eingerichtet.\\
 +Verzeichnis anlegen:\\
 +<code>
 +mkdir /var/www/html/ramdisk
 +</code>
 +
 +fstab erweitern:
 +<code>
 +nano /etc/fstab
 +</code>
 +
 +<code>
 +# ramdisk
 +tmpfs /var/www/html/ramdisk tmpfs nodev,nosuid,size=50M 0 0
 +</code>
 +
 +
 +\\
 +\\
 +==== zweite IP-Adresse ====
 +
 +Manchmal benötigt man eine zweite IP-Adresse unter der der Raspi erreichbar ist.\\
 +<code>
 +ip addr add 192.168.178.28/24 dev eth0
 +</code>
 +
 +\\
 +\\
 +==== Backup einrichten ====
 +raspibackup gemäß Anleitung einrichten:\\
 +https://bangertech.de/raspibackup-einfaches-backup-fuer-den-raspberry-pi/\\
 +\\
 +
 +<code>
 +mkdir /home/pi/raspibackup
 +
 +curl -L https://raspibackup.linux-tips-and-tricks.de/install | sudo bash
 +</code>
 +
 +Die Konfiguration durchgehen und das Backup ausführen lassen:
 +<code>
 +raspiBackup.sh
 +</code>
 +
 +\\
 +\\
 +==== CPU-Temperatur auslesen ====
 +\\
 +Bash-Befehl:\\
 +<code>
 +cat /sys/class/thermal/thermal_zone0/temp
 +</code>
 +
 +\\
 +Bash-Script:\\
 +<code>
 +nano /root/scripte/cpu_temp_auslesen.sh
 +</code>
 +
 +<code>
 +#!/bin/bash
 +
 +# cpu temperatur auslesen
 +vcgencmd measure_temp > /root/ramdisk/cputemp2.txt
 +#
 +cat /sys/class/thermal/thermal_zone0/temp > /root/ramdisk/cputemp.txt
 +
 +</code>
 +
 +<code>
 +chmod +x /root/scripte/cpu_temp_auslesen.sh
 +/root/scripte/cpu_temp_auslesen.sh
 +
 +
 +root@raspberrypi3:/home/pi# ls -l /root/ramdisk/
 +total 8
 +-rw-r--r-- 1 root root 12 Dec 27 20:37 cputemp2.txt
 +-rw-r--r-- 1 root root  6 Dec 27 20:37 cputemp.txt
 +
 +
 +root@raspberrypi3:/home/pi# cat /root/ramdisk/cputemp.txt
 +49388
 +
 +root@raspberrypi3:/home/pi# cat /root/ramdisk/cputemp2.txt
 +temp=49.4'C
 +</code>
 +
 +
 +\\
 +\\
 +==== WLan deaktivieren ====
 +
 +\\
 +<code>
 +sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
 +</code>
 +
 +<code>
 +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
 +update_config=1
 +
 +network={
 +        ssid="namedeineswlans"
 +        psk=geheimespasswort
 +}
 +
 +</code>
 +
 +<code>
 +ifconfig
 +</code>
 +
 +<code>
 +ifconfig wlan0 down
 +</code>
 +
  
 \\ \\
raspi4.1647333858.txt.gz · Zuletzt geändert: 15.03.2022 von hochrath