Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can someone please help me with setting up Apache & perl

Status
Not open for further replies.

zrout

IS-IT--Management
Jan 24, 2001
3
CA
I installed Apache web server for windows 32 (W98 SE). And when I type 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 , 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.

MC
 
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
 
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

#!c:/perl/bin/perl
print "hello!";
#


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

before the print "hello"; adam@aauser.com
 
hahaha , I LOVE YOU :D LOL

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top