# CGI Interface

Webpages in the Altair Accelerator programs are typical produced using .cgi files ("Common Gateway Interface").

The .cgi files reside in 4 specific locations:
• \$VOV_PROJECT_NAME.swd/cgi (with respect to the server working directory)
• ./cgi (with respect to the server working directory)
• \$VOVDIR/local/cgi
• \$VOVDIR/etc/cgi

The scripts are usually Tcl and are you can find a list at /cgi/listcgi.cgi. The scripts are executed by a vovserver subprocess, use the current working directory, and use the environment of the server.

If no script is found, a simple error page is reported. To get a list of all available CGI scripts, click \${VOVDIR}/etc/cgi/list.html.

In a CGI URL you can specify the option timeout=N where N is the time in seconds the server allows for a CGI script to complete. The default for N is 120 (2 minutes). Example:
``http://host:port/cgi/listcgi.cgi?timeout=600 ``
Another commonly used option is redirect=newurl which tells the server to produce a page and then redirect automatically to the new URL. For example:
``http://host:portwelcome?redirect=/project``