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!

Advertisements
OS X built-in emergency HTTP server

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s