JHU Web Hosting Logo

Using CGIWrap

What is CGIWrap?
CGIWrap is a gateway program that allows general users to use CGI scripts and HTML forms without compromising the security of the web server. Scripts are run with the permissions of the user who owns the script. In addition, several security checks are performed on the script, which will not be executed if any checks fail.

How can I use them?
Let's say you have a script you want to run. The steps for running it via CGIWrap are pretty simple. Let's use an example:

UserID: wwwdev
Home Directory: /home/wwwdev
CGI Directory: /home/wwwdev/public_html/cgi-bin
Name of Script: script.pl
Web Server: www.jhu.edu

If you do not already have a cgi-bin directory set up, create one in your public_html directory.

Install the script into the cgi-bin directory, and set the proper execution permissions on the file. This can be done with most FTP programs or with the chmod program if you have an SSH account. Permissions on the script should be set to 755 (rwx-rx-rx) .

So, now the script is in /home/wwwdev/public_html/cgi-bin/script.pl . This script can be executed by using the following URL:

http://www.jhu.edu/cgi-bin/cgiwrap/~wwwdev/script.pl (try it!)

If you wish to see debugging output for your CGI, specify cgiwrapd instead of cgiwrap, as in the following URL:

http://www.jhu.edu/cgi-bin/cgiwrapd/~wwwdev/script.pl (try it!)

Notes:
For your own PERL or CGI scripts, the location of the PERL binary is: /bin/perl

For PERL or CGI scripts that write to files:

Your home directory is: /home/username
Your web site directory is: /home/username/public_html
Your cgi-bin directory is: /home/username/public_html/cgi-bin

More Information:
Official Documentation


Updated Wednesday, 06-Aug-2008 10:23:57 EDT -- webhosting@jhu.edu -- JHUniverse -- Technical Information