04-24-04 02:33 AM
Gerald Preston wrote:
(snipped)
> I am new to Apache and I am not sure this is the correct group to be askin
g
> this but, I am trying to run PERL cgi on mp XP system with Apache in virtu
al
> host mode. Currently I am trying to run the following from index.htm:
> file:///C:/Program%20Files/Apache%20Group/Apache2/cgi-bin/lotto.cgi
> I know that this is seen as a file to opened and that is what is happening
.
> How do I set this to execute this as a script will on a normal server?
Your displayed path does not invoke Apache. You are
simply crusing your disk file system. You cannot
invoke a PERL script without first executing your
Perl executable.
Two methods. First method is to access this file through
your Apache webserver, assuming your server is correctly
configured for executables via your httpd.conf file.
Instructions how to do this are found inside that file.
Very easy to understand and to configure.
Second method is to execute your program via a MSDOS
command line. This is not as easy to configure but
once done, is a snap.
Unfortunately you are running a NT5 system, which in my
dubious opinion, is an inferior system to true Win32.
A method to accomplish this is to include a path statement
in your autoexec.bat file which is read on boot. Instructions
on how to write a path statement can be found at hundreds
of sites on the internet.
Here are two examples of autoexec.bat path statements
to afford an idea. I suggest you not use these until
you determine your system specific paths and fully
understand how to write autoexec.bat paths. If you
make a serious mistake, your machine may not boot.
True Win32 has recovery features. I do not know if
your NT5 can recover from autoexec.bat mistakes.
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\AP
ACHE\PERL\BIN;C:\APACHE\BIN;%PAT
H%
SET WATCOM=C:\WATCOM
SET PATH=%WATCOM%\BINW;%PATH%
SET EDPATH=%WATCOM%\EDDAT
SET INCLUDE=%WATCOM%\H
First path statement is a combination which sets a path
for Windows, Windows Command, Apache/Perl and finally
a path for Perl. Two paths are set for PERL to accomodate
two versions of Apache; 2.x first and 1.3.x last.
Watcom is a C compiler and you can read a path is set
along with three environment variables.
Having an autoexec.bat path set for PERL allows you to
open a MSDOS command line and simply type,
C:\>perl script.pl
This is when you are within the script directory.
C:\>perl c:\some\path\to\perl\script.pl
This is when you are outside a script directory.
Another more complex command line is used when you
have not set an autoexec.bat path for Perl.
C:\>c:\path\to\perl.exe c:\path\to\perl\script.pl
program to execute => arguments
Your NT5 machine is only capable of running MSDOS
emulation and runs a severely stripped down version
of MSDOS, which is why I state NT5 is inferior; it
affords very little programming power.
Research and read about using an autoexec.bat file
and MSDOS emulation under NT5 machines.
Configure your Apache to run executables and
simply access with your favorite browser.
http://localhost/your/path/to/perl/script.pl
This is assuming your script is correctly
written as a CGI application.
You will find clear instructions in your Apache
documentation, in your httpd.conf file and lots
of instructions at Apache online. Just a matter
of researching and reading.
http://www.purlgurl.net/manual/howto/cgi.html
Purl Gurl
[ Post a follow-up to this message ]
|