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.

Hostname ends up in defaultwebpage.cgi

Discussion in 'Bind / DNS / Nameserver Issues' started by Martin Werner, Dec 4, 2015.

  1. Martin Werner

    Martin Werner Member

    Joined:
    Dec 4, 2015
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    Hi!

    I am trying to connect to a website that I have set up in my WHM. Since I want to be able to test websites with their real domain in the future and not just http://mydomain.com/~customername I tried to add the domain to my /etc/hosts on my computer. The problem is that I get redirected to defaultwebpage.cgi even though there is a website on the domain I entered.

    What am I doing wrong? Is there some of DNS verifier that checks who-is for the domain that you connect with?

    Really thankful for any help.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Did you configure the correct IP address for the domain name in the hosts file on your computer? It should match the IP address the domain name is assigned in Web Host Manager.

    Thank you.
     
  3. Martin Werner

    Martin Werner Member

    Joined:
    Dec 4, 2015
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    Yes, it's pointing towards the correct IP address.

    Thanks for replying so rapidly! :)
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Is it possible you have not setup the entry in the hosts file for the "www" prefix to the domain name and the script is redirecting you to that subdomain automatically?

    Thank you.
     
  5. Martin Werner

    Martin Werner Member

    Joined:
    Dec 4, 2015
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Try loading a single HTML page (e.g. test.html) instead of the script you have uploaded to see if that makes a difference. You can also try rebuilding the Apache configuration file:

    Code:
    /scripts/rebuildhttpdconf
    Thank you.
     
  7. Martin Werner

    Martin Werner Member

    Joined:
    Dec 4, 2015
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    I tried to create a test.html file, it gave a 404 error. When I tried with http://example.com/~username it worked.

    I also tried to run the script and it didn't change the outcome.
     
  8. Martin Werner

    Martin Werner Member

    Joined:
    Dec 4, 2015
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    Okey I found the problem! It appears that apache was bound to my external ip rather than my internal.

    I had: <VirtualHost myexternalip:80>

    When I changed to my internal IP, it started working!
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page