SOLVED Apache not recognizing servername randomly

elmister

Active Member
Mar 2, 2004
35
1
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.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,222
463
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.
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.
 

elmister

Active Member
Mar 2, 2004
35
1
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
 
Last edited:

elmister

Active Member
Mar 2, 2004
35
1
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
 
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,222
463
I'm happy to see the issue is now solved. Thank you for updating us with the outcome.