The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

httpd or mysql problem?

Discussion in 'General Discussion' started by PattyO, May 6, 2012.

  1. PattyO

    PattyO Member

    Joined:
    May 6, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hello all. My first time here. :)

    I'm completely new to server management and trying to learn mostly with the help of my good friend Mr. Google. But I'm stuck with this problem for days already and don't know what else to do.

    Last weekend my client's server had a serious hardware problem and had motherboard and HD replaced. After that I had to copy all data from the old HD to the next one. Mr. Google helped me here, since support wanted to charge me US$ 60 for it, and I knew that I'd end up doing everything myself anyway.

    I did OK, I guess, for a first timer. But the next morning all sites were down, although the server was running. I restarted Apache and everything went back to normal. Unfortunately for few hours only. So the whole week sites are going offline every few hours and I need to restart Apache over and over again every few hours or so. I tried using a cronjob to have Apache restarted every 30 minutes but it's not working, for Apache is on now for over 2 hours already. I also know this is not the solution to the problem, but at least it would keep the sites on during the night while I try to get some sleep.

    This is the cronjob: */30 * * * * /etc/init.d/httpd restart >/dell/null 2>&1

    Server is not overloading before sites go off or at any other time as a matter of fact. It seems to be running pretty smoothly actually, except for that.

    I also checked my.cnf and was puzzled to find nothing there. So I copied the settings from a similar server I have at another DC (this one managed by them, thank God!) and restarted mysql.

    Since I'm new to all this, I have no idea where to start looking and the host support won't help with that since it's not hardware or power but software related.

    So can someone point me to the right direction or maybe give a hand and guide me thru this?
    I really appreciate any help I can get. :)

    Tks in advance, guys.

    Patty
     
    #1 PattyO, May 6, 2012
    Last edited: May 6, 2012
  2. PattyO

    PattyO Member

    Joined:
    May 6, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    I think I've found what's causing the problem:

    I did noticed a lot of those "G" on Apache Status:

    And so on.

    So I'm trying to revert Apache to 2.0 and compiling it right now. Let's see if it works.

    I'd appreciate if someone from cPanel could comment on that.
     
  3. PattyO

    PattyO Member

    Joined:
    May 6, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    I think I'm finding my way by myself, so I'll post here my findings, maybe it can help others in a similar situation.

    In my case, I found out that one of the causes of the issue is a known Apache bug:
    Known Issues (Bug: Apache 2.2 Child Processes in “G” Status)

    So I followed cPanel suggestions and compiled Apache back to v2.0. "G"s are now gone! So that helped a lot.

    But I still noticed a lot of "C"s on the Apache log, caused by the same script used by one of the accounts. Bingo! Client has been notified to optimize his script in order to properly close connections.

    I'm hoping this is is, but I'll keep monitoring the server and will update this thread.
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    What PHP handler are you using and is it the same one you had on the old machine? You can see the handler in WHM > Apache Configuration > PHP and SuExec Configuration area or by running the following in SSH as root user:

    Code:
    /usr/local/cpanel/bin/rebuild_phpconf --current
    Thanks!
     
  5. PattyO

    PattyO Member

    Joined:
    May 6, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hello, Tristan.
    Tks for your reply.

    This is it:

    Option Configured Value
    Default PHP Version (.php files) 5
    PHP 5 Handler suphp
    PHP 4 Handler suphp

    Apache suEXEC on
    Apache Ruid2 off


    And yes, it's the same configuration on the old drive.

    Even after recompiling Apache back to v2.0, the "G"s keep coming back. Problem persists. I really don't know what to do about that.

    Any clues?

    TIA
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
  7. PattyO

    PattyO Member

    Joined:
    May 6, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Tks for your reply, Tristan.

    Yeah, I have checked that thread before and it was very helpful indeed. But it's not a DDOS attack, thank God. The problem is indeed with that script in that domain, that is not closing the connections, as far as I understood.

    The funny thing is it's the same script used before the drive replacement and it didn't cause that problem before. Could this be caused by any configuration on the server after the drive replacement?
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    So, when you state it isn't a DoS, you've checked when the issue happens and ran the commands noted, including checking MaxClients isn't erroring or a high number of SYN_RECV entries in netstat? If you haven't checked using the actual commands (all of them indicated that check for various types of attack), can you please run them regardless of what you believe is the issue. If the script were being attacked, it would show a high number of connections that won't close, because those type of connections purposely are maintained due to being an attack on the script. It would appear the script or site is the issue in that type of event, but it would be IPs purposely trying to bring down the server by hitting the site or script. That's what a DoS does.
     
  9. PattyO

    PattyO Member

    Joined:
    May 6, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hi, Tristan.

    Yeah, I have run them all even before you suggested and the results didn't indicated a DoS as far as I could tell.
    In any case, client moved the account to another server outside our network so now there's nothing else I can do. :(
    Pitty, because I really wanted to get to the bottom of this.

    Anyway, tks for your time and efforts. :)
     
Loading...

Share This Page