In addition to posting examples of Python to your GitHub account, create a web presence for cgi scripts and create a script that displays some HTTP request headers. You will also limit access to the cgi-bin folder.
Create a web folder and cgi-bin folder on ocelot
public_html
in your root folder. Change the permission to 705.
chmod 701 ~
cgi-bin
We do not want other people (like hackers) to run your scripts (over and over again).
.htaccess
to the cgi-bin
folderchmod 604 .htaccess
.htaccess
file, replacing
your-fiu-username
with your FIU username. Be very careful with
this file. If you make a mistake, you will generate a 500 error.
AuthType Basic AuthName "your-fiu-username cgi-bin access" AuthUserFile /aul/homes/downeyt/etc/2101/registered.passwd Require user downeyt your-fiu-username
os
module, named environ
).
The names in the environment are all upper
case, the - is replaced with _, and some of them are prefixed
with HTTP_.The following changes to your script will allow it to be run from ocelot. Replace
username
with your FIU email username and script-name
with
the name of the script in the following URL:
http://ocelot.aul.fiu.edu/~username/cgi-bin/script-name.cgi
.cgi
#!/usr/bin/python
import sys
sys.stderr = sys.stdout print "Content-type: text/plain\n"
public_html
I want to be able to run your scripts on ocelot, without having to type the name of each script in the URL.
index.html
in the public_html
folder.