Avatar of Victor Kimura
Victor Kimura
Flag for Canada asked on

can't start apache in centos 5.x

Hi,

I can't start apache on my centos 5.x Here's the error I receive:
[root@seokingdomheaven vkimura]# /etc/init.d/httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: httpd: Syntax error on line 187 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_rewrite.so into server: /etc/httpd/modules/mod_rewrite.so: undefined symbol: ap_get_server_banner
                                                       
LinuxUnix OSApache Web Server

Avatar of undefined
Last Comment
Victor Kimura

8/22/2022 - Mon
darren-w-

are you sure you have super user access?
darren-w-

Looking at your error again, it looks like mod_rewrite.so has an error, has it been modified recently?
Victor Kimura

ASKER
No, mod_rewrite.so hasn't been modified.

I have su access. It's at root with these commands.

I think the problem lies in that when I compiled apache I didn't use the default centos install paths. It was based on a one of the recommendations of an expert here. I think that's why but how do I figure this out?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
balasundaram_s

Did you upgrade Apache?  What version of Apache running?  
Is this first time, Apache being compiled and made run on this server?

'ap_get_server_banner" is not available until httpd version 2.2.4.


Victor Kimura

ASKER
[root@seokingdomheaven vkimura]# httpd -v
Server version: Apache/2.2.3
Server built:   Nov 12 2009 18:43:41

This is where httpd is located:
[root@seokingdomheaven vkimura]# which httpd
/usr/sbin/httpd
balasundaram_s

Is it possible to upgrade to 2.2.4?  
I dont have any other option to resolve this issue, except upgrade.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Victor Kimura

ASKER
Do you know if /usr/sbin/httpd is the default location?

How do I upgrade to 2.2.4? What are the commands? Sorry, newbie questions but I don't use my centos often. I forget the commands.
darren-w-

yum update mysql-server
Victor Kimura

ASKER
httpd restart is still failing. Any ideas?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Victor Kimura

ASKER
How can I upgrade from 2.2.3. to 2.2.4? I don't know if that will resolve the problem though.
SOLUTION
balasundaram_s

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Victor Kimura

ASKER
I can't find:
3.    Download httpd-2.2.4-4.x86_64.rpm from http://rpmfind.net/
4.    Download httpd-devel-2.2.4-4.x86_64.rpm from http://rpmfind.net/
5.    Download lib64db4.5-4.5.20-1mdv2007.1.x86_64.rpm http://rpmfind.net/
6.    Install lib64db4.5-4.5.20-1mdv2007.1.x86_64.rpm

on
http://rpmfind.net/linux/rpm2html/search.php?query=apache&submit=Search+...&system=&arch=

I tried searching by 'apache' and 'httpd' but I can't find them. I tried even searching for them via google but still no luck. I'd like to try and avoid compiling for time's sake. Aren't there dependencies that I may miss if I compile from source?

If you have a direct page that would so helpful to me. =)
darren-w-

Hi,

Can I assume that you have tried running "sudo yum update mysql-server" on the command line? In order to get the system to automatically upgrade the apache?

Darren
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Victor Kimura

ASKER
Hi darren-w,

I tried that. I still can't restart httpd.
[root@seokingdomheaven vkimura]# /etc/init.d/httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: httpd: Syntax error on line 187 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_rewrite.so into server: /etc/httpd/modules/mod_rewrite.so: undefined symbol: ap_get_server_banner
                                                           [FAILED]
[root@seokingdomheaven vkimura]#

That didn't update apache:
[root@seokingdomheaven vkimura]# httpd -v
Server version: Apache/2.2.3
Server built:   Nov 12 2009 18:43:41

Do you know where I can find the latest rpm for httpd?
SimonDard

To summarize, you downloaded the source code of Apache, compiled it, installed it and now (re)starting Apache ends prematurely in an error stating there's something wrong with mod_rewrite.so

Apparently, the newer compiled Apache is trying to load a version of mod_rewrite.so which is incompatible with it. I can think of 2 causes:
1. During compiling mod_rewrite was not built and therefore not replaced. Soluation: when configuring Apache before compiling (./configure before make), you need to add the right flag for adding mod_rewrite (and any other mod for that mather).
2. mod_rewrite was built, but got placed in another location. Solution: use (s)locate to scan your drive(s) for mod_rewrite and replace the failing mod_rewrite with the newer one.

SOLUTION
darren-w-

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Victor Kimura

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Victor Kimura

ASKER
Thank you all for your help.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck