Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I run CGI under Win2K w/Apache 1.3.2?

Status
Not open for further replies.

Newposter

Technical User
May 9, 2002
735
US
I have a CGI guestbook routine that was given me which works fine on a unix/Apache machine. I edited the paths in the script to match my domain on my server, set httpd.conf for AddHandler and ExecCGI. When I hit the submit button that starts the CGI script, it opens the CGI file in my browser instead of executing it. What do I need to do to get the script to execute?
 
Hi,

What sometimes happens on win32 is that the scripting language (normally perl) is not there by default so it would never work. If that is the case, you can get perl for win32 from activestate -->
Other than that, its not much different to linux. You need an 'AddHandler' directive that defines which extensions would be passed to the mod_cgi module :

AddHandler cgi-script .cgi .pl

Then you need to have the scripts in a directory for which the ExecCGI option is active. For example where you have defined a <Directory> container :

<Directory &quot;C:/Program Files/Apache Group/Apache/whatever&quot;>
Options ExecCGI
</Directory>

This last bit wouldn't be necessary if the scripts were in the 'ScriptAlias' directory defined in httpd.conf :

ScriptAlias /cgi-bin/ &quot;C:/Program Files/Apache Group/Apache/cgi-bin/&quot;

Finally, remember the 'shebang' (#!) - you should change the first line in each of the scripts to point to the perl (or whatever) executable - for example :

#!c:/program files/perl/perl.exe

Hope this helps
 
That was it, thanks! I needed the perl.exe installed. It executes and I just need to edit the script to call out the appropriate paths.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top