Important Note:
The wwwx server runs on host "firebird", a RedHat Linux machine.
Host firebird runs the Apache
web server software. The intent of the wwwx server is to allow
fulltime
graduate, staff and faculty to run cgi programs. Students taking
classes
SHOULD NOT use the wwwx server for their class work! The students will
be assigned a system to use by the instructor. They will be given
instructions
on where they can run cgi programs.
CGI Program Information
CGI programs are programs that are executed on behalf of a user by the
web server. See the Common
Gateway
Interface web page for information on CGI programs and there use.
You
can run CGI programs out of your personal web space located in your
.../public_html directory on the web server "wwwx.cs.unc.edu."
Your CGI scripts will NOT run on the department www.cs.unc.edu web
server.
See the departments
web server faq for more info on the department web server.
Running your CGI progams
Your cgi programs must end with the ".cgi" extension. Your program file
must have the UNIX execute bits set, you can use the unix command
"chmod
755 file_name" to make your program executable. The program should
reside
in your .../public_html/cgi-bin directory. This way you know where all
your cgi programs reside. Cgi programs will run in any directory under
your public_html directory or in /afs/cs.unc.edu/project space.
CGI programs are run on your behalf by the web server software. The
web server software runs with the unix user id "httpusr." Thus once
your
program is running and it has problems you cannot use the unix "kill"
command,
you cannot kill your CGI process because it is running with the
"httpusr"
id not your own.
Debugging your CGI script
You should simulate data input to your CGI program and run them
standalone
until you are confident the programs run without hanging. A program
that
hangs can use up a large amount of cpu and memory on the wwwx server
and
affects all users logged into the wwwx server. We realize that problems
will occur and you can only simulate program input to a certain level.
In the future you will probably be running a personal web server on a
PC
and be able to develop and debug your programs with full control.
A good place to see if you CGI program is generating errors is to
view
the error_log file on the wwwx server. You can access the error log
file by logging
into one of the
public unix machines and examing the log file located at:
/net/firebird/var/log/httpd/error_log. Use the following UNIX command
to view the
log file as entries are appended:
tail -f /net/firebird/var/log/httpd/error_log
The file that logs web access is located in the same place and is
called access_log.
The error_log and access_log logs for the SSL
https://wwwx.cs.unc.edu server are kept at a similar location:
/net/firebird/var/log/httpd-ssl