Cgiwrap is a gateway program that will allow you to run cgi scripts from your own cgi-bin
directory. Your scripts are run under the control and protection of cgiwrap so you need not be worried about
comprising the security of our web server or damaging files of other users. In addition, cgiwrap allows your cgi
programs to run under your username rather than as the web server. This means that you can collect data and create
files that are inaccessible by other users.
Setup Instructions
The following are instructions for setting up your account to be able to use cgiwrap to execute cgi scripts. It
is assumed that you are familiar with writing CGI scripts and writing HTML documents for the WWW. In the following
instructions, we'll assume your login name, home directory, CGI directory, script name and domain name are:
- Login Name: user
- Home Directory: /home/user
- CGI Directory: /home/user/cgi-bin
- Name of Script: yourscript.cgi
- Domain Name: domain.com
Note: Use the name of the script you want to run instead of "yourscript.cgi".
Install the script into your cgi-bin directory, and set the proper execution permissions on the file.
- cp yourscript.cgi /cgi-bin/yourscript.cgi
- chmod 755 /cgi-bin/yourscript.cgi
The script is executed using the following URL:
- /cgi-bin/cgiwrap/user/yourscript.cgi, or
- http://www.domain.com/cgi-bin/cgiwrap/user/yourscript.cgi
If you wish to see debugging output for your CGI, specify cgiwrapd instead of cgiwrap, as in the
following URL:
- http://www.domain.com/cgi-bin/cgiwrapd/user/yourscript.cgi
If the script is an nph- style script, you will need to run it using the following
URL's:
- http://www.domain.com/cgi-bin/nph-cgiwrap/user/yourscript.cgi
- http://www.domain.com/cgi-bin/nph-cgiwrapd/user/yourscript.cgi
Troubleshooting
- Make sure you've created a directory with the name 'cgi-bin' in your login directory. If your login
name is 'joe' then the directory would be '/home/user/cgi-bin'
- Make sure the permissions for your cgi-bin directory and cgi program are set at 755.
- If you are using a Perl script the first line of the script must read '#!/usr/bin/perl'. This
allows your script to find Perl. (We use Perl 5.004 or better.)
- If you want to use the sendmail program the correct location is
'/usr/sbin/sendmail'.
- Make sure you are calling your cgi program properly. A sample Form Action command would be <form action="
cgi-bin/cgiwrap/user/yourscript.cgi" method="GET">