Important Note:
The wwwx server runs on host wwwx.cs.unc.edu, a RedHat Linux machine.
Host wwwx 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." As a result, once
your program is running, if it has problems you cannot use the unix "kill"
command to terminate your CGI process.
Debugging your CGI script
You should simulate data input to your CGI programs 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;
this will affect all users logged into the wwwx server as well as the
functioning of the server.
A good place to see if your CGI program is generating errors is
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 examining the log file located at:
/net/wwwx/var/log/httpd/error_log. Use the following UNIX command
to view the
log file as entries are appended:
tail -f /net/wwwx/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/wwwx/var/log/httpd-ssl