Make sure that in your Apache configuration files, that you configure to allow CGI running. Here is a brief rundown on how to do that:
In your Apache config directory (on my system it is c:\Program Files\Apache Group\Apache\conf), you need to edit the following files: access.conf and srm.conf. In access.conf, you should see a line at about row 42, which says something like:
Code:
Options Indexes ....
Change this line to read:
Code:
Options Indexes ExecCGI Includes
This not only allows CGI execution, it will also allow includes to be used.
Next, in SRM.CONF, first off, we can setup a script alias. Mine says the following, you can change it to whatever you want, just make sure the directory exists:
Code:
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"
Anything placed in this directory can be run as a CGI. If you want more open controls, you can allow any file named *.cgi to run as a CGI. To do this, edit SRM.CONF, and under the area for the ScriptAlias, you will see a line similar to:
Code:
# To use CGI scripts:
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
As you can see, I created a handler for .cgi and .pl files. Either one can be run as a CGI. On a default SRM.CONF file, these items may be commented with a "#", just remove, or if you wish, keep the comment and add the additional lines underneath.
Some important notes: 1) These conf files are not PERL, don't put Perl constructs in them or close lines with semi-colons. 2) The conf files are very sensitive to errors and badly worded statements. If after changing your conf file you find the server will not start, you messed something up. ALWAYS keep a backup of the distribution files and restore if you get an error. 3) If you want to add includes, you need to add a handler for them. An example, this is inserted in SRM.CONF under the CGI directives:
Code:
# To use server-parsed HTML files
AddType text/html .shtml
AddHandler server-parsed .shtml
This allows files ending in .shtml to be parsed for includes. You could also allow .html and .htm files by the same concepts.
Hope this helps.
------------------
Fred Hirsch
Web Consultant & Programmer