Apache help.

Support for webhosts that use CentOS
pauldoc99
Posts: 7
Joined: 2012/05/08 21:17:06

Apache help.

Postby pauldoc99 » 2015/02/10 20:12:37

Thanks in advance, I'm stumped.
I have a server that after reboot, apache starts throwing out "cannot open shared object file: no such file or directory". It is looking for a perl library, that is there. Here is where it gets weird. Logging in as the root user, I can see and access the file and LDD shows the correct path. I can also see and use the file fine as the "order" user which apache uses.
I can make this error go away by stopping and starting apache using apachectl stop/start.
If I use service httpd restart, or stop/start, or apachectl restart, the error comes back.
Why? It's driving me nuts. I believe it has something to do with suexec, but I'm not sure.

Ultimately, I need to get apache to start and work correctly after a reboot.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Apache help.

Postby gerald_clark » 2015/02/11 01:58:33

What control panel are you using?
You have not identified which version of httpd and perl you are using, nor what file cannot be opened.

User avatar
TrevorH
Forum Moderator
Posts: 21718
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Apache help.

Postby TrevorH » 2015/02/11 08:58:36

The symptoms you describe are most likely caused by a mislabeled file with the wrong selinux context. Things started by the initscripts are given a different selinux context than things started using the command line version and they can be denied access to the same things that a command line session would be allowed access to.

Post the output of ls -aZ /path/to/the/shared/object/in/question.so
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

pauldoc99
Posts: 7
Joined: 2012/05/08 21:17:06

Re: Apache help.

Postby pauldoc99 » 2015/02/11 17:01:54

Thanks Trevor. Selinux is disabled. Would this still apply? Here is the error:

[2015/02/09 13:23:10] [error] Store: XXXY_LIVE 16f86cdc3e3119153fb165ac0a8deb36461f3f3f 35bf225e451e348b37aa5de1814b547293f2a8a2 Unexpected error 17898
<!--Trace begun at /var/www/order.xxxxx.com/cgi-bin/store.cgi line 31
eval {...} at /var/www/order.xxxxx.com/cgi-bin/store.cgi line 29
ModPerl::ROOT::ModPerl::Registry::var_www_order_2eron_2ecom_cgi_2dbin_store_2ecgi::__ANON__('Can\'t load \'/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Sybase/Sybase.so\' for module DBD::Sybase: libct.so: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.^J at (eval 224) line 2^JCompilation failed in require at (eval 224) line 2.^JBEGIN failed--compilation aborted at (eval 224) line 2.^J') called at (eval 224) line 2
eval 'use DBD::Sybase

And here is the output from the ls -aZ

[root@stack1-store ~]# ls -aZ /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Sybase/Sybase.so
-r-xr-xr-x root root /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Sybase/Sybase.so

[root@stack1-store ~]# ls -aZ /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm
-rw-r--r-- root root /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm

[root@stack1-store ~]# ls -aZ /opt/sybase-12.5/OCS-12_5/lib/libct.so
-rwxr-xr-x root root /opt/sybase-12.5/OCS-12_5/lib/libct.so

root@stack1-store ~]# httpd -v
Server version: Apache/2.2.3
Server built: Oct 16 2013 12:22:17

Centos 5.2
Perl 5.8.8

Thanks again.

User avatar
TrevorH
Forum Moderator
Posts: 21718
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Apache help.

Postby TrevorH » 2015/02/11 18:31:41

If selinux is disabled then my theory is wrong.

You should not be running CentOS 5.2. It's ancient, riddled with security bugs and badly in need of a yum update
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
AlanBartlett
Forum Moderator
Posts: 9311
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Apache help.

Postby AlanBartlett » 2015/02/11 18:58:15

CentOS 5.11 is the current, supported version.
Image 100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

aks
Posts: 2500
Joined: 2014/09/20 11:22:14

Re: Apache help.

Postby aks » 2015/02/11 19:12:28

Just a few suggestions:
1) Stop disabling SELinux - it's actually there to help.
2) Perhaps it would be wise to su in as the user that runs Apache. I can't remember on CentOS 5, but I think the entry in /etc/passwd is (something like) /sbin/nologin. Change that to /bin/bash so you can login and try and read the file. In some cases it could be that the permissions are blocking it higher up in the tree.
3) Confirm that the file is correct - that it's not corrupted and is of the right class (32 vs 64 bit) for the rest of the system. I guess the easiest way is to start perl and try and use the module.

pauldoc99
Posts: 7
Joined: 2012/05/08 21:17:06

Re: Apache help.

Postby pauldoc99 » 2015/02/12 21:13:30

I know! I've only been here 6 months...Believe me I'm trying to upgrade these systems as quickly as possible. We still have 4 systems on CentOS 4. It's a disaster and I'm just barely treading water.

I only discovered this issue because I rebooted after patching for ghost.

Long story short, can't upgrade right now, but trying to automate/fix known issues as I go.

Thanks for the suggestions.