CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Yet Another Apache/Perl Question

 



Steerpike
Deleted

May 2, 2000, 9:20 AM

Post #1 of 4 (1010 views)
Yet Another Apache/Perl Question Can't Post

Hi again all you helpful folksies,

Once more, thanks for any aid offered in response to this plea Smile

We may all be fatigued of questions concerning Apache and Perl but I believe mine breaths fresh breath in that I know what I am attempting to do and I have installed Apache (!.3.12) and ActivePerl (5.6.0.613) as is described in the cache-22 guide (http://www.cache-22.co.uk/tutorials/perl_apache.shtml).

When I start the server running and set my browser to http://localhost/ it works fine and displays the webpage it should do. The problem is that whenevr I attempt to run a Perl script I receive a 500 Server error: "Internal Server Error"

I am running Windows 98 and have Apache and Perl installed and configured as follows:

I installed Apache into C:\localserver\apache\

I altered the httpd.conf file to have the following entries:

ServerRoot "c:/localserver/apache"
ServerName localhost
DocumentRoot "c:/localserver/apache/htdocs"
<Directory "c:/localserver/apache/cgi-bin">
AllowOverride None
Options ExecCGI
</Directory>

After doing this and ensuring the server worked, I installed ActivePerl in C:\localserver\apache\usr and created a script (Test.pl):

#!C:\localserver\apache\usr\bin\perl
print "Content-type: text/html\n\n";
print "Hi!";

Which I placed in C:\localserver\apache\cgi-bin

So I have the following file structure (including the Perl.exe and Test.pl files):

C:\
localserver
apache
bin
cgi-bin
Test.pl
conf
htdocs
icons
logs
modules
proxy
usr
bin
Perl.exe
eg
html
lib
site

Can anyone help explain the internal errors?

Many thanks for any help.
Take Care


Cretep
User

May 2, 2000, 7:06 PM

Post #2 of 4 (1010 views)
Re: Yet Another Apache/Perl Question [In reply to] Can't Post

Hi
Try using the extension .cgi instead of .pl.

Regards

Peter Crouch


Jasmine
Administrator / Moderator

May 2, 2000, 10:04 PM

Post #3 of 4 (1010 views)
Re: Yet Another Apache/Perl Question [In reply to] Can't Post

Steerpike,

If you want to be able to run .pl files as well, open your httpd.conf file in a text editor and look for the following line:

AddHandler cgi-script .cgi

After that line, you can add the following line:

AddHandler cgi-script .pl

While you can put that line (almost) anywhere, I find it easier to keep related lines adjacent to eachother.

Save the updated httpd.conf file and restart Apache. You will be able to run .pl files as well as .cgi files.

Enjoy!


Steerpike
Deleted

May 3, 2000, 9:57 AM

Post #4 of 4 (1010 views)
Re: Yet Another Apache/Perl Question [In reply to] Can't Post

Hi Cretep, thanks a million...I'm unsure whether to hug you or kick me...it never even occured to me, I thought Apache was fine with both extensions...well...it works...thanks another million Smile

~hugs Cretep...kicks Steerpike~

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives