SOLVED Domains redirecting to default web page

RalphOtowo

Member
Jan 14, 2019
7
0
1
Nigeria
cPanel Access Level
Root Administrator
I've recently setup a WHM/cPanel instance on an AWS EC2 instance using the official AMI.

I used the transfer tool to migrate an account from an existing WHM server and everything appears to have made it over to the destination server successfully.

I have updated /etc/hosts on my machine to map the destination server's IP address to the domain name which is still pointed at the old WHM server. This is required to verify that everything works as expected on the destination server before I update live DNS records. All attempts to visit example.com (placeholder) load the ...cgi-sys/defaultwebpage.cgi page.

After lots of searching and suggestions from similar articles, I opted to test the website using another domain name, example2.com - I created an A record mapping example2.com to the destination server's IP address, then proceeded to add example2.com as an Alias under the sole cPanel account, with the document root set to the /public_html but this also redirects to the ...cgi-sys/defaultwebpage.cgi page like above.

I've tried regenerating the httpd.conf file, and confirmed that the WHM has correctly identified my NAT setup. I've executed the /scripts/build_cpnat script and the results shows that the private IP address is mapped to the public IP. Under Basic WebHost Manager Setup, I've repeatedly set the IPv4 address to my private IP but this is automatically updated to reflect the public IP address.

I've checked the /etc/apache2/conf/httpd.conf configuration file and confirmed that the VirtualHost block is being generated correctly with the primary domain and secondary (test domain - example2.com) set as ServerName and ServerAlias variables respectively.

It beats me how cPanel/WHM totally disregards the web server configurations and continues to redirect to the ...cgi-sys/defaultwebpage.cgi page. One answer here suggested deleting the DNS zone if the domain isn't hosted on the destination WHM server, which I've done, all to no avail.

I desperately require some assistance here.
 

Eminds

Well-Known Member
Nov 10, 2016
319
34
28
India
cPanel Access Level
Root Administrator
Make sure that your instance is using elastic IP and that should fix the issue. EC2 instances when rebooted always changes the IP if its not elastic one.
 

RalphOtowo

Member
Jan 14, 2019
7
0
1
Nigeria
cPanel Access Level
Root Administrator
Make sure that your instance is using elastic IP and that should fix the issue. EC2 instances when rebooted always changes the IP if its not elastic one.
Thank you for responding. The EC2 instance has an elastic (static) IP address associated and will persist through reboots. That's not the issue.
 

RalphOtowo

Member
Jan 14, 2019
7
0
1
Nigeria
cPanel Access Level
Root Administrator
Hello @cPanelMichael,

The first domain name is resolving to the destination cPanel server. I should point out that I do not wish to use any nameservers on cPanel/WHM. I've added a local DNS record to point the domain at the cPanel/WHM's server IP address using my operating system's host file.

The second domain name is also pointed at the cPanel/WHM server. In this case, not using the host file but an actual A record from the DNS manager for the domain name. And all machines I've tested with show that that the DNS changes have propagated. Regardless, I continue to see the default page.

It might help to point out that I've worked with several servers running Apache/Nginx and can confidently manage a Linux server with these web servers. However, my understanding of cPanel/WHM is limited.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
If the domain name is resolving to the same IP address that's assigned to the account on the new cPanel & WHM server, then it sounds like an issue with the Apache configuration as opposed to any local DNS settings on your workstation. Can you open a support ticket so we can take a closer look at the affected system and see if we notice anything wrong with how it's configured? You can post the ticket number here and I'll link this thread to it.

Thank you.
 

RalphOtowo

Member
Jan 14, 2019
7
0
1
Nigeria
cPanel Access Level
Root Administrator
Hi @cPanelMichael,

This has been resolved. This is what I needed to see, your response on this thread.
I was unaware that the records had to be added within cPanel even if the DNS is managed externally. I had deleted the DNS zones and also disabled nameservers as I wasn't planning to use them. Seems weird but I guess it's needed for some internal DNS querying.

Thanks for your assistance. Consider this resolved.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
Hi @RalphOtowo,

I'm glad to see you were able to solve the issue, and thank you for taking the time to let us know what the problem was. I've marked this thread as solved.

Thanks!