Hello,

> Looking at the code, the value used for host name in IP-based virtual
> hosts is ServletRequest.getLocalName(). It is not getLocalAddr() and
> there is no pattern in AccessLogValve that prints it. You can write
> simple JSP page that will display its value.
>

Ok, this is strange. I created a test.jsp page that prints
request.getLocalName(), request.getServerName(), and request.getLocalAddr().
I tried various scenarios in the browser: http://domain1.com,
http://www.domain1.com, http:/1.2.3.4, http://domain2.com,
http://www.domain2.com, http://5.6.7.8, as well as all of the above with
https.
The only parameter that changes in all these scenarios is
request.getServerName().
request.getLocalName() = www.domain1.com (always!)
request.getLocalAddr() = 1.2.3.4 (always!)
request.getServerName() = domain1.com, www.domain1.com, 1.2.3.4, domain2.com,
www.domain2.com, 5.6.7.8


> Quote:
> [[[
>        if (connector.getUseIPVHosts()) {
>            serverName = req.localName();
> ]]]
>
> Which explains why useIPVHosts changes nothing for me -
request.getLocalName() is always giving the same result.
What is it that sets request.getLocalName() in the first place? In what
scenario would the name be different?


> >
> > Even if I enter the IP address http://5.6.7.8 or https://5.6.7.8 in the
> > browser, the access logs list 1.2.3.4 as the local IP.
> >
>
> This is odd.
>
> How 5.6.7.8 is configured at OS level? Do you have separate network
> card for it or it is something else?
>

My /etc/network/interfaces file looks like this:
# The loopback interface
auto lo
iface lo inet loopback

# Configuration for eth0 and aliases

# This line ensures that the interface will be brought up during boot.
auto eth0 eth0:0
#iface eth0 inet dhcp

# eth0 - This is the main IP address that will be used for most outbound
connections.
# The address, netmask and gateway are all necessary
iface eth0 inet static
 address 1.2.3.4
 netmask 255.255.255.0
 gateway 1.2.3.1
        pre-up iptables-restore < /etc/iptables.conf

# eth0:0
# This is a second public IP address.
iface eth0:0 inet static
 address 5.6.7.8
 netmask 255.255.255.0
 gateway 5.6.7.1
        pre-up iptables-restore < /etc/iptables.conf

>
> Your connector with address="5.6.7.8" - did it start successfully and
> did bind to the specified address? Tomcat itself will continue
> starting even if one of its connectors fails. (There is a system
> property that changes this behaviour of ignoring an error, though I do
> not remember whether it works in 6.0.24).
>

How does one find out if a connector starts successfully and binds at a
specific address? Is there a log somewhere for this information? Nothing
obvious was written to the catalina.yyyy-MM-dd.log indicating failure.

>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
Best regards,
Assaf

Reply via email to