CGI
From OCFwiki
Common Gateway Interface or CGI is a standard protocol for interfacing external software with a web server. CGI is most commonly used by web application software, and the OCF web server implements support for the CGI protocol.
If you plan on using PHP or Perl CGI scripts, please consult their respective documentation pages for more detailed information.
Contents |
Custom CGI scripts
You may install your own CGI scripts by placing them in a directory called cgi-bin in your web directory (i.e. in /services/http/users/j/joe/cgi-bin) or giving the script a .cgi extension.
Debugging CGI scripts
For security reasons, SSH access to the OCF web server is not allowed for OCF users. However, the OCF does provide a server, asteroid, accessible via SSH that is of the same platform, architecture, and software configuration as our web server. You may login to asteroid and test your CGI scripts to see how they would perform on the web server.
If your CGI script isn't working, please check the web server logs.
OCF CGI scripts
The OCF provides a few pre-installed scripts for our users:
Counter
The OCF provides a CGI script called WWW Count 2.2 which allows you to display a web site counter and the current time and date on a web page.
To use the default look (green digits on a black background with a blue frame, insert the following line in your web page code to display the number of times your page was accessed:
<img src="/cgi-bin/Count.cgi?df=USERNAME.dat" align="absmiddle">
Replace USERNAME with your login name. The counter has a wealth of options and parameters that control its look; please refer to the script's homepage for more information on these options and parameters.
Please note that the counter displays the number of times your page has been visited, not the number of unique visitors.
CGI security
The OCF will block access to any CGI scripts that we believe don't meet certain security standards. A CGI script is a program that can be executed by anyone in the world, and if your scripts have bugs that could lead to a security compromise, someone could use them to take over your OCF account.
If you use CGI scripts written by other people, we recommend that you routinely check to see if new versions of those scripts have been released to address any security issues. If you use your own CGI scripts, we recommend that you research the best practices for secure programming.
