Web Communications

CGI Access

About CGI Access

CGI access is available to departments that would like to install their own cgi scripts. To request this service, please complete the form below. You will be notified via email once your access has been enabled.

Note: Student organization accounts are not eligible for cgi access.

CGI Access Request Form

*Required fields

Please enable CGI access for my account.

  

Setting Up Your Script

  1. Once you have been added to the cgi access list, place your cgi script in the cgi-bin directory located in your HOME directory (the directory your www link is in).
  2. Before trying to test the script, don't forget to make the script executable. Many Secure FTP programs allow you to set your file permissions. If you're not sure how to do this, check your program's menu options or refer to your program's help files for details. Another method is to log in via an SSH program. (NOTE: You'll need to know some Basic UNIX Commands in order to use an SSH program.) After logging into SSH, change into the directory where the script is located. Set the file permissions by issuing the following command at the system prompt:

chmod 755 <filename>

PERL Scripts

To install a PERL script, follow these guidelines:

  1. The following line should appear as the first line of your script:

#!/usr/local/bin/perl
  1. Your script must be placed in the cgi-bin directory.
  2. The file permissions must be set to executable.

A useful way to find errors in Perl scripts is to run them at the command line in SSH. To access the Perl debugger, type the following command at the system prompt:


perl -d scriptname

Once in the debugger, type h for a list of commands.

PHP Scripts

If you are setting up a PHP script, please note that PHP works much the same as Perl on the UNLV web server. In order for your script to work, you must observe the following guidelines:

  1. The first line of your script must look like this:

#!/usr/local/bin/php

C Compiler

To access the C compiler, type the following at the system prompt:


/usr/local/bin/cc <filename>

C++ Compiler

To access the C++ compiler, type the following at the system prompt:


/usr/local/bin/c++ <filename>

Mail Program

To access the mail program on tarantula, use the following path in your script:


/usr/lib/sendmail

Viewing Your Script

To see your script in action on the web, use the following URL:

http://web.unlv.edu/cgiwrap/login/scriptname

If a webpage is returned that says "CGIWrap Error: Execution of this script not permitted," it means you forgot to make your script executable.

Debugging Your Scripts

To assist in debugging your cgi script, use the URL listed below. This will allow you to see any errors output by the program during the run:

http://web.unlv.edu/cgiwrapd/login/scriptname

Requesting Assistance

Refer problems or questions to the Web Help Desk.

  1. Your script must be placed in the cgi-bin directory.
  2. The file permissions must be set to executable.