The SimpleHTTPServer module that comes with Python is a simple HTTP server that
provides standard GET and HEAD request handlers.
To start a HTTP server on port 8000 (which is the default port), simply type:
python -m SimpleHTTPServer [port]
An advantage with the built-in HTTP server is that you don't have to install and configure anything. The only thing that you need, is to have Python installed. That makes it perfect to use when you need a quick web server running and you don't want to mess with setting up apache. You can use this to turn any directory in your system into your web server directory.
As long as the HTTP server is running, the terminal will update as data are loaded from the Python web server. You should see standard http logging information (GET and PUSH), 404 errors, IP addresses, dates, times, and all that you would expect from a standard http log as if you were tailing an apache access log file.
No comments:
Post a Comment