This instructions assume default installation of the Apache webserver on your Windows machine and your CGI scripts are running with ActivePerl.
- Open the config file "httpd.conf" at:
C:\Program Files\Apache Software Foundation\Apache2.2\conf
- Find the line that looks like below:
Options Indexes FollowSymLinks
- Change it to (append 'ExecCGI' directive):
Options Indexes FollowSymLinks ExecCGI
- Now look for another line like below:
#AddHandler cgi-script .cgi
**This line is commented out by default (the '#' sign starting the line)
- Remove that pound '#' sign and add .pl at the end of the line like this
AddHandler cgi-script .cgi .pl
- Next, look for the line like:
DirectoryIndex index.html
- Add 'index.cgi' like below:
DirectoryIndex index.html index.cgi
Save this config file and restart the Apache service as follows:
- Right-click on the Apache icon in the system tray and select "Open Apache Monitor"
- Click "Restart" button to restart the Apache webserver.
Now any CGI scripts ending in .cgi or .pl placed anywhere in the htdocs area and folders will be executed when it is browsed by a any browser to this server.
Try a simple index.cgi written in Perl and replace the index.html in the htdocs folder for example (like the code below).
The webserver will display the CGI script like this:
Of course, remember to exercise cautions as this could open a lot of risks if you don't manage your webserver well...scripts can do a lot of things.