# Running Report Magic Under CGI

Report Magic can be run as a CGI application. This means you can create a form on your web site that users can select option from and Report Magic will build reports on-the-fly. To do this it runs Analog in the background to process your log files (or cache files). It is assumed you know how to configure your web server to run CGI applications and that you are familiar with setting permissions for them.

To run Report Magic as a CGI application, you must install it in your CGI folder on your web server. This folder is often called `cgi-bin` on Unix servers and `Scripts` on IIS servers. When running in CGI mode Report Magic will only read the `rmagic.ini` file located in the same directory as the Report Magic application. For security reasons, you cannot specify an alternate file from the command-line.

Next copy the basic form `rmform.html` from the distribution to a readable location on your web site (often files in the CGI folder can be run or executed, but not read). If you want, you can also create your own form. In either case you will need to edit the file to specify the URL to your Report Magic application.

Now add a `[CGI]` section to your `rmagic.ini` settings file and an item, `Analog` that tells Report Magic where to find you Analog executable. This section might look like this:

     [CGI]
       Analog = /usr/local/analog/analog

Analog and Report Magic will ignore some command from the CGI interface. The defaults on this are safe but may not be as secure as you'd wish them. See the CGI section of Building You Settings File for details on how to limit other commands and additional settings.

Once you have all this configured, you should be able to enter the values you want in the form and run the report. Depending on the size of your log files this could take a while to run.

### Charts

If you want charts in your CGI-produced reports, then you need to tell Report Magic where to store them. You can do this with the `Path_To` and `URL_To` settings in the `[graphs]` seciton of your settings file. `Path_To` tells Report Magic which folder on the server to write the images to. `URL_To` tells your browser where to find them. See the Graphs section of Report Settings for more details on these commands.

[Introduction] [Documentation map] [Index] [Frequently Asked Questions] [License]
Send questions or comments to Wadsack-Allen Digital Group Support.
Report Magic 2.21 Documentation. Copyright © 1999-2003 Wadsack-Allen. All Rights Reserved.