All pastes #717408 Raw Edit

Unnamed

public text v1 · immutable
#717408 ·published 2007-09-27 16:41 UTC
rendered paste body
Having problems getting CGI scripts running from any area of apache.

Here's the conf file in use:
http://devel.canvas-photos.co.uk/httpd.conf

Here's the script:
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw(-debug);
my $cgi = CGI->new();
print $cgi->header();
print "Hello World!";


From SSH:
[root@localhost htdocs]# chmod 755 /home/peaksurveys/devel.canvas-photos.co.uk/user/htdocs/hello_world.cgi
[root@localhost htdocs]# perl -cw /home/peaksurveys/devel.canvas-photos.co.uk/user/htdocs/hello_world.cgi
/home/peaksurveys/devel.canvas-photos.co.uk/user/htdocs/hello_world.cgi syntax OK
[root@localhost htdocs]# perl /home/peaksurveys/devel.canvas-photos.co.uk/user/htdocs/hello_world.cgi
(offline mode: enter name=value pairs on standard input; press ^D or ^Z when done)
Content-Type: text/html; charset=ISO-8859-1

Hello World![root@localhost htdocs]# 
[root@localhost htdocs]# cd /home/peaksurveys/devel.canvas-photos.co.uk/user/htdocs/
[root@localhost htdocs]# perl -e hello_world.cgi
[root@localhost htdocs]# perl -cw hello_world.cgi
hello_world.cgi syntax OK
[root@localhost htdocs]#

Everything seems ok? 


Here's the URL to /home/peaksurveys/devel.canvas-photos.co.uk/user/htdocs/...

http://devel.canvas-photos.co.uk/hello_world.cgi


Internal Server Error

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

Please contact the server administrator, webmaster@devel.canvas-photos.co.uk 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.
Apache/2.0.52 (Red Hat) mod_perl/1.99_16 Perl/v5.8.5 DAV/2 PHP/4.3.9 mod_python/3.1.3 Python/2.3.4 mod_ssl/2.0.52 OpenSSL/0.9.7a Server at devel.canvas-photos.co.uk Port 80 


Same old story in error_log:
[Thu Sep 27 17:37:41 2007] [error] [client 81.86.45.98] Premature end of script headers: hello_world.cgi
[Thu Sep 27 17:19:01 2007] [error] [client 81.86.45.98] Premature end of script headers: hello_world.cgi
[Thu Sep 27 17:18:55 2007] [error] [client 81.86.45.98] Premature end of script headers: hello_world.cgi

That's what I get _all_ the time, unless I comment out LoadModule cgi_module ... from the conf to keep my sanity.. or delete the file to make sure I'm editing the right one.. etc.

I'm told I certainly am not experiencing \r\n problems (uploading from Windows to Unix and have now resorted to editing in VIM with some setting that converts characters. plus have tried plenty of other filters to remove any possibility of it being a \r\n issue)

the access_log seems normal, nothing to report


Please help!!