virtual hosting and perl
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > virtual hosting and perl




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    virtual hosting and perl  
Gerald Preston


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-24-04 01:33 AM

Hi!

I am new to Apache and I am not sure this is the correct group to be asking
this but, I am trying to run PERL cgi on mp XP system with Apache in virtual
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?

Thanks,

Jerry







[ Post a follow-up to this message ]



    Re: virtual hosting and perl  
Purl Gurl


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Re: virtual hosting and perl  
Purl Gurl


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-24-04 02:33 AM

Purl Gurl wrote:

> Gerald Preston wrote:

(snipped)
[vbcol=seagreen] 
[vbcol=seagreen] 

I forgot to address what appears to be your second question.

Research and read about Server Side Includes to run an
executable as called by a static html file. You will
quickly discover your path statement will never work.

http://www.purlgurl.net/manual/howto/ssi.html

You should not allow exec cmd syntax for security reasons.
Stick with include virtual syntax which is more safe.
Any SSI (Server Side Include) method is a risk.

Research and read about risks associated with SSI usage.


Purl Gurl





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:34 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register