Reference and guides to build kick ass raspberry pi projects.
View the Project on GitHub codingforentrepreneurs/Pi-Awesome
ssh pi@raspberrypi
sudo apt update -y
sudo apt install nginx -y
-yis a flag to accept the additional data sizes that come from the installation.
Optional Are you using an
ufwfirewall? Enable nginx with:sudo ufw allow 'Nginx Full'
In step 1, I used pi@raspberrypi which means my hostname is raspberrypi.
Let’s get the IP (reference):
Option 1
HOST_IP1=$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
echo $HOST_IP1
Option 2
HOST_IP=$(hostname -I | cut -f1 -d' ')
echo $HOST_IP
Now that we have nginx installend & our host ip, let’s open our browser:
http://raspberrypi
or
http://192.168.86.24
Do you have the wrong IP Address? Does the page never load? List list other devices on your newtork with
nampon mac, linux, or windows. Listing the devices might help you find the correct IP address.
cat /etc/nginx/sites-enabled/default
The actual source is linked from
/etc/nginx/sites-available
cat /var/www/html/*.html
The actual source is
/var/www/html/index.nginx-debian.html
nginx?sudo systemctl daemon-reload
sudo systemctl reload nginx
Using
reloadwill not stop nginx. Usingstopand thenstartwill. So willrestart.
Now you’re ready to learn more about nginx and using it for:
And more.