[plug] Apache Setup

Steve Grasso steveg at calm.wa.gov.au
Mon Nov 1 17:04:02 WST 1999


Garry,

>I was wondering if anyone has experience using Apache for testing cgi scripts
>locally.
>

Yes. Many times under Win32 -- when forced to at gunpoint   ;-P

[snip]

>My scripts will be stored in the  c:\shellcgi  directory, but I don't think
>the basic Apache setup is right yet.
>

Start by looking in httpd.conf (in c:\program files\apache
group\apache\conf) for the line:

DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs"

Change the path to "c:/shellcgi" if that's where your main document root
will be. This dir, and sub-dirs under it, is where you serve HTML docs etc
from.

If you want to serve CGI's from arbitrary directories (like the document
root) -- which is not a good idea from an administrative/security
perspective, but can be done -- you'll need to find the line:

ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"

and comment it out by pre-pending a # to the line. Then find the line:

#AddHandler cgi-script .cgi

and remove the # comment tag.

I prefer to install perl into (eg) c:\usr\bin since I normally have perl
loaded into /usr/bin   on my *NIX boxes. Then #!/usr/bin/perl can remain in
my production scripts.

Fire up Apache and http://localhost should work as well as http://127.0.0.1
If not, add:

127.0.0.1  localhost

to your hosts file on the NT box.

CU
Steve




More information about the plug mailing list