I'm configuring Apache 1.3.14 with Mod Perl 1.24_01 and PHP 4.0.3pl1, and I 
got a problem in which when Apache wants to run a perl script (for PHP 
script there is no problem), for example for this script

[root@is cgi-bin]# cat hello.cgi
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
#
#   Simple "hello, world" program to demonstrate basic
#       CGI output.
#

# Print the CGI response header, required for all HTML output
# Note the extra \n, to send the blank line
print "Content-type: text/html\n\n" ;

# Print the HTML response page to STDOUT
print <<EOF ;
<<html>
<<head><title>CGI Results</title></head>
<<body>
<<center><h1>Hello, world (in Perl).</h1></center>
<<center><h5>Written by me</h5></center>
<</body>
<</html>
EOF

[I add < in front of the tag, to make it won't be considered as HTML mail]

Then, when I accessed the script, Apache would give output

500 Internal Server Error

The server encountered an internal error or misconfiguration and was unable 
to complete your request.

Please contact the server administrator, root@localhost and inform them of 
the time the error occurred, and anything you might have done that may have 
caused
the error.

More information about this error may be available in the server error log.

And in the error log it says :


failed to open log file
fopen: Is a directory
[Fri Dec 22 03:48:35 2000] [error] [client 127.0.0.1] Premature end of 
script headers: /home/me/public_html/cgi-bin/hello.cgi

But, if I add this one in Apache Configuration

<IfModule mod_perl.c>
#  Alias /perl/ /home/httpd/perl/
#  <Location /perl>
     SetHandler perl-script
     PerlHandler Apache::Registry
     Options +ExecCGI
#  </Location>
</IfModule>

Then the script will work, although not 100% correct, because it will show :

Content-type: text/html

<<html>
<<head><title>CGI Results</title></head>
<<body>
<<center><h1>Hello, world (in Perl).</h1></center>
<<center><h5>Written by me</h5></center>
<</body>
<</html>

In which, actually the line

Content-type: text/html

should not be there

And also the problem if I add this line in httpd.conf
<IfModule mod_perl.c>
#  Alias /perl/ /home/httpd/perl/
#  <Location /perl>
     SetHandler perl-script
     PerlHandler Apache::Registry
     Options +ExecCGI
#  </Location>
</IfModule>

, then if I can access http://localhost/~me/index.html before, now it will 
show Forbidden


Is there any clue to fix this problem ?

this is the result of ./httpd -l

[root@is bin]# ./httpd -l
Compiled-in modules:
   http_core.c
   mod_vhost_alias.c
   mod_env.c
   mod_log_config.c
   mod_mime_magic.c
   mod_mime.c
   mod_negotiation.c
   mod_status.c
   mod_info.c
   mod_include.c
   mod_autoindex.c
   mod_dir.c
   mod_cgi.c
   mod_asis.c
   mod_imap.c
   mod_actions.c
   mod_speling.c
   mod_userdir.c
   mod_alias.c
   mod_rewrite.c
   mod_access.c
   mod_auth.c
   mod_auth_anon.c
   mod_auth_dbm.c
   mod_digest.c
   mod_proxy.c
   mod_cern_meta.c
   mod_expires.c
   mod_headers.c
   mod_usertrack.c
   mod_unique_id.c
   mod_setenvif.c
   mod_php4.c
   mod_perl.c
suexec: enabled; valid wrapper /etc/httpd/bin/suexec

Thanks



Reply via email to