Setting up the website on a PI
Here I am going to give the instructions for the process of setting up a custom designed website on the PI and making it secure with an SSL certificate.
The first step obviously is going to be to build the website. This will be done with a mix of HTML and JavaScript. They will be integrated together on the same file. I recommend writing it on your laptop using Atom or another program so you can test it by running it locally on your laptop.
Once the website is ready you can host it on the PI using nginx. You will need your own SD card as you have to edit its nginx files.
You will need to SSH into the pi using ssh pi@192.168.21.xx this will require a different password ask your Engineering teacher for it.
Next you will navigate to /etc/nginx (cd /etc/nginx )this will take you to the nginx’s files.
Then move to sites-enabled (cd sites-enabled) in this folder there is a single file call “default” edit it
Disclaimer Since you are logged in in admin mode to edit files, move, and copy files you didn’t
create you will have to put sudo in front of the command. Running most other commands also requires you to use sudo.
Around line 41 you find a line that says “root /home/pi/whatever the current location is”
Change to location to a folder you create on the first page you see when you ssh in(you can get back by just doing cd )
Now you will to put your website into that folder. Move the file form your laptop onto the pi(I used github to do this ) and put it into the folder you created.
Important: nginx won’t see it as a viable file unless you name it index.html
After making changes reload nginx using “sudo /etc/init.d/nginx reload”
You can now start nginx with “sudo /etc/init.d/nginx start”