httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] Apache shows code when using IP address
Date Mon, 09 Nov 2009 20:29:11 GMT
Tanner Bachman wrote:
> So far everything seems to be working normally. I'm aware of Apache using the first VirtualHost
directive as the default...and that's fine with me. Since the sites hosted on this server
both belong to the same company, I'd rather have it default to the public site if the IP address
is used. The main problem was the Servlet Container (Resin) tied to Apache. It wasn't defaulting
to the first VirtualHost like Apache does, so it would just spit the code directly back to
Apache and display it. Once I told it how to handle the IP address...all was right with the
world. :) 
> I didn't, however, ever think about adding an extra zero into the IP address. Great idea!

> Here are the results of my test (using as my test IP) 
> Firefox 3.5.5 - Gives a stock "Problem loading page" message. 
> IE 8 - Converts it too and then sends it through Google. 
> Safari 3.1.2 - Gives a stock "Can't open the page" message. 
> Opera 9.62 - Also gives a stock error message. 
Did you try to use your real IP (modified with an extra 0) ? or isn't it 
one that lends itself to this ?

When I do that with my (real) IP address, I do get my default host.
The IP I am using is like xxx.yyy.38.zzz, and I change the 38 to 038.
But neither with FF 3.5 nor IE 7 does it interpret 038 as octal (which, 
granted, would be kind of difficult).
Unfortunately, I do not have right now an IP available to test with, 
where the octal conversion would be possible.

What happens in fact is that the server takes the IP address as given 
(and which arrives in a "Host:" header) /as a string/, and compares that 
string to the various ServerName and ServerAlias, thus defaulting to the 
default host most of the time.

To get back to your case, my personal view is that letting things 
"default", is running a risk of forgetting this after a while, and then 
get into some kind of vicious unplanned situation some day in the 
future, when you make what you believe is a harmless change.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message