LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache not detecting modules in CentOS 6.2 (https://www.linuxquestions.org/questions/linux-server-73/apache-not-detecting-modules-in-centos-6-2-a-944193/)

kayasaman 05-10-2012 04:18 AM

Apache not detecting modules in CentOS 6.2
 
Hi,

I've installed the EPEL repos on CentOS6.2 64bit and completed a:

Code:

yum update
on the system.

Everything worked fine until this morning when I did a restart of the httpd daemon.

uname -a:

Code:

Linux uk-vm-web-p2.rjis.co.uk 2.6.32-220.13.1.el6.x86_64 #1 SMP Tue Apr 17 23:56:34 BST 2012 x86_64 x86_64 x86_64 GNU/Linux

This is the initial error I got:

Code:

# service httpd start
Starting httpd: httpd: Syntax error on line 150 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_auth_basic.so into server: /etc/httpd/modules/mod_auth_basic.so: cannot open shared object file: No such file or directory
                                                          [FAILED]

This is my version of Apache:

Code:

# rpm -qa | grep httpd
httpd-tools-2.2.15-15.el6.centos.1.x86_64
httpd-2.2.15-15.el6.centos.1.x86_64

Since I couldn't find out how to set the 'modules' directory in the Apache config file I decided to symlink the modules folder from:

Code:

ln -s /usr/lib64/httpd/modules /etc/httpd/
Now my error is as such:

Code:

# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: httpd: Syntax error on line 150 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_auth_basic.so into server: /etc/httpd/modules/mod_auth_basic.so: wrong ELF class: ELFCLASS32
                                                          [FAILED]

The logs show nothing of what is going on!

Error_log:

Code:

[Wed May 09 15:17:59 2012] [notice] ModSecurity for Apache/2.5.12 (http://www.modsecurity.org/) configured.
[Wed May 09 15:17:59 2012] [notice] Digest: generating secret for digest authentication ...
[Wed May 09 15:17:59 2012] [notice] Digest: done
[Wed May 09 15:18:00 2012] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations
[Wed May 09 15:46:44 2012] [notice] caught SIGTERM, shutting down
[Wed May 09 15:46:45 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed May 09 15:46:46 2012] [notice] ModSecurity for Apache/2.5.12 (http://www.modsecurity.org/) configured.
[Wed May 09 15:46:46 2012] [notice] Digest: generating secret for digest authentication ...
[Wed May 09 15:46:46 2012] [notice] Digest: done
[Wed May 09 15:46:47 2012] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations
[Thu May 10 09:08:39 2012] [notice] caught SIGTERM, shutting down


Could anyone give me a hand fixing this and hopefully getting Apache started?


Many thanks.

kirukan 05-10-2012 05:08 AM

Check whether the module is exist on the following location /etc/httpd/modules

kayasaman 05-10-2012 07:20 AM

The module is there... hence the error that was coming up after I symlinked the folder.

To start with Apache shouldn't be using the path /etc/httpd/modules for it's module .so files.... the reason is that no folder through yum is created at that level.


There are however, modules within /usr/lib64/httpd/modules which were created automatically.


Something's off and I'm not sure where the issue is.


I can post my httpd.conf file if needed though no changes have been made to it??

bathory 05-10-2012 12:59 PM

Hi,

How did you install httpd? Because the symlink should have been created when you installed apache.
Quote:

Stopping httpd: [FAILED]
Starting httpd: httpd: Syntax error on line 150 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_auth_basic.so into server: /etc/httpd/modules/mod_auth_basic.so: wrong ELF class: ELFCLASS32
[FAILED]
From the error above looks like that at least mod_auth_basic.so is a 32bit binary and not a 64bit as your apache. What gives:
Code:

file /etc/httpd/modules/mod_auth_basic.so

lithos 05-10-2012 01:24 PM

It's a problem between the EPEL repo which you upgraded your server and Apache version from CentOS base repo,

unfortunately you 'broke' it.
In my opinion you can try to update Apache also from EPEL, otherwise I don't know how to match Apache and other libraries from EPEL.

kayasaman 05-11-2012 04:31 AM

Thanks for the info.


I reinstalled the whole server and just used the CentOS repos for httpd... now it's working :)


Unfortunately security enhancements like mod_security and fail2ban aren't available and if I put in another repo I'm guessing it would break the system. So what's the best way to go through with this?

lithos 05-11-2012 06:20 AM

You need

yum priorities
- centos package management
- yum configuration
- priorities and RPMForge

Basically learn about yum priorities to NOT break the system.

Good luck


All times are GMT -5. The time now is 03:58 AM.