Page 1 of 1

Apache help.

Posted: 2015/02/10 20:12:37
by pauldoc99
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.

Re: Apache help.

Posted: 2015/02/11 01:58:33
by gerald_clark
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.

Re: Apache help.

Posted: 2015/02/11 08:58:36
by TrevorH
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

Re: Apache help.

Posted: 2015/02/11 17:01:54
by pauldoc99
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.

Re: Apache help.

Posted: 2015/02/11 18:31:41
by TrevorH
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

Re: Apache help.

Posted: 2015/02/11 18:58:15
by AlanBartlett
CentOS 5.11 is the current, supported version.

Re: Apache help.

Posted: 2015/02/11 19:12:28
by aks
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.

Re: Apache help.

Posted: 2015/02/12 21:13:30
by pauldoc99
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.