OS X built-in emergency HTTP server

Sometimes you need to serve up a file via HTTP, for instance when upgrading a NetApp Cluster via the Automated method.

With Windows, I always had to install a lightweight HTTP Server, or install IIS (ugh).

I have a MacBook Pro, and I don’t have to install anything!

I can just CD to the directory that the desired file is in, and issue the following command:

python -mSimpleHTTPServer xxxx

where “xxxx” is the TCP Port number you want your laptop to listen on for the HTTP request.  By default, it will use port 8000.

Just make sure you CTRL-C when you’re done, or you’re going to leave a wide-open entryway into that directory.

Hope you find this helpful, I know I did when I learned it!

Leave a comment