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] Premature end of script headers:
[error] [client] (13)Permission denied: exec of '/home/www/fh/v2/Perl/' failed

2) Script is a simple hello perl script:

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 reported syntax ok.
4) The command perl looks fine and reports:
perl  /home/www/fbo/Perl/
Content-type: text/html

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

5) May be the problem with my config. They are as below:


AddHandler cgi-script .cgi .pl

<Directory "/home/www/fbo/Perl">
        Options FollowSymLinks +ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
<Directory "/home/www/fh/v2/Perl">
        Options FollowSymLinks +ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
    DocumentRoot /home/www/fh
    Options ExecCGI Includes FollowSymlinks
    DirectoryIndex index.php index.html index.htm

ScriptAlias /Perl "/home/www/fh/v2/Perl"

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

    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

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

What is the problem with my perl config?
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.

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/' and it reports well.
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?
The script itself is world-executable, but the perl binary it uses may be not.
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/ or /home/www/fh/v2/Perl/ gives me: -bash: /home/www/fbo/Perl/ /usr/bin/perl: bad interpreter: Permission denied as opposed to running it with the perl binary (perl /home/www/fbo/Perl/ which doesnt give me any problem.

What did u mean by intermediate directories?
pajiaoAuthor Commented:
By the way my nfs mount is:        /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/' 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!
Great :-)
PAQed with points refunded (500)

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.