🛠 Héberger un serveur web léger

Raspberry Pi Model B Revision 2 (2012) — Board Sheet · avance · Schéma : IMG-model-b-rev2-avance-3-modelb2-serveur-web-leger.svg — Model B Rev 2 servant des pages via lighttpd sur le port 80, navigateur distant affichant index.html, flux Ethernet limité par le bus USB partagé

Objectives

Install a minimal web server (lighttpd) on the 512 MB of the Model B Rev 2, serve a static page on port 80 via 10/100 Ethernet, and set realistic expectations due to the single USB bus shared with the LAN9512.

Hardware

Complete code

sudo apt update && sudo apt install -y lighttpd
sudo lighty-enable-mod fastcgi 2>/dev/null || true
sudo service lighttpd force-reload
# Page de test
sudo mkdir -p /var/www/html
echo "<h1>Bonjour depuis le Model B Rev 2</h1>" | sudo tee /var/www/html/index.html
# Ecoute et debit attendu (10/100 partage le bus USB 480 Mbps avec les ports USB)
sudo netstat -tlnp | grep :80
curl -s http://localhost/ | head -2
# Depuis un poste du reseau:
curl -s http://192.168.1.50/

Expected verification

curl http://localhost/ returns the page title; from another machine on the network, the same page displays in a browser; netstat shows lighttpd listening on port 80. The actual throughput caps well below 100 Mbps when a USB device is active, which is normal for this architecture.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials