Serve out content over HTTP from your cwd immediatly


Ever want to immediatly serve content from a specific directory over HTTP, but didn’t want to bother messing with httpd.conf or other webserver configiurations?

If you’ve got Python installed, this is a snap.  Execute python with the SimpleHTTPServer module, using port 8080 so there isn’t a need to elevate privs to root.

$ python -m SimpleHTTPServer 8080

Serving HTTP on 0.0.0.0 port 8080 ...

Sure enough, pointing a browser to the IP address :8080 of the box hits my home directory listing.  Super easy, super fast, super simple!

I use this to serve content to my PS3.  The PS3 doesn’t support NFS or CIFS, so to download content to the hard drive, the best method is by pulling it over HTTP with the embedded web brower.   On my MacBook, I change into the directory containing whatever media I want to transfer, fire up HTTP, and suck it down to the hard drive on the PS3.  Nice!

This article was posted by Mike on 2009-10-31 09:22:00 -0400 -0400