Need urgent help: httpd.conf broken

Echelon17

Well-Known Member
May 21, 2006
73
0
156
Hi guys,

I woke up today to find some seriously weird problems with our apache conf. It fails to start due to errors, but we have so many errors/domains that I've been attempting to fix them manually but now i'm unable to. Complaining about needing 2 </ifModule> directives at the end, for a start, given there are thousands of domains in the conf it's impossible for me to locate the rogue entries.

Is there a script that will rebuild the entire httpd.conf file scratch for cleanliness?
 

Echelon17

Well-Known Member
May 21, 2006
73
0
156
Hmm ok

I ran /scripts/rebuildhttpdconf before, but it only seems to compare and execute against the existing file. I had to delete the old conf file first.

Solved now, d'oh.
 

Echelon17

Well-Known Member
May 21, 2006
73
0
156
No, OK, I still need help.

I ran /scripts/rebuildhttpdconf but it didn't actually create a conf file, just putput everything to screen.

I looked at the code and it seems that it doesn't actually write anything, it just prints it to the screen - for what purpose?
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,465
30
473
Go on, have a guess
To use that script, you have to:

cd /usr/local/apache/conf
mv httpd.conf httpd.conf.borked
cp httpd.conf.default httpd.conf
/scripts/rebuildhttpdconf >> httpd.conf


Then do the commands the script suggests. After you've done this, it's probably a good idea to run easyapache through your prefered method and rebuild apache and php.

Alternatively, look in that same directory for a nearly new httpd.conf that you could use before you got the corruption.
 

Echelon17

Well-Known Member
May 21, 2006
73
0
156
Hi Chirpy,

Thanks for the response. Because of the lack of info in regards to the rebuild script, I decided to create my own perl script to automatically create the conf again based on the Cpanel users file.

Was a good idea, there were quite a few errors in the previous conf (sites that shouldn't be there, invalid domains, etc) so it was a nice refresh ;)

Thanks for the info though, could use it next time.