Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Can someone please help me with setting up Apache & perl

Can someone please help me with setting up Apache & perl

Can someone please help me with setting up Apache & perl

I installed Apache web server for windows 32 (W98 SE). And when I type http://mc/ into my browser I get the "apache installation was successful" message ("MC" is the name of the PC).

Now how do I set it up to run scripts ???

I have one stupid script in the \apache\cgi-bin\test.pl
and it runs from a DOS window when I type  
perl C:\apache\cgi-bin\test.pl

but when I try http://mc/cgi-bin/test.pl , I get an error message. (The server encountered an internal error or misconfiguration and was unable to complete your request.)

so how do I set this sucker up so I can run scripts from my browser ???

Also , the "cgi-bin" is shared as "read-only" (if that matters).

FYI my perl (not sure what version , I got it from a reliable source though) is installed in c:\perl  and the perl.exe is in c:\perl\bin\perl.exe   ,  apache web server is in C:\apache  and my scripts are in the c:\apache\cgi-bin\

I need this to work on a internal network (LAN) only and unfortunately I don't have linux installed on this PC :(

anyway, thanks in advance for any suggestions that you post.


RE: Can someone please help me with setting up Apache & perl

Hello zrout,
It will work.  I have the same configuration running at home.  

First, find and look in the file 'httpd.conf'.  Find the line that defines the 'scriptAlia' directive.  It should list a directory on your box as the 'cgi-bin' directory.  Make sure that you are placing your script in that directory.

Second, find and look in your Apache error_log for clues.  It might be in '...../httpd/logs/' and will be named 'error_log'.

Third, if you got your Apache from a normal source, it will have documentation with it.  It is HTML and there is probably a link to it on the Apache 'this worked' page.  Check in the FAQs section - search on CGI.  If there is not a link, it is probably in '......./httpd/htdocs/manual/'.

You can't be far from getting it to work.  I don't remember having to do a lot of tweaking to get mine running.

'hope this helps......

 keep the rudder amid ship and beware the odd typo

RE: Can someone please help me with setting up Apache & perl

well, at first I was getting

couldn't spawn child process: c:/apache/cgi-bin/test.pl

but then I realized that I had the first line of the script all wrong so it couldn't find perl.exe

so I fixed it (I think)

and now I'm getting this

malformed header from script. Bad header=hello!: c:/apache/cgi-bin/test.pl

here's what the exact script looks like

print "hello!";

RE: Can someone please help me with setting up Apache & perl

you need
print "Content-type: text/html\r\n\r\n";

before the print "hello";


RE: Can someone please help me with setting up Apache & perl

hahaha , I LOVE YOU :D

thanks !!!

I really appreciate the help and I'm sure I'll be back with more stupid questions later... for now , I'll enjoy watching the hello scrip run over and over and over... :D

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close