Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Need urgent help: httpd.conf broken

Discussion in 'General Discussion' started by Echelon17, Jul 20, 2006.

  1. Echelon17

    Echelon17 Well-Known Member

    Joined:
    May 21, 2006
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    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?
     
  2. Echelon17

    Echelon17 Well-Known Member

    Joined:
    May 21, 2006
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    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.
     
  3. Echelon17

    Echelon17 Well-Known Member

    Joined:
    May 21, 2006
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    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?
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,470
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Echelon17

    Echelon17 Well-Known Member

    Joined:
    May 21, 2006
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    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.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice