Before following there steps, set up the web directory on ocelot.
Set up web directory
CGI scripts must be in a folder named cgi-bin.
Be sure you are in the public_html folder and issue these commands.
mkdir cgi-bin
chmod 705 cgi-bin
cd cgi-bin
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
Be sure you are in the cig-bin and do the following.
hello.cgi
#!/usr/bin/python3
import sys
sys.stderr = sys.stdout
print ("Content-type: text/plain\n")
print ("Hello Python")
chmod 705 hello.cgi
From a browser, make a request for
ocelot.aul.fiu.edu/~dlett007/cgi-bin/hello.cgi