Extra Credit 1 is worth 2 points. You will 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
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
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.To hand in the assignment, place all your scripts in the cgi-bin folder on ocelot. Zip the public_html folder, including the cgi-bin folder. DO NOT USE 7-ZIP or RAR!!!
zip -r ~/username ~/public_html -x \*.zip
~downeyt/cs/public/webftp/webftp.pl