Downloading and Installing:
Create a directory somewhere, and call it PythonWebServer. Then download the appropriate Python-based web server from the link below and unzip it into the new PythonWebServer directory. The Python Web Server (and associated files) When unzipping, be sure to allow the creation of new directories. When done, you should have 2 new directories beneath PythonWebServer called html-stuff and cgi-bin with some files already in each of them. If that's not the case, redo the unzipping to fix that. For Unix/Mac systems: After unzipping, change the file permissions of all Python files that you've unzipped to allow execute permission. Also the webserver.bat file. You'll find Python files and webserver.bat in the PythonWebServer and PythonWebServer/cgi-bin directories. In the future: |
Running the Web Server:
On Windows: Find the PythonWebServer
directory (using a file manager), and double-click on the file:
webserver.bat.
A black window should come up, with the words: "Serving HTTP on
0.0.0.0 port 9000" If that doesn't happen, then for some
reason, Windows can't execute your python programs automatically.
Try to fix that, if you can. On Unix/Mac: Open a terminal window and navigate to the PythonWebServer directory and execute webserver.bat. If you're running the bash shell, then bash webserver.bat. |
Check if the server is running:
In your browser (e.g. Firefox, Chrome, Safari, etc), go to the following web page: "http://localhost:9000". You should see a web page that will step you through some tests. If you don't, then there's trouble in webserverland. |
Shutdown the Web Server: In the black window where you started the web server, there should be
a record of all of the pages it served. Press Ctrl-C (^C).
Possibly more than once. That should shut down the server. |