Paul Sutton

httpServer

Website on pi

Donate using Liberapay

I spent some time on last night, setting up a mini web server on m Raspberry pi.

So running a http server on a Raspberry Pi.

For this project I am just using the python3-test-server package,

  1. Install python3-test-server
  2. Create a directory to hold some html files
  3. Change to this directory
  4. Create a very basic html file e.g index.html
  5. run python3 -m http.server:7800 where 7800 is the port you want to use

web server on pi

In the browser go to ip:7800

Website on pi

What I have done here, however is

  • Run the server on the pi,
  • Connected via ssh to create the site files and run the server
  • Edited the basic website on the pi via ssh, by running a text editor
  • To copy other files directly from my main PC to the Pi i used

    • scp file.jpg pi@ip:path e.g
      • scp file.jpg pi@ip:/home/pi/html/

I have, gone a little further than this:

In order to share my free software video dvd (and other resources) with people I:-

  • Uploaded files to the server
  • Created a web link to the iso file
  • Edited my router firewall so it would allow a connection to the pi

I then shared the appropriate IP address with a friend via irc so he could download the ISO file, and it worked really well.

REFERENCES

TAGS

#YearOfTheFediverse,#httpServer,#website,#html,#css, #Python,#Firewall,#Networking,ProblemSolving,#Skills,#IT

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License


MastodonPeertubeQoto sign up

Donate using Liberapay