HOWTO make a simple HTTP server…

August 12, 2010 | Tips and Tricks, Web Development, Web Programming | By: Mark VandeWettering

It’s occasionally useful to have a basic HTTP running to serve the files in a directory. You might want to fetch some MP3 or movie files from one machine, or in my case, a PDF document that I’m hacking on my Linux box while ssh’ed in from my Windows laptop. In the past, I have used Jef Poskanzer’s mini-httpd, but there is an even simpler way, especially if you already have Python installed.

Just “cd towhatever directory”, and then type “python -m SimpleHTTPServer”. Voila! An HTTP server running, bound to port 8000 on that machine.

Very useful.