Stap 1: Nginx
nginx
Installeren nginx
sudo apt-get install nginx
Maak de map
sudo mkdir /var/www
Bewerk het configuratiebestand als volgt
sudo nano /etc/nginx/sites-available/default
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. ## server { #listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 listen 80; server_name $domain_name; root /var/www; index index.html index.htm; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; # Make site accessible from http://localhost/ server_name localhost; location /
Een bestand maken
sudo nano /var/www/index.html
met deze inhoud
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Raspberry Web Server</title> </head> <body> <p><h1 align="center">Welcome,<br />... your Raspberry Web Server is ready!! </h1> <p align="center"><img alt="" src="http://www.emmeshop.eu/blog/sites/files/image/u1/raspberry-pi.png" style="height:300px; width:250px"></p> </p> <p align="center"><img src="http://www.emmeshop.eu/blog/themes/bartik/Logo-Emmeshop.png" alt="Home"></p> <p align="center">Emmeshop Electronics --- www.emmeshop.eu </p> <p align="center"> </p> </body> </html>
Start opnieuw op nginx
sudo service nginx restart
Open uw browser met Raspberry Pi adres, in dit geval http://192.168.0.166, kunt u de introductiepagina van de nginx.