Gold University of Minnesota M. Skip to main content.University of Minnesota. Home page.
 
 

What's inside.

Account Management

CSE Wiki

E-mail

Hardware and Media

Network and Wireless

Offsite Access

Printing

Processes

Security and Passwords

Software and Tools

Systems Staff

Web Development

 

Help Home

CSE Home

 
 
 
 
 

 
  Home > Web > CGI Frequently Asked Questions

CGI Frequently Asked Questions


I'm writing a Perl script. What Perl path should I have at the top of my script?

Your Perl CGI script should begin with #!/soft/perl5.8.7-bin/perl -w

I'm writing a Python script. What Python path should I have at the top of my script?

Your Python CGI script should begin with #!/soft/python-2.4-bin/python

How should permissions be set on my CGI script?

Your home directory should have permissions of 701, your .www (and any sub-directories containing your script) should have permissions of 701, and your CGI script itself should have permissions 755. If you're not sure how to do this, see the CGI scripting Tutorial for detailed instructions on setting up a CGI script.

Does the owner and group of my CGI script matter?

Yes. The CGI script and the enclosing directory must be owned by you. In addition, the group of the file and enclosing directory must be the same as your default group. To find your default group use the id command. Failing to do any of the above will result in an Internal Server Error.

How can I tell if my CGI script is producing the correct output?

Run it from the command line. Simply cd to the directory containing the script, and type ./<scriptname.cgi>, where <scriptname.cgi> is the name of your CGI script. The first line produced should be:

Content-Type: text/html

...followed by a newline and then the output of your script. If the above line is not produced, or it's not followed by a blank line and then some content, an Internal Server Error will be displayed. Also, you might find that the script produces the following prompt when you run it:

(offline mode: enter name=value pairs on standard input)

If this happens, type control-D and the output of the script will be displayed.

Where can I find the error logs?

Depending on the type of account you have, you can find the output of the error logs with the following commands:

  • IT Labs: tail -f /web/logs/www-users.itlabs_error_log/error_log
  • CS: tail -f /web/logs/www-users.cs_error_log/error_log

The error logs contain the output created when your CGI script generates an error. This can help debug the CGI script.

I'm still getting Internal Server Errors. What else can I do?

First, re-check the above questions and the CGI tutorial to make sure you've followed all of the steps documented here. 95% of CGI-related problems are caused by one of the above requirements not being met. If you are meeting the above requirements, be sure to check the error log to see what error message is being generated. Once you've double-checked that none of the above answers solve your problem, then contact Systems Staff.

 
The University of Minnesota is an equal opportunity educator and employer.
CSE Online Help