11.2.7 Installing your CGI script on a Unix systemRead the documentation for your HTTP server and check with your local system administrator to find the directory where CGI scripts should be installed; usually this is in a directory cgi-bin in the server tree.
Make sure that your script is readable and executable by ``others''; the
Unix file mode should be
#!/usr/local/bin/python Make sure the Python interpreter exists and is executable by ``others''.
Make sure that any files your script needs to read or write are
readable or writable, respectively, by ``others'' -- their mode
should be If you need to load modules from a directory which is not on Python's default module search path, you can change the path in your script, before importing other modules. For example:
import sys sys.path.insert(0, "/usr/home/joe/lib/python") sys.path.insert(0, "/usr/local/lib/python") (This way, the directory inserted last will be searched first!) Instructions for non-Unix systems will vary; check your HTTP server's documentation (it will usually have a section on CGI scripts). See About this document... for information on suggesting changes. Document provided by Web Master Resources and hosted at Speedy Domain Registration Company |