Re: error trying to start httpd with mod_perl enabled
Andy Osborne <[email protected]> Fri, 27 Oct 2023 17:31:44 +0100
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <[email protected]> |
Rocky has SELinux on by default I think. Could be that getting in the way ?
What does "getenforce" say ?
Andy
On 27/10/2023 13:54, Johnson, Bruce E - (bjohnson) wrote:
> I’m setting up a new server to replace one that is currently running fine (I am changing the database for my app from oracle to
> Postgres and need to test this before doing the switchover.)
>
> I’ve looked at the apache settings on both systems, file permissions, etc and they look the same, but httpd fails at startup with
> the following error:
>
>
> [Thu Oct 26 16:11:46.962322 2023] [perl:error] [pid 96852:tid 96852] Can't locate /home/allwebfiles/perl/startup.pl:
> /home/allwebfiles/perl/startup.pl: Permission denied at (eval 2) line 1.\n
> [Thu Oct 26 16:11:46.962564 2023] [perl:error] [pid 96852:tid 96852] Can't load Perl file: /home/allwebfiles/perl/startup.pl for
> server dhbroomscheduling4.pharmacy.arizona.edu <http://dhbroomscheduling4.pharmacy.arizona.edu>:0, exiting..
>
> The file permissions are correct
>
> ls -l /home/allwebfiles/perl/startup.pl
> -rwxr-xr-x. 1 webworker apache 515 Oct 26 16:11 /home/allwebfiles/perl/startup.pl
>
> The contents of startup.pl seem to be correct (the only change was the dbd line in the DBI startup.)
>
> #!/usr/bin/perl
> use lib qw(/usr/lib64/perl5 /usr/share/perl5 /usr/local/lib64/perl5 /home/allwebfiles/perl/LocalModules
> /usr/lib64/perl5/vendor_perl/Bundle);
>
> use Apache::DBI;
> Apache::DBI->connect_on_init ("dbi:Pg:host=redacted;port=5432", “xxxxxxx", “xxxxxxx", {
> PrintError => 1, # warn() on errors
> RaiseError => 0, # don't die on error
> AutoCommit => 1, # commit executes immediately
> }
> );
> use CleanCGI ();
> use CGI ();
> CGI->compile(':all');
>
>
> use DBI ();
> use Apache2;
> 1;
>
>
> This is the correct location of perl, and all the use lib locations are correct
>
> which perl
> /usr/bin/perl
>
>
> System:
>
> cat /etc/redhat-release
> Rocky Linux release 9.2 (Blue Onyx)
>
> perl -v
>
> This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-thread-multi
> (with 52 registered patches, see perl -V for more detail)
>
> httpd -v
> Server version: Apache/2.4.53 (Rocky Linux)
> Server built: Apr 28 2023 00:00:00
>
> (And yes mod_perl is installed )
>
> The working system is an older distro of Rocky Linux 8.5, but otherwise all is identical, with the exceptions I”m connecy=ting to
> Oracle on it not Postgres.
>
> (I can connect and query the database using a script on the command line on the new system so I know all of that works)
>
> --
> Bruce Johnson
> University of Arizona
> College of Pharmacy
> Information Technology Group
>
> Institutions do not have opinions, merely customs
>
--
Andy Osborne - Technical Director
Conscious Solutions, Royal London Buildings, Baldwin St. Bristol BS1 1PN
UK Co. Reg No. 4966976 VAT No. 826 2638 21https://www.conscious.co.uk/
tel:01173250200 ddi:01173250204https://www.linkedin.com/in/andyosborne