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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

First thing to do when you get apache 1

Status
Not open for further replies.

robman70

Technical User
Aug 6, 2002
90
What is are the first things you have to do when you download apache to get it to execute .cgi or .pl scripts in a web browser..my httpd.conf file has:

<Directory &quot;C:/Program Files/Apache Group/Apache2/cgi-bin&quot;>
Options ExecCGI
AddHandler cgi-script .cgi .pl
AllowOverride None
Order allow,deny
Allow from all
</Directory>

and i did uncomment the AddHandler line that appears before this, i know its not a problem with perl on my pc, i use perl from the dos prompt all the time

the above and uncommenting the AddHandler line are the <u>only</u> things i have changed in the httpd.conf file...can anyone think of anything else i might need to do

my OS is win2000 and the error message is:
Server error!
Error message:
couldn't create child process: 22505: C:/Program Files/Apache Group/Apache2/cgi-bin/test.cgi
If you think this is a server error, please contact the webmaster
Error 500
localhost
08/08/02 12:04:22

Thanks...
 
Hi mate,

Remove the whole section that you have posted above and use the following:

<Directory &quot;C:/Program Files/Apache Group/Apache2/cgi-bin&quot;>
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

You do not have to specify ExecCGI or an AddHandler for the cgi-bin, this is the default directory used for scripts. Apache will try to execute any script that you call inside the cgi-bin.

ExecCGI and AddHandler are both used for scripts outside the cgi-bin directory.

Hope this helps Wullie

sales@freshlookdesign.co.uk

 
Thanks for the reply, i tried what you said, and it still is trying to make me download when i try to view printenv.pl and still gives me the msg:

Server error!
Error message:
couldn't create child process: 22505: C:/Program Files/Apache Group/Apache2/cgi-bin/test.cgi
If you think this is a server error, please contact the webmaster
Error 500

when i try to run test.cgi

all i have to do when putting a cgi into the cgi-bin is create it in a text editor, and save it to C:/Program Files/Apache Group/Apache2/cgi-bin, right?

any other ideas?
 
well the printenv.pl was put there when i installed apache, and the test.cgi contains:

#!/C:\Perl\bin\perl

print &quot;Content-type:text/html\n\n&quot;;

print &quot;Hello\n&quot;;

i tried changing the shebang line to:
#!/usr/bin/perl
#!/C:\Perl\bin\perl.exe
#!/C:\Perl\bin\perl5.6.1

but it gave me the same error with all of them, i would think that if printenv.pl was installed with apache that it wouldnt have any error, and thats the one that prompts me to download the file instead of showing it in IE
 
Hi mate,

Where is perl installed on your machine?

If you look at the C drive, you will see the directory that perl is in, after you find that out, the shebang line should be unix style unless you have the registry parsing the files.

So, if perl is located at C:\usr\bin\perl\perl.exe, you would use #!/usr/bin/perl as the shebang line.

Hope this helps Wullie

sales@freshlookdesign.co.uk

 
perl is at C:\Perl\bin\perl I tried using that as the shebang, i tried using #!/usr/bin/perl and i tried using #!/C:\Perl\bin\perl.exe as the shebang but none made any difference in the error message apache is giving me, which is why i think that its not having a problem locating perl, its having a problem knowing what to do with a .pl or .cgi file
 
Hi mate,

That was not what I said...

Because Perl is located at C:\Perl\bin\perl, then #!/usr/bin/perl is never going to work. The shebang line on Windows is Unix style unless you are using the registry to execute scripts.

Your shebang line should be #!/Perl/bin/perl

I am not saying that this is causing the error but there is no point going through loads of posibilities when this may fix it.

Hope this helps Wullie

sales@freshlookdesign.co.uk

 
hehe :D

that was the problem, everythings working beautifully now, thanks for all the help
 
I have the exact same problem as robman70, and changing the shebang line to #!/Perl/bin/perl
Didn't work. Any other ideas?
 
Same path... I figured it out- Internet Explorer bug... Works great in other browsers. Thanks anyhow!
X
 
Your shebang line should be #!/Perl/bin/perl"

Thank you Wullie, I finally found what the shebang line is on a Windows box. Everything ive read before said the absolute Windows path was the one to use and it has never worked. Now I can use AWSTATS on my site and get other cgi scripts running.

A very big thank you!

-Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top