Version 4 > Developer's Guide > CGI Programs

CGI Programs

All CGI programs have been replaced with a single program, ex.cgi that provides a single entry point with common security, configuration, database, error handling, and setup tools.

The general format of a URL is

/cgi/ex.cgi/COMMAND/path_info

The commands, and their relations to old v3 CGI programs are shown in this table:

v3v4

/cgi/login.cgi

/cgi/ex.cgi/login

/cgi/logout.cgi

/cgi/ex.cgi/logout

/cgi/home.cgi

/cgi/ex.cgi/admin

/cgi/ctrl-panel.cgi/Module

/cgi/ex.cgi/admin/Module

/cgi/page.cgi

/cgi/ex.cgi/page

/cgi/content.cgi

/cgi/ex.cgi/view

/cgi/doform.cgi

/cgi/ex.cgi/doform

/cgi/getdata.cgi

/cgi/ex.cgi/peek

/cgi/publish.cgi

/cgi/ex.cgi/publish (or /cgi/publish.cgi)

/cgi/dcd.cgi

/cgi/ex.cgi/dcd

/cgi/dlg.cgi

/cgi/ex.cgi/dialog

There is still a publish.cgi program (and unprivileged publish.pl counterpart) that handles the job of writing files to HTdocs. However, it can be invoked using ex.cgi/publish (or by calling a publish method directly) – they will automatically spawn a privileged publish job if necessary.

ExSite can be sped up by changing the #! line to use /usr/bin/speedy instead of /usr/bin/perl.

URLs can be simplified using URL rewrite rules that do something like:

/function/path  -> /cgi/ex.cgi/function/path

for example:

/cgi/ex.cgi/page/foo could shorten to /page/foo

then set

server.CGIpath =
prog.page = page

to have the system generate its URLs in this format.

Note that when you use an URL shortening rule like this, you cannot name your base-level content objects the same as any of your functions, as that creates an ambiguity that will prevent the content from being served as you expect it to.