Mit Apache verwandelst du deinen Raspberry Pi in einen Webserver. In dieser Anleitung baust du dir eine eigene Startseite – quasi dein digitales Firmenschild im Netzwerk 🌐.
sudo apt update
sudo apt install apache2 -y
sudo systemctl enable apache2
sudo systemctl start apache2
sudo mv /var/www/html/index.html /var/www/html/index.html.backup
sudo nano /var/www/html/index.html
Füge folgenden Inhalt ein:
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>lumex-Systemtechnik Solutions</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
background: #0f172a;
color: white;
padding: 40px;
}
h1 {
color: #38bdf8;
}
.container {
background: #1e293b;
padding: 30px;
border-radius: 10px;
display: inline-block;
}
ul {
text-align: left;
}
.clock {
margin-top: 20px;
font-size: 1.5em;
color: #10b981;
}
</style>
</head>
<body>
<div class="container">
<h1>lumex-TechServer Solutions</h1>
<h2>Willkommen auf unserem Server</h2>
<h3>Verfügbare Dienste:</h3>
<ul>
<li>Webserver (Apache)</li>
<li>Dateiserver (Samba)</li>
<li>Fernwartung (SSH / RDP)</li>
<li>Systemverwaltung (Webmin)</li>
</ul>
<div class="clock" id="clock"></div>
</div>
<script>
function updateClock() {
const now = new Date();
document.getElementById("clock").innerHTML =
"Aktueller Zeitpunkt: " + now.toLocaleString();
}
setInterval(updateClock, 1000);
updateClock();
</script>
</body>
</html>
sudo chown www-data:www-data /var/www/html/index.html
sudo chmod 644 /var/www/html/index.html
sudo systemctl restart apache2
sudo ufw allow 'Apache Full'
Im Browser aufrufen:
http://SERVER-IP
Dein Raspberry Pi ist jetzt ein vollwertiger Webserver mit eigener Startseite. Statt leerer Standardseite begrüßt dich nun eine kleine digitale Empfangshalle – mit Uhr, Infos und Stil.