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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Apache not recognizing servername randomly

Discussion in 'EasyApache' started by elmister, May 25, 2017.

  1. elmister

    elmister Active Member

    Joined:
    Mar 2, 2004
    Messages:
    34
    Likes Received:
    1
    Trophy Points:
    158
    Server is using
    • cPanel & WHM 64.0 (build 24)

    Easy apache 4, and apache 2.4.25-9.9.5

    A new account has been created, loading any page in the domain randomly goes to default page, even a .txt file to discard script problem.

    Tested with firefox and wget, sometimes the right page is server, sometimes it goes to default htdocs.

    When it goes to htdocs/ the request is logged in the common access_log /var/log/access_log

    with tcpdump i've captured the traffic, all requests contain the same Host: www.domain.com header correctly.

    At this time i think the cPanel provided version of Apache is not correctly parsing the Host header and it seems to happen randomly.

    httpd.conf has been checked, i see nothing strange in virtualhost definition, but if the virtualhost configuration was to blame, it should serve or fail always, not randomly, also httpd.conf was rebuild using /scripts/rebuildhttpdconf with no change in this strange behaviour

    Any help would be appreciated.
     
    #1 elmister, May 25, 2017
    Last edited by a moderator: May 25, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You may want to use a website such as IntoDNS.com to verify the name servers are properly configured for this domain name, and that it's resolving to the same IP address it's assigned on the cPanel server. Also, could you verify if this system uses a NAT configuration?

    Thank you.
     
  3. elmister

    elmister Active Member

    Joined:
    Mar 2, 2004
    Messages:
    34
    Likes Received:
    1
    Trophy Points:
    158
    It's not a DNS issue, DNS servers were changed 2 months ago by webmaster, but all my accesses were done using wget -S and all were done to my server

    i did tcpdump from inside the server so the answers were captured inside, showing it that the server sent different answer for the same request.

    The system is not behind a NAT, the answer with default page didn't came from a different server (again, tcpdump captured traffic in the server, not in the client)

    I've opened Ticket 8517317
     
    #3 elmister, May 25, 2017
    Last edited: May 25, 2017
  4. elmister

    elmister Active Member

    Joined:
    Mar 2, 2004
    Messages:
    34
    Likes Received:
    1
    Trophy Points:
    158
    Solved

    In case someone is interested, there was 2 httpd processes running as root, it seems the restart didn't kill the old process before adding the domain and the requests were being served by the old and the new process randomly, the new process had the domain configured, the old didn't so the old process served default password.

    Killing the old process solved the issue
     
    cPanelMichael likes this.
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    I'm happy to see the issue is now solved. Thank you for updating us with the outcome.
     
Loading...

Share This Page