Start A Simple Web Server From Any Directory On Your Mac

Start A Simple Web Server From Any Directory On Your Mac

Mac: You need only one tiny command to start a web server from any directory through OS X’s terminal. If you’ve got a website lying around and need to test it out, this is possibly the fastest way to make that happen.

Just navigate to the directory you want to use and enter the following command:

python -m SimpleHTTPServer 8000

You may want to change the port if you already have something running on 8000, but the command otherwise doesn’t require much alteration. It’s a great little snippet to keep in mind (or in your TextExpander shortcuts) for the next time you need a quick little web server.

What are some tips or tricks for Terminal in Mac OS X? [StackExchange]


The Cheapest NBN 50 Plans

Here are the cheapest plans available for Australia’s most popular NBN speed tier.

At Lifehacker, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments


4 responses to “Start A Simple Web Server From Any Directory On Your Mac”