HTTP Error 400. The request hostname is invalid [Answered]RSS

14 replies

Last post Sep 27, 2011 02:26 AM by andyguevara

  • HTTP Error 400. The request hostname is invalid

    Jun 06, 2010 12:50 PM|blaine.miller|LINK

     Hi,

     All I'm trying to do is create a simple website. To begin with. Nothing fancy, so all the fancy stuff I'll leave toll later. I've gone through three different versions of "setting up a simple website. None of them have worked for me. I am looking for an even simpler, step by step guide with examples on how to set up a simple, stupid website.

     And I thought Apache was supposed to be complicated! When I use the default site, I get the splash page no problem. When I try to serve my contect on a "new site" with the same IP and turn off the default website, I get the subject line error.

     I've been working on getting this danged thing set up for almost a month now. I'd appreciate any help you can offer in a simple, step by step mode. I don't need fancy, like I said. Nor a smart aleck. Just someone who's willing to hold my hand through the first setup.

     The frustration level here is intense.

     

    Thanks!

     

    Blaine 

    400 error configuration setup

  • Rovastar Rovastar

    5473 Posts

    MVP

    Moderator

    Re: HTTP Error 400. The request hostname is invalid

    Jun 06, 2010 01:21 PM|Rovastar|LINK

     To start with what version of Windows do you have and what technologies do you use to create your website (asp, asp.net, phph, html, etc).

    For simple stuff why not edit the Default website and add your files to that location.

    Files will need to have NTFS persmissions  like those for the files for the default web site.

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: HTTP Error 400. The request hostname is invalid

    Jun 06, 2010 01:53 PM|blaine.miller|LINK

     I'm using Windows 2008 R2, IIS 7.5 and HTML.I tried using the default website and just editing that installation and got a different error, but still no website.

     The error I got eludes me at this moment, but I can recreate it in a few sec.s.

     I'll check file permissions, but nowhere in the various setup guides do I remember seeing file permissions as an issue.

    Thanks for your time and patience.

    Blaine

  • Re: HTTP Error 400. The request hostname is invalid

    Jun 06, 2010 01:59 PM|blaine.miller|LINK

     I just shared the directory where the content is stored. The folder and files appear to be rwx, or the equivalent in Windows.

    Is there anything else I should look to as far as file permissions? Sorry, I'm not used to the Windows nomentclature.

     

    Blaine

  • Rovastar Rovastar

    5473 Posts

    MVP

    Moderator

    Re: HTTP Error 400. The request hostname is invalid

    Jun 06, 2010 05:17 PM|Rovastar|LINK

     Reading up on the 400 request hostname is invalid. It could be well be an issue with your browser/client setup. It isn not  acommon error.

    It could be your IIS setup.

     

    So what do you enter in your browser to get this?

    Are you conneccting via teh IP address. like http://123.123.123.123 or via a domain name like http://www.mysite.com

    BUt there are a few things you can try.

    http://www.mrtweak.com/windows-servers/iis-server/fixing-a-bad-request-invalid-hostname-400-error-on-windows-iis/

     To get more information on this 400 error you will need to look at the http.sys log file. look under here for the relevany fiel and post here.

     %windir%\System32\LogFiles\HTTPERR

     

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: HTTP Error 400. The request hostname is invalid

    Jun 06, 2010 08:01 PM|blaine.miller|LINK

     OK...

    Thanks for the info. Here are the contents of my httperr1 file:

    #Software: Microsoft HTTP API 2.0
    #Version: 1.0
    #Date: 2010-05-30 15:23:52
    #Fields: date time c-ip c-port s-ip s-port cs-version cs-method cs-uri sc-status s-siteid s-reason s-queuename
    2010-05-30 15:23:52 92.240.68.152 29980 75.60.26.130 80 - - - 400 - Verb -
    2010-05-30 16:56:42 24.23.249.82 54970 75.60.26.130 80 - - - - - Timer_ConnectionIdle -
    2010-06-01 04:49:48 66.249.16.211 23708 75.60.26.130 80 - - - - - Timer_ConnectionIdle -
    2010-06-03 00:45:25 122.225.57.132 1338 75.60.26.130 80 HTTP/1.0 CONNECT smtp.citiz.net:25 400 - URL -
    2010-06-06 03:06:05 ::1%0 49217 ::1%0 80 - - - - - Timer_ConnectionIdle -
    2010-06-06 04:07:59 24.23.249.82 55866 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 04:08:06 24.23.249.82 55867 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 16:08:51 24.23.249.82 49390 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 16:34:16 24.23.249.82 49479 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 16:34:17 24.23.249.82 49481 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 16:34:19 24.23.249.82 49482 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 16:37:20 24.23.249.82 49530 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 16:37:22 24.23.249.82 49531 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 16:57:56 64.246.165.170 28969 75.60.26.130 80 HTTP/1.0 GET /robots.txt 400 - Hostname -
    2010-06-06 16:57:56 64.246.165.170 28971 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 17:57:01 24.23.249.82 49899 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 17:57:03 24.23.249.82 49901 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 18:00:35 24.23.249.82 49959 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 18:26:50 66.249.67.143 58749 75.60.26.130 80 HTTP/1.1 GET /Education_Degrees.cfm?fp=%2FE7Jg3%2BSQhe0N6YSCn5RkRII4IpnCsa0mTNqd0xq7o4lzYbiibwNcpJ9x%2F6wZzUtnOA69zK7SrY4xSJnvAZc1hxnegtJoQE8rO8MLrXwUOib0dcMwxy3obVevUAaZ1kUNjGh1GNAZc3GUcmGshZUnzR6qagQdJvjvVJA7OSWTRY%3D&&kt=4&kp=11 400 - Hostname -
    2010-06-06 20:38:20 216.145.5.42 62096 75.60.26.130 80 HTTP/1.0 GET /robots.txt 400 - Hostname -
    2010-06-06 20:38:20 216.145.5.42 62100 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -
    2010-06-06 21:36:37 66.249.16.212 21186 75.60.26.130 80 HTTP/1.1 GET / 400 - Hostname -

     

    None of this makes much sense to me, unfortunately.

    I try to access the hostname by either the IP or FQDN, 75.60.26.130 & silentpartnerstech.com.

    Thanks for your time and patient consideration.

     

    Blaine

  • Rovastar Rovastar

    5473 Posts

    MVP

    Moderator

    Re: HTTP Error 400. The request hostname is invalid

    Jun 07, 2010 07:44 AM|Rovastar|LINK

     Does http://localhost work from the server itself?

     

    I am a little confused as I can browse to http://silentpartnerstech.com and the IP as it then goes to the default website.

    So traffic is getting through. You have the default website setup to receive requests for that hostname and IP and it appears that this site is still active. I thought you said you disabled this site?

    Why not put all your files under this fiel location of this default site, as it is active, and try to connect to connect direct to the pages from tehre.

    e.g. if you have a fiel mypage.html in teh root can you connect to silentparterstech.com/mypage.html

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: HTTP Error 400. The request hostname is invalid

    Jun 07, 2010 08:26 AM|blaine.miller|LINK

     Sorry,

     

    When I was working on this, I left the good, default webpage started and stopped the broken site.

     I've reset it so that the default is off and the new silentpartnerstech.com page is started and active.

    As you can see, it's still broken.

     

    Thanks for you time and bearing with me.

     

    Blaine

  • Rovastar Rovastar

    5473 Posts

    MVP

    Moderator

    Re: HTTP Error 400. The request hostname is invalid

    Jun 07, 2010 09:16 AM|Rovastar|LINK

    Ok. Then there seems to be something in your configuartion of the site you setup.

    The easist way might be to place your applciation/site under the default website liek I sugegsted before.

    So stop the current one. Place you code under where the folder/directory of the default site and try and browser directly to a page.


    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: HTTP Error 400. The request hostname is invalid

    Jun 07, 2010 10:41 AM|blaine.miller|LINK

    Two things...

    I don't understand what is meant by something is wrong with my configuration and yes, I'll try to do as you say and put my "new website" under the default directory & see what happens.

     

    Thanks for the suggestions!

     

    Blaine

  • Rovastar Rovastar

    5473 Posts

    MVP

    Moderator

    Re: HTTP Error 400. The request hostname is invalid

    Jun 07, 2010 11:15 AM|Rovastar|LINK

     What I meant is that the default site settings seem to serve pages correctly. So let's, for teh moment at least, use this structure if possible.

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: HTTP Error 400. The request hostname is invalid

    Jun 07, 2010 11:46 AM|blaine.miller|LINK

    And we have a (sort of) web page! Thanks! The index.html page is being served! Great!

     Next I would like to figure out why the page can't be served from the new site. I actually plan to serve several sites fromthe single IP I have. In Apache this is done with a virtually hosting arrangement. How is it done in IIS 7.5?

    Thanks again for your patience and time.

     Blaine 

  • Re: HTTP Error 400. The request hostname is invalid

    Jul 25, 2011 09:00 AM|tekkerguy|LINK

     I know this is an old post but for me, the problem was in the binding settings, I gave it a host name.  When I removed the host name, and went to localhost:port number, it worked

  • Re: HTTP Error 400. The request hostname is invalid

    Jul 25, 2011 09:26 AM|HCamper|LINK

    Yep it's old and missing some information.

    This http://www.it-notebook.org/iis/article/understanding_host_headers.htm describes how Host Headers operate.

    This http://www.it-notebook.org/iis/article/hosts_file_host_headers.htm shows the Hosts file

    and how to use IP Address and Host Name together.

    Common problem with Vista  Windows 7 which use IPV6 you may find 

    entry in the Hosts file ::1 which is the IPV6 IP Address for localhost.

    If you edit the Hosts file and comment out the IPV6 locahost ::1 your problems may be resolved.

    Martin

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: HTTP Error 400. The request hostname is invalid

    Sep 27, 2011 02:26 AM|andyguevara|LINK

    Perfect! That was my problem as well.