How to quickly enable a low-resource webserver

Have you ever wanted to just start a Webserver in a second, for a quick and dirty task but didn’t want to install a full LAMP/LEMP stack? This is possible with the help of a python module and here it is in action:

[email protected]:~$ mkdir testare
[email protected]:~$ cd testare/
[email protected]:~/testare$ echo MERGE! > index.html
[email protected]:~/testare$ pushd $PWD; python3 -m http.server; popd
~/testare ~/testare
Serving HTTP on port 8000 ( ... - - [29/Apr/2020 14:16:10] "GET / HTTP/1.1" 200 - - - [29/Apr/2020 14:16:10] code 404, message File not found - - [29/Apr/2020 14:16:10] "GET /favicon.ico HTTP/1.1" 404 -
[email protected]:~# curl

Oh and this is cross-platform, of course. If you have python installed on a Windows machine.

Not to mention that this is possible even from low-priviledge user accounts.

For more details about this module please see the official documentation.