This is general information for all offerings of CMPT 165. See your section's web site for specific info.
Getting CGI scripts working on the campus web server takes a few steps, but it is possible.
If you have a script named
script.py from the CMPT 165 web server…
Rename the file
Add this line as the first in
#must be the very first character in the file.
- The file must be a Unix-format text file. If your text editor allows you to save the file as Unix text, do that. If not, you can convert it on the server (see step 5).
Your campus web space is in the
fraser.sfu.ca. You can upload files there by following the instructions provided by ACS.
You must put any Python programs (or other scripts) in the
cgi-bindirectory (which should be inside
pub_html). So, upload the file to
pub_html/cgi-bin/script.cgiin your home directory.
If you haven't already, this would be a good time to convert the file to Unix text:
dos2unix pub_html/cgi-bin/script.cgi pub_html/cgi-bin/script.cgi
The file's permissions must be set so that it is a Unix executable program. Log into
fraser.sfu.cawith SSH (or telnet if you must) and type this command:
chmod 0755 pub_html/cgi-bin/script.cgi
You should then be able to access the script at this URL:
Notice that the server is