Results 1 to 5 of 5

Thread: Need urgent help: httpd.conf broken

  1. #1
    Member
    Join Date
    May 2006
    Posts
    52

    Default Need urgent help: httpd.conf broken

    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. #2
    Member
    Join Date
    May 2006
    Posts
    52

    Default

    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. #3
    Member
    Join Date
    May 2006
    Posts
    52

    Default

    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. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,496

    Default

    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.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  5. #5
    Member
    Join Date
    May 2006
    Posts
    52

    Default

    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.

Similar Threads

  1. Faulty httpd.conf - can't rebuild with rebuildhttpd.conf
    By movielad in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 03-21-2011, 12:43 PM
  2. Preserve amends to /etc/httpd/conf/httpd.conf ?
    By robocrop in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 08-14-2010, 02:08 AM
  3. httpd.conf sites/www.domain.com.conf Wildcard DNS
    By ttremain in forum cPanel & WHM Discussions
    Replies: 6
    Last Post: 12-16-2008, 11:19 AM
  4. Daily httpd restart changes AllowOverride None to All in httpd.conf
    By Lasers in forum cPanel & WHM Discussions
    Replies: 7
    Last Post: 02-26-2007, 12:17 PM
  5. Very Urgent ! Help Pls.. Removed Httpd.conf
    By UndeaD in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 01-28-2006, 03:23 PM