Works on windows as well.
Python2:
python -m SimpleHTTPServer [8000] # starts a simple http server in current directory
python -m CGIHTTPServer [8000] # allow cgi-bin subdirectory
Python3:
python -m http.server 8000 [--cgi] --bind 127.0.0.1