You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Server Administrator <ad...@bluephyre.ca> on 2004/01/06 20:24:10 UTC

[users@httpd] 400 Bad Request Problem

I am experiencing some troubles from my apache 1.3.29 setup when I try to
add new virtualhosts. I've got several virtualhosts defined and working fine
already, but the last few I've tried to setup all exhibit the following odd
behaviour:

I setup the virtualhost and try to test it manually using telnet to its IP
address:

# telnet 192.168.0.1 80
Trying 192.168.0.1...
Connected to 192.168.0.1
GET / HTTP/1.1
HOST: www.example.com

This returns a 200 status code and the expected web page.

However if I try to test it manually by telneting to the domain name:

# telnet www.example.com 80
Trying 192.168.0.1...
Connected to 192-168-0-1.example.com
GET / HTTP/1.1
HOST: www.example.com

This returns a 400 status code: Bad Request (Invalid Hostname)

As you can see, both attempts connect to the same IP (as indicated by the
'Trying 192.168.0.1...' line), and the requests are identical once
connected. So why would the responses be different?

Any insight into this will be GREATLY appreciated. Thanks.

Christopher


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] 400 Bad Request Problem

Posted by "Eimantas \"EnC\" Vaičiūnas" <ei...@lietuvoje.lt>.
Server Administrator wrote:

> I am experiencing some troubles from my apache 1.3.29 setup when I try to
> add new virtualhosts. I've got several virtualhosts defined and working fine
> already, but the last few I've tried to setup all exhibit the following odd
> behaviour:
> 
> I setup the virtualhost and try to test it manually using telnet to its IP
> address:
> 
> # telnet 192.168.0.1 80
> Trying 192.168.0.1...
> Connected to 192.168.0.1
> GET / HTTP/1.1
> HOST: www.example.com
> 
> This returns a 200 status code and the expected web page.
> 
> However if I try to test it manually by telneting to the domain name:
> 
> # telnet www.example.com 80
> Trying 192.168.0.1...
> Connected to 192-168-0-1.example.com
> GET / HTTP/1.1
> HOST: www.example.com
> 
> This returns a 400 status code: Bad Request (Invalid Hostname)
> 
> As you can see, both attempts connect to the same IP (as indicated by the
> 'Trying 192.168.0.1...' line), and the requests are identical once
> connected. So why would the responses be different?
> 
> Any insight into this will be GREATLY appreciated. Thanks.
> 
> Christopher

Hi,

i saw two differences in your telnet output:
1st connection attempt:
<...>
Connected to 192.168.0.1
<...>

2nd connection attempt:
<...>
Connected to 192-168-0-1.example.com
<...>

So i do think this is the problem, though i can't give you solution to it.

dfai


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] 400 Bad Request Problem

Posted by Ben Yau <by...@cardcommerce.com>.

> -----Original Message-----
> From: Server Administrator [mailto:administrator@bluephyre.ca]
> Sent: Tuesday, January 06, 2004 11:24 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] 400 Bad Request Problem
>
>
> I am experiencing some troubles from my apache 1.3.29 setup when I try to
> add new virtualhosts. I've got several virtualhosts defined and
> working fine
> already, but the last few I've tried to setup all exhibit the
> following odd
> behaviour:
>
> I setup the virtualhost and try to test it manually using telnet to its IP
> address:
>
> # telnet 192.168.0.1 80
> Trying 192.168.0.1...
> Connected to 192.168.0.1
> GET / HTTP/1.1
> HOST: www.example.com
>
> This returns a 200 status code and the expected web page.
>
> However if I try to test it manually by telneting to the domain name:
>
> # telnet www.example.com 80
> Trying 192.168.0.1...
> Connected to 192-168-0-1.example.com
> GET / HTTP/1.1
> HOST: www.example.com
>
> This returns a 400 status code: Bad Request (Invalid Hostname)


Just curious . Could you show the output for your virtual hosts that DO
work? doing the same test . Telnet to IP, do the GET and HOST:
www.workingexample.com and then telnetting to www.workingexample.com 80 ,
etc. etc.. .

It may be helpful to see what everything says when it is working

Ben Y


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org