Problem with Suse Ent 9 apache2 and perl

I am having a problem with Suse Enterprise 9 with apache2 and perl. The error message from the error_logs is:

1) Logs
[error] [client 192.168.1.3] Premature end of script headers: hello.pl
[error] [client 192.168.1.3] (13)Permission denied: exec of '/home/www/fh/v2/Perl/hello.pl' failed

2) Script
hello.pl is a simple hello perl script:
#!/usr/bin/perl

print "Content-type: text/html\r\n\r\n\n";
print "<HTML>\n";
print "<HEAD><TITLE>Hello World!</TITLE></HEAD>\n";
print "<BODY>\n";
print "<H2>Hello World!</H2>\n";
print "</BODY>\n";
print "</HTML>\n";

exit (0);

3) The command perl -wc hello.pl reported syntax ok.
4) The command perl hello.pl looks fine and reports:
perl  /home/www/fbo/Perl/hello.pl
Content-type: text/html


<HTML>
<HEAD><TITLE>Hello World!</TITLE></HEAD>
<BODY>
<H2>Hello World!</H2>
</BODY>
</HTML>

5) May be the problem with my config. They are as below:
default-server.conf

NameVirtualHost 192.168.1.10:80

AddHandler cgi-script .cgi .pl

<Directory "/home/www/fbo/Perl">
        Options FollowSymLinks +ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>
<Directory "/home/www/fh/v2/Perl">
        Options FollowSymLinks +ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>
<VirtualHost 192.168.1.10:80>
    ServerAdmin admin@xx.com
    DocumentRoot /home/www/fh
    ServerName www.xx.com
    Options ExecCGI Includes FollowSymlinks
    DirectoryIndex index.php index.html index.htm
    ServerAlias xx.com

ScriptAlias /Perl "/home/www/fh/v2/Perl"
</VirtualHost>

6) /etc/apache2/conf.d/mod_perl.conf
<IfModule mod_perl.c>
    PerlRequire "/etc/apache2/mod_perl-startup.pl"

    ScriptAlias /Perl/ "/home/www/fh/v2/Perl"
    <Location /home/www/fh/v2/Perl/>
        # mod_perl mode
        SetHandler perl-script
        PerlResponseHandler ModPerl::Registry
        PerlOptions +ParseHeaders
        Options +ExecCGI +Indexes +FollowSymlinks
    </Location>
</IfModule>

Permission is already 777. Only thing to point out is /home/www is an nfs mount but shudnt ve permission problems. Another thing is 192.168.1.3 shown in logs is the load balancer while the server is 192.168.1.10. /home/www/fh/v2/Perl is a soft link to /home/www/fbo/Perl

What is the problem with my perl config?
pajiaoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

svsCommented:
Check that /usr/bin/perl itself is executable by apache process.
pajiaoAuthor Commented:
Yes it is. I mentioned that i already did a 'perl /path/hello.pl' and it reports well.
svsCommented:
Did you run it as root, or as unprivileged user (apache usually is configured to drop privileges -- see User and Group directives in httpd.conf)?
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

pajiaoAuthor Commented:
Suse default group is www and user is wwwrun. I ve thought of tat since i have permission denied in error_logs. Am i right to say if my script is 777 the user n group directives shudnt be a problem?
svsCommented:
The script itself is world-executable, but the perl binary it uses may be not.
svsCommented:
Other things to check:

- intermediate directories might be not readable by www:wwwrun
- if mod_perl is in use (it isn't clear whether it is), the perl binary is not used at all...
pajiaoAuthor Commented:
Running /home/www/fbo/Perl/hello.pl or /home/www/fh/v2/Perl/hello.pl gives me: -bash: /home/www/fbo/Perl/hello.pl: /usr/bin/perl: bad interpreter: Permission denied as opposed to running it with the perl binary (perl /home/www/fbo/Perl/hello.pl) which doesnt give me any problem.

What did u mean by intermediate directories?
pajiaoAuthor Commented:
By the way my nfs mount is: 192.168.1.9:/mnt/powervault/www2        /home/www       nfs     user 0 0
pajiaoAuthor Commented:
Another small progress made: added 'exec' on the export of my nfs server, did a mount -a on my www server and executing '/home/www/fbo/Perl/hello.pl' leaves me with 'Permission denied' only. Bad intepreter solved. Strangely Redhat/Fedora doesnt mind without 'exec'.
pajiaoAuthor Commented:
Solved! It is a freaking NFS and perl ascii format problem. Somehow NFS config ported from Redhat worked differently from Suse though it appeared fine. After i solved the NFS problems, tested the perl scripts and found 'No such file or directory' which prolly meant the format. I used dos2unix and change all their permissions to 755 and everything worked without the stability problems!
svsCommented:
Great :-)
CetusMODCommented:
PAQed with points refunded (500)

CetusMOD
Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.