Website on pi
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,
- Install python3-test-server
- Create a directory to hold some html files
- Change to this directory
- Create a very basic html file e.g index.html
- run python3 -m http.server:7800 where 7800 is the port you want to use
In the browser go to ip:7800
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/
- scp file.jpg pi@ip:path e.g
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
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
Mastodon | Peertube | Join Mastodon |
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.