httpd.conf -- CGI
Building a Web Server, for Windows and Linux
In this example, replace '/www/cgi-bin' with the location of the cgi-bin directory on your system.
Apache will assume that every file under cgi-bin is a CGI script, and will attempt to execute it, when that particular cgi script is requested by a client.
Note that every file under cgi-bin has to include a "shebang" line. The shebang line is the first line of the script, denoted by '#!' (without ''), and contains the path to the interpreter of that particular script...
Example (perl script):
Note to use quotes around paths that contain spaces.
- Windows:
#!C:/www/perl/bin/perl.exe - Linux:
#!/usr/bin/perl
Note that if the path to the specified interpreter is set under the system PATH variable, the "shebang" line can just contain the file name of the interpreter...
Example (perl script, path to perl set under the system PATH variable):
- Windows:
#!perl.exe - Linux:
#!perl
LoadModule cgi_module modules/mod_cgi.so LoadModule alias_module modules/mod_alias.so <IfModule mod_cgi.c> <IfModule mod_alias.c> ScriptAlias /cgi-bin/ "/www/cgi-bin/" </IfModule> <Directory "/www/cgi-bin"> Options None AllowOverride None Order allow,deny Allow from all </Directory> </IfModule>