Click here to get back home

Problems with Apache 2.0, mod_perl2 and perl

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Problems with Apache 2.0, mod_perl2 and perl Eric R. Meyers 05-31-2006
Get Chitika Premium
Posted by Eric R. Meyers on May 31, 2006, 3:48 pm
Please log in for more thread options


I'm using FC4 Linux, and I'm having some problems with Apache 2.0.

perl 5.8.8

httpd 2.0.54-10.3

mod_perl 2.0.1-1.fc4

1. If I add the load mod_perl in the perl.conf, the service httpd start
dies.

a) Nothing about the death of httpd in the error_log.

2. I can only get a statically linked perl to run.

a) /usr/bin/perl: error while loading shared libraries: libperl.so:
cannot open shared object file: Permission denied

3. When I try to run a simple CGI.pm program under Apache, with the static
perl, the perl can't find CGI.pm in the @INC paths. Of course, the
script works just fine from the command line.

a) The @INC is correct as shown in the error_log, and CGI.pm didn't
relocate.

Anybody got a clue?

Thanks,

Eric

Posted by John Bokma on May 31, 2006, 4:03 pm
Please log in for more thread options



> 3. When I try to run a simple CGI.pm program under Apache, with the
> static
> perl, the perl can't find CGI.pm in the @INC paths. Of course, the
> script works just fine from the command line.
>
> a) The @INC is correct as shown in the error_log, and CGI.pm
> didn't
> relocate.
>
> Anybody got a clue?

Is perl allowed to access the CGI.pm file?

Try a simple CGI script that does something like:

print "Content-type: text/plain\n\n";

unless ( open my $fh, "/path/to/CGI.pm" ) {

        print "Can't open CGI.pm for reading: $!\n";
        exit;
}

print "Could open CGI.pm for reading\n";

I guess you'll get the Can't one.

--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/

Posted by Eric R. Meyers on May 31, 2006, 4:28 pm
Please log in for more thread options


John Bokma wrote:

> print "Content-type: text/plain\n\n";
>
> unless ( open my $fh, "/path/to/CGI.pm" ) {
>
> print "Can't open CGI.pm for reading: $!\n";
> exit;
> }
>
> print "Could open CGI.pm for reading\n";
>

# cat ./helloworld.cgi
#!/usr/bin/perl_static -wT
##

#require CGI::Lite;

print "Content-type: text/html\n\n";
#print "Hello, World.";

unless ( open my $fh, "/usr/lib/perl5/5.8.8/CGI.pm" ) {

print "Can't open CGI.pm for reading: $!\n";
exit;
}

print "Could open CGI.pm for reading\n";

# ./helloworld.cgi
Content-type: text/html

Could open CGI.pm for reading

http://localhost/cgi-bin/helloworld.cgi
Can't open CGI.pm for reading: 13


Posted by John Bokma on May 31, 2006, 4:36 pm
Please log in for more thread options



> http://localhost/cgi-bin/helloworld.cgi
> Can't open CGI.pm for reading: 13

Yup, so in short: your CGI script is running as a user who has no
permission to read CGI.pm which means that perl can't open the module to
use it.

--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/

Posted by Eric R. Meyers on May 31, 2006, 4:51 pm
Please log in for more thread options


John Bokma wrote:

>
>> http://localhost/cgi-bin/helloworld.cgi
>> Can't open CGI.pm for reading: 13
>
> Yup, so in short: your CGI script is running as a user who has no
> permission to read CGI.pm which means that perl can't open the module to
> use it.
>

In httpd.conf both User and Group are apache by default, and I changed it to
root, nobody, ermeyers, and nothing seemed to matter. Nice problem huh?


Similar ThreadsPosted
install Apache::Request problems. July 21, 2004, 8:54 pm
CGI.pm/modperl2 and intermittent missing POST data July 15, 2006, 3:18 am
Apache htaccess and perl August 5, 2006, 1:39 pm
starting apache with mod_perl, error on Apache.pm July 21, 2004, 5:34 pm
Perl DBI Oracle Problem with Apache 2.0.46 January 19, 2005, 2:29 am
http://perl.apache.org/ awhile or forever? July 15, 2007, 5:27 pm
Perl module for cookie/logon/session management with Apache May 10, 2007, 12:40 pm
Is it possible to use a custom perl binary inside a prebuilt apache/mod_perl environment? April 24, 2007, 5:15 pm
problems using Net::SSH::Perl in a while loop April 29, 2005, 10:09 am
Re: Re: problems using Net::SSH::Perl in a while loop April 29, 2005, 1:45 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap