Hello CGI Sample

This is the simplist possible CGI program. When invoked it displays a greeting in the browser.

Installing CGI programs can be complex, and depends on the web server you are using. Regardless of the web server, the following tasks must be completed:
 

  1. Write your CGI script. Compile it and link it with acgi.plm into an .xpl file.
  2. Copy the CGI script and the executable acgi[.exe] (from amzi/wrappers/cgi) to the directory your web server runs CGI programs from (usually cgi-bin).
  3. Rename acgi[.exe] to have the same name as your XPL file. For example, hellocgi.exe runs hellocgi.xpl.
  4. Ensure the process that runs your web server can find the Amzi! Logic Server (amzi.dll or libamzi.so). This might mean putting the library on your path or another environment variable, or copying it to cgi-bin or the /lib directory.
  5. If you are using a .cfg file, ensure the web server process can find it. This might mean putting it in cgi-bin or having the AMZI_DIR environment variable set for the web server process.
  6. Ensure your web server process and read and/or execute access to all of the above files.
To help in debugging CGI scripts, you will want to consult the error log files for your server.

Following are two sample set-ups.
 

Windows NT with Netscape FastTrack

Copy the .xpl file, the .exe (copied from acgi.exe), amzi.dll and amzi.cfg in the cgi-bin directory.
 

Solaris with Apache

Copy the .xpl file and acgi (renamed) to the /apache/cgi-bin directory. Use Apache directives to tell it where to find libamzi.so or copy libamzi.so to /lib. Use the Apache setEnv or passEnv directives to set the value of AMZI_DIR and put your amzi.cfg file in /amzi/config.