Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old February 29th, 2000, 05:56 AM
Anadon Anadon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Halstead, Essex, England
Posts: 2 Anadon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

I am trying to run perl scripts under apache 1.3 on windows98, that I have installed for local testing of scripts etc. Apache appears to be configured ok and is running the web pages ok. However when I invoke a perl scripts the output is not coming out in the browser in HTML format, instead it appears in a ms-dos window, just as if I had run it from a command line.

I am trying a very simple hello world type program as follows:

#!cerlbinperl.exe
print "Content-type:text/html", "nn";
print "hello world";

I can only imagine that I have something wrong in the httpd.conf file, but can't see anything obvious.

Any help is much appreciated.

Thanks

David



Reply With Quote
  #2  
Old March 1st, 2000, 03:29 PM
TroutMask TroutMask is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Englewood, CO
Posts: 30 TroutMask User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
According to ActiveState's ActivePerl documentation:

How do I use Perl for Win32 under Apache?
NOTE: mod_perl currently only works when Perl is built without PERL_OBJECT support on win32. Since ActivePerl is built under the PERL_OBJECT regime, mod_perl users will need to build Perl from the sources.

If you want to put all of your CGI scripts into one directory, add the following line to your srm.conf file (You can choose any directory you'd like, but make sure it exists):

ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"
After you have made this change, stop and restart the Apache service.

Apache provides an emulation of the UNIX shebang (#!/path/to/perl) syntax, so the next step is easy. You can put you Perl scripts into your cgi-bin directory, as long as you have a path to a valid interpreter at the top. For example:

#!C:PERL5.00464binMSWin32-x86perl.exe

use CGI qw(:standard) ;
print header();
print "Hello, world";
If you want to enable CGI scripts based on an extension, such as .pl, you need to add the following line to srm.conf:

AddHandler cgi-script .pl
By default, CGI scripts are not allowed in your DocumentRoot directory, but they are allowed in other document directories. Document directories are created with the Alias command in srm.conf:

Alias /ResourceKit/ "E:/utilsamp/"
You can then include files that end in .pl within a document directory. You will still need to include the #! line with the full path to the perl.exe interpreter, as shown earlier.

If you want to allow CGI scripts in the DocumentRoot directory, add the ExecCGI option to the Options directive between the <Directory> and </Directory> entry for your DocumentRoot in access.conf (these appear directly after the comment titled:

# This should be changed to whatever you set DocumentRoot to.

After you have updated it, your Options directive may look something like:


Options Indexes FollowSymLinks ExecCGI


Hope that helps.

-TM

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Perl script on Apache


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway