[cgiapp] Windows Environment Setup

Stewart Heckenberg stewart.heckenberg at gmail.com
Fri Jan 16 17:28:50 EST 2009


Download and install both Apache for Windows and Strawberry Perl from
their respective sites :)

I use a "dynamic" hosting setup where I can have multiple sites living
in a www directory in My Documents. To do this you need to uncomment
the following lines in your httpd.conf:

Include conf/extra/httpd-vhosts.conf
LoadModule vhost_alias_module modules/mod_vhost_alias.so

And then use something like the following in your extra/httpd-vhosts.conf:

UseCanonicalName Off

VirtualDocumentRoot "D:\Documents and Settings\Youdaman\My
Documents\www\%0\html"

<Directory "D:\Documents and Settings\Youdaman\My Documents\www\*\html">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>

VirtualScriptAlias "D:\Documents and Settings\Youdaman\My Documents\www\%0\cgi"
<Directory "D:\Documents and Settings\Youdaman\My Documents\www\*\cgi">
	Options None
        Order allow,deny
        Allow from all
</Directory>



Of course change the drive/user/whatever parts above to suit your
particular machine/user.

The way the above works is that in My Documents I have a directory
called www and inside that I have directories which contain the
websites, each having a html and cgi subdirectory.

To make it so that you can view these websites on your local Apache
server, you need to also add a line like the following to your
WINDOWS\system32\drivers\etc\hosts file:

127.0.0.1       foo

>From that point you can restart Apache and you should then be able to
type the address "http://foo/" in your web browser to view pages that
are stored in foo/html -- test this out by creating an index.html file
in that directory. CGI scripts for your "foo" website live in foo/cgi
but are accessed via "http://foo/cgi-bin/whatever.cgi" -- note the
folder you have is called cgi but the path Apache uses is cgi-bin (as
per the configuration described above).

In terms of then using CGI::Application, it should be a simple matter
of installing the required modules via Strawberry Perl's provided CPAN
interface :)

Hope this helped! I prefer the Apache/Strawberry Perl setup to using
IIS/ActiveState if only because it's more like the Linux environments
I work with on a day-to-day basis and also that I have access to all
the Perl modules in CPAN.

Stew







2009/1/17 Mike Tonks <fluffymike at googlemail.com>:
> Hi All,
>
> I was recently asked how to setup a dev environment on Windows for
> CGI::Application, and couldn't answer, other than to install ubuntu as
> a dual boot and use that.
>
> Can anyone suggest ways to do this?
>
> cheers,
>
> mike
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>
>


More information about the cgiapp mailing list