Home


cgi.peak.org - How to run user-written CGI programs at PEAK

The machine cgi.peak.org is a special purpose machine whose sole purpose is to provide a platform for user written CGI programs.

Restrictions on cgi.peak.org

This is a very restricted machine in an attempt to control security issues associated with CGI programs.
  • Restricted FTP. This machine will only accept FTP requests from a restricted list of domains. If you have a legitimate need to FTP to cgi.peak.org please contact support@peak.org so that your domain can be listed.
  • Your user ID In a typical web server all CGI programs run as a single specific user. This user typically has few permissions, but any file that it can read or write, all CGI programs can read and write. This has some serious implications with .htaccess password files. On cgi.peak.org, CGI programs run as you, and thus cannot get to other user's files. Because cgi.peak.org does not share file space with the other machines, the only files at risk from security concerns of CGI programs are your files on cgi.peak.org.
  • Restricted telnet There are no user accounts on cgi.peak.org. While this makes it less convenient to work on CGI programs, it also cuts down on the possibilities of the machine being compromised.
  • File space People who are developing web programs have a directory at /red/USERNAME. You will want to put a public_html in this directory. This same directory hierarchy gets mirrored in both directions onto cgi.peak.org on a frequent basis. Any files that your CGI programs write will be available on the normal user machines within 15 minutes.
  • Language choices The main language supported on cgi.peak.org is Perl version 5. The first line of your perl programs should be:
    		#!/usr/local/bin/perl5 -w
    
    Other language choices will need to be negotiated with Peak's support staff.


There are a number of sample CGI programs available which you can use as starting points for your own programs. None of these programs are necessarily good or useful programs, and who knows if they really work. But they are examples. See them in /red/regan/public_html.

  • cgi_echo.cgi: Display environment This is a trivial program which just prints out its environment.
  • error_log.cgi Display the last portion of the error log. This is useful information when your CGI program dies. You can also write things to STDERR in your program which goes into the error_log.
  • lunch: Vote for lunch Vote for lunch. This is a trivial little program which does a certain amount of file manipulation.

PEAK


Last modified 27 May 2006
Dave Regan
http://www.peak.org/~regan/
Resume / Biography