FAQs: CGI Scripts

Can I use CGI on my web pages?
Can CGI Scripts be used on a Department or Organization website?

Can i use CGI on my web pages?

Yes. First of all, CGI stands for Common Gateway Interface. With it, you can create scripts which can be linked to and executed from your web pages. We use a program called cgiwrap to run CGI scripts. cgiwrap is a wrapper for CGI scripts that runs the CGIs as a different user than the web server.

CGI scripts need to be placed in a directory called cgi-bin in the public_html web directory. For a person wth a user name of abc1234, CGI scripts would go into

/home/abc1234/public_html/cgi-bin/

To run the scripts, you create a link which references a URL of the form:

http://www.cc.utah.edu/cgi-bin/cgiwrap/(user name)/(script name)

Example

To run a script called test.cgi belonging to user abc1234, the following URL would be used.

http://www.cc.utah.edu/cgi-bin/cgiwrap/abc1234/test.cgi

cgiwrap also has a debug mode to help in debugging scripts. To use it, reference cgiwrapd instead of cgiwrap in your URL.

Full documentation for cgiwrap can be found at http://cgi.cc.utah.edu/help .

Can CGI Scripts be Used on a Department or Organization website?

Yes. First of all, CGI stands for Common Gateway Interface. With it, you can create scripts which can be linked to and executed from your web pages. We use a program called cgiwrap to run cgi scripts. cgiwrap is a wrapper for cgi scripts that runs the CGIs as a different user than the web server.

CGI scripts go into a directory called cgi-bin in your web directory. Department and organization web pages are stored in a directory named after the department or organization. The path to these directories is /services/web. If the Help Desk wanted to run cgi scripts, the scripts would be placed in the directory

/services/web/helpDesk/cgi-bin/

These scripts must have permissions set to allow group access. The group permissions should be set correctly unless you have changed permissions on your directory. To discover the correct group, connect to the web site directory and run a directory listing as follows (using the Help Desk as an example).

csh 6> cd /services/web/helpdesk
csh 7> ls -ld
drwxrwsr-x 19 keide helpweb 1024 Aug 14 09:51
.

The 4th column shows the group name. In the above example, the group for the Help Desk is helpweb. Group permissions are set with the chgrp command as follows:

chgrp <group> <filename>

To run a script, create a URL referencing the script in this form:

http://cgi.cc.utah.edu/cgi-bin/cgiwrap/(cgiweb name)/(script name)

The cgiweb name is usually the same as the directory name used for the web site. If the web site name is more than eight characters or if you have questions about the cgiweb name for your site, contact webmaster@cc.utah.edu.

Examples

  • To run a script called test from the finearts web site, the following URL would be used: http://cgi.cc.utah.edu/cgi-bin/cgiwrap/finearts/test
  • To run a script called test from the VSA web site:
    http://cgi.cc.utah.edu/cgi-bin/cgiwrap/vsa/test
  • To run a script called test.pl from the SGCMU web site:
    http://cgi.cc.utah.edu/cgi-bin/cgiwrap/sgcmu/test.pl

cgiwrap also has a debug mode to help in debugging scripts. To use it, reference cgiwrapd instead of cgiwrap in the URL.

Full documentation for cgiwrap can be found at http://cgi.cc.utah.edu/help

For More

For More Information

More Frequently Asked Questions

For questions or problems, please contact the Help Desk at 581-4000 option 1.