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.

Bad Hostname

Discussion in 'General Discussion' started by TomBullock, Jul 12, 2009.

  1. TomBullock

    TomBullock Active Member

    Joined:
    Jun 8, 2008
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Hello

    Today, Ive just realised that when I go to http://web1.bullsofthosting.co.uk/ I get the error: "Bad Request (Invalid Hostname)"

    Usually, it shows the default cPanel page.

    Does anyone know how to correct this?

    Thanks
    Thomas
     
  2. logicsupport

    logicsupport Well-Known Member

    Joined:
    Jun 5, 2007
    Messages:
    138
    Likes Received:
    0
    Trophy Points:
    16
    Please confirm your VirtualHost section for this domain is configured properly.

    Also provide the Apache error log
     
  3. TomBullock

    TomBullock Active Member

    Joined:
    Jun 8, 2008
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    How can I check this?

    Ive attached the Apache error log.

    Thanks
    Thomas
     

    Attached Files:

  4. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    I did an nslookup of your domain, attempted a zone transfer,
    checked the WHO, and also ran a dig of the hostname DNS records,
    and some other basic checks.

    Your DNS records are pretty basic but setup correctly so I don't
    believe you are having any DNS issue that can sometimes account
    for this sort of thing.

    When I connect to your IP address directly "67.21.83.22?", I
    get the exact same message returned so that is indeed what your
    server is delivering as the default and isn't just that you had some
    hostname vhost setup with problems with it now.

    That given, I would say that something has happened to your
    default vhost (first entry in your httpd.conf) or the files for the host
    themselves (/usr/local/apache/htdocs) have been removed or the
    permissions changed so they are not accessible.

    I'd look at /usr/local/apache/httpd.conf and check out your default
    page virtualhost entry which should be the first one you come to
    when reading the configuration file down from top to bottom:
    Code:
    <VirtualHost 67.21.83.22[i]?[/i]:80>
        ServerName !!!YOUR SERVER HOSTNAME!!!
        DocumentRoot /usr/local/apache/htdocs
        ServerAdmin !!!YOUR EMAIL ADDRESS HERE!!!
        <IfModule mod_suphp.c>
            suPHP_UserGroup nobody nobody
        </IfModule>
        UserDir disable
    </VirtualHost>
    
    (I dropped the last digit of your IP above for security)

    If it is missing or moved to someplace other than the first entry then
    you need to replace it or move it back.

    Don't forget to run the cpanel distiller process and restart Apache
    if you need to make any changes to the httpd.conf file:
    Code:
    # service httpd configtest 
    [i]Syntax OK[/i]
    # /usr/local/cpanel/bin/apache_conf_distiller --update
    # service httpd restart
    # service httpd status
    
    I would also check the folder /usr/local/apache/htdocs and make sure
    the folder and the files in it are readable by user "nobody" and
    that you have a proper index file in there. This is where you
    normally get the default Cpanel page displayed.
     
    #4 Spiral, Jul 13, 2009
    Last edited: Jul 13, 2009
  5. TomBullock

    TomBullock Active Member

    Joined:
    Jun 8, 2008
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Just noticed on the above post that the IP address is wrong.
    Could this be the problem?

    Thanks
    Thomas
     
  6. jenlepp

    jenlepp Well-Known Member

    Joined:
    Jul 4, 2005
    Messages:
    116
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Liberty Hill, TX
    cPanel Access Level:
    DataCenter Provider
    I had this on two new servers I set up - checked httpd conf and the block just wouldn't get in there.

    Wound up including it, restarting, and it worked fine, so I didn't bother trying to figure out why cPanel didn't create it on its own.
     
  7. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    What do you mean "IP ADDRESS IS WRONG?"

    If you are talking about my post, I deliberately changed the last digit
    of your IP address so that it isn't publicly posted in the forums and
    I left a note to that effect in my post if you read it.

    The IP address I obtained by doing a DNS lookup of your hostname.
    If that is not the IP address it is supposed to be then that is your problem
    and you would need to go check your zone files in /var/named
     
  8. TomBullock

    TomBullock Active Member

    Joined:
    Jun 8, 2008
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    The IP you have obtained is: 67.21.83.22.??
    Whilst my actual IP is: 69.162.75.??

    Ive just edited the "web1.domain.com.db" file in which I found the wrong IP address and changed it to the new one so ill see if that works.

    Thanks
    Thomas
     
Loading...

Share This Page