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] Set root password? [Y/n] Y New password: notfallbox Re-enter new password: notfallbox Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y Reload privilege tables now? (Press y|Y for Yes, any other key for No) : 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 | +------------+-----------+ | notfallbox | localhost | | pi | localhost | +------------+-----------+ 2 rows in set (0,002 sec)
- MariaDB [(none)]>
EXIT;
PHP
sudo apt -y install php php-fpm php-cgi php-mysql
sudo nano /etc/php/7.3/fpm/php.ini
- In der Zeile
;cgi.fix_pathinfo=1
das Semikolon entfernen - Speichern und schliessen
sudo systemctl start php7.3-fpm & sudo systemctl enable php7.3-fpm
sudo systemctl status php7.3-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/php7.3-fpm.sock", "broken-scriptfilename" => "enable" )) )
- Speichern und Schliessen
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 PC eine „Notfallbox“ zu machen.
Startseite | Notfallbox | Hardware | Installation PI | ⇓ Installation i386 ⇓ | Funktionen |
Betriebssystem | AccessPoint | ✘ Web-Server | Inhalte | Sicherheit |
nfb/software/installation/i386/web.1698312964.txt.gz · Zuletzt geändert: 2023/12/19 19:02 (Externe Bearbeitung)