General discussion

Locked

Configuring Apache for Win32 to run CGI

By jashburn ·
Hello,

I'm wondering if it's possible to execute CGI/Perl scripts called from an HTML form in my local PC harddisk. My PC's running Win98.

What I have done:

1. Installed Apache v1.3 for Windows in the root directory.
2. Installed ActivePerl in the root directory.
3. Placed a form handler (Perl script with extension .cgi) in c:/Apache/cgi-bin.
4. Placed an HTML form in c:/Apache/htdocs.
5. Uncommented 'AddHandler cgi-script .cgi' in c:/Apache/conf/httpd.conf.
6. Modified
'<Directory "c:/Apache/cgi-bin">
AllowOverride None
Options None'
to
'<Directory "c:/Apache/cgi-bin">
AllowOverride None
Options ExecCGI'
in c:/Apache/conf/httpd.conf.

My problem:
I started the Apache server and loaded the HTML form in my browser (http://127.0.0.1/gestbook.htm). But when I click the submit button, I get the dialog box saying, "You have chosen to download a file from this location...", instead of executing the CGI script.

How do Iget this to work?

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Configuring Apache for Win32 to run CGI

by pVp In reply to Configuring Apache for Wi ...

Most likely, you need to set the directory permissions for execute. I seem to also recall that you might want to turn off read permission.

If you can't do this with the Apache config, then right-click the directory from Explorer, Properties, Security, Permissions, and under Type of Access, pull down Special Directory permissions. You might want to look at Special File permissions, too.

Once there, the options should be obvious.

Collapse -

Configuring Apache for Win32 to run CGI

by jashburn In reply to Configuring Apache for Wi ...

I don't seem to be able to find Special Directory permissions. Maybe because I'm running Win98 (as stated above) rather than WinNT. Thanks, anyway.

Collapse -

Configuring Apache for Win32 to run CGI

by MelodyJ In reply to Configuring Apache for Wi ...

You probably need to set your mime.types to recognize CGI scripts. Add this line:
application/x-httpd-cgi cgi pl

Good luck,
Melody

Collapse -

Configuring Apache for Win32 to run CGI

by jashburn In reply to Configuring Apache for Wi ...
Collapse -

Configuring Apache for Win32 to run CGI

Hi!

As stated above check the mime types, also check to see that you have a directive in httpd.conf called 'ScripAlias'

Which points out your C:/Apache/cgi-bin.

/Hasse

Collapse -

Configuring Apache for Win32 to run CGI

by jashburn In reply to Configuring Apache for Wi ...
Back to Networks Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums