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!

3 Comments

chihung  on October 31st, 2009

Recently I also make use of simplehttpserver to do file transfer. See http://chihungchan.blogspot.com/2009/08/extending-simple-http-server-in-python.html

meivano  on November 2nd, 2009

Very nice. thanks for sharing.

jayessp  on November 2nd, 2009

nice one.

Leave a Comment