nfb:software:installation:i386:web
Dies ist eine alte Version des Dokuments!
Startseite | Notfallbox | Hardware | Installation PI | ⇓ Installation i386 ⇓ | Funktionen |
Betriebssystem | AccessPoint | ✘ Web-Server | Inhalte | Sicherheit |
Installation des Web-Servers
Als Web-Server kommt hier eine LLMP-Konfiguration aus lihttpd als leichtgewichtigem Server, MariaDB als universeller Datenbank-Server und PHP zum Einsatz. Zudem installieren wir noch phpMyAdmin, um die Datenbanken besser verwalten zu können.
lighttpd & PHP
sudo apt -y install lighttpd
- Wenn man mit dem WiFi der Notfallbox verbunden ist, ruft man nun im Browser folgendes ab:
- Ist man mit der Notfallbox noch über das LAN verbunden, bitte an dieser Stelle die IP-Adresse nutzen, welche auch für SSH verwendet wird.
- Es sollte die „Placeholder Page“ von lighttpd zu sehen sein:
sudo systemctl start lighttpd && sudo systemctl enable lighttpd
sudo systemctl status lighttpd
→ Active: active(running)
MariaDB
sudo apt -y install mariadb-server mariadb-client
sudo systemctl start mariadb && sudo systemctl enable mariadb
sudo systemctl status mariadb
→ Active: active(running)sudo mysql_secure_installation
Enter current password for root: [ENTER] Switch to unix_socket authentication [Y/n] Y Change the root password? [Y/n] Y New password: notfallbox Re-enter new password: notfallbox Remove anonymous users? (Y/n) : Y Disallow root login remotely? (Y/n) : Y Remove test database and access to it? (Y/n) : Y Reload privilege tables now? (Y/n) : Y
sudo mariadb -u root -p
→ Passwort eingeben- MariaDB [(none)]>
CREATE USER 'notfallbox'@'localhost' IDENTIFIED BY 'notfallbox';
- MariaDB [(none)]>
GRANT ALL PRIVILEGES ON notfallbox . * TO 'notfallbox'@'localhost';
- MariaDB [(none)]>
FLUSH PRIVILEGES;
- MariaDB [(none)]>
SELECT User,Host FROM mysql.user;
- Ausgabe:
+-------------+-----------+ | User | Host | +-------------+-----------+ | mariadb.sys | localhost | | mysql | localhost | | notfallbox | localhost | | root | localhost | +-------------+-----------+ 4 rows in set (0,004 sec)
- MariaDB [(none)]>
EXIT;
PHP
sudo apt -y install php php-fpm php-cgi php-mysql
sudo systemctl start php8.2-fpm & sudo systemctl enable php8.2-fpm
sudo systemctl status php8.2-fpm
→ Active: active (running)sudo cp /etc/lighttpd/conf-available/15-fastcgi-php.conf /etc/lighttpd/conf-available/15-fastcgi-php.conf.orig
sudo nano /etc/lighttpd/conf-available/15-fastcgi-php.conf
- Den kompletten Abschnitt
fastcgi.server
wie folgt anpassen:
fastcgi.server += ( ".php" => (( "socket" => "/var/run/php/php8.2-fpm.sock", "broken-scriptfilename" => "enable" )) )
- Speichern und Schließen
sudo lighttpd-enable-mod fastcgi && sudo lighttpd-enable-mod fastcgi-php
sudo systemctl restart lighttpd
sudo nano /var/www/html/phpinfo.php
→ INHALT:
<?php phpinfo(); ?>
- Speichern und Schließen
- Im Webbrowser abrufen: http://10.0.0.1/phpinfo.php
phpMyAdmin
sudo apt -y install phpmyadmin
- „Konfiguriere phpmyadmin / Webserver“:
lighttpd - OK
- „Konfigurieren der Datenbank für phpmyadmin mit dbconfig-common?“:
JA
- Passwort:
notfallbox - OK
- In fast allen Fällen der Installation auf dem Raspberry PI beendete sich die Installation mit einem Fehler. Das macht aber nichts. In diesem Fall die Installation mittels
sudo apt -y install phpmyadmin
noch einmal starten. sudo mariadb -u root -p
- „Passwort“:
notfallbox
grant all privileges on *.* to 'phpmyadmin'@'localhost';
flush privileges;
exit;
- In einem Browser
http:\\10.0.0.1\phpmyadmin
aufrufen, wenn man über den Hotspot verbunden ist. Ansonsten bitte die lokale IP-Adresse verwenden.
- „Benutzername“:
phpmyadmin
- „Passwort“:
notfallbox
- Bitte im Reiter „Datenbank“ prüfen, ob phpmyadmin berechtigt ist, neue Datenbanken anzulegen.
- Zum Verlassen des Admin bitte das Tür-Symbol oben links anklicken
Nachdem nun alles funktioniert, fehlen nur noch die Inhalte für den Webbrowser, um aus diesem Raspberry PI Zero eine „Notfallbox“ zu machen.
Startseite | Notfallbox | Hardware | Installation PI | ⇓ Installation i386 ⇓ | Funktionen |
Betriebssystem | AccessPoint | ✘ Web-Server | Inhalte | Sicherheit |
nfb/software/installation/i386/web.1698603200.txt.gz · Zuletzt geändert: 2023/12/19 19:02 (Externe Bearbeitung)