Re: [squid-users] visible_hostname versus unique_hostname

From: Chris Robertson <crobertson_at_gci.net>
Date: Wed, 22 Apr 2009 14:33:08 -0800

Matus UHLAR - fantomas wrote:
> Hello,
>
> I was searching for the logic of setting visible_hostname and
> unique_hostname. I found out that value of unique_hostname is set by calling
> getMyHostname() function, which returns value of visible_hostname, if it's
> set. However, I would prefer not to do this - to use autodected hostname,
> and only change visible_hostname in configuration file.
>
> My point is that we use different /etc/hosts on different systems for
> configuring more system services (not just squid) to run on different IP's
> with the same configuration files, e.g.:
>
> - hosts file:
> 195.168.1.136 proxy1.nextra.sk proxy.nextra.sk
>
> - squid config:
> http_port proxy.nextra.sk:3128
> tcp_outgoing_address proxy.nextra.sk
> udp_incoming_address proxy.nextra.sk
>
> visible_hostname proxy.nextra.sk
>
> Squid could resolve it's own unique hostname to proxy1.nextra.sk, if it
> would not take value of visible_hostname. That would allow me using of _the
> same_ config file on more machines, which would make teh administration much
> easier. However, because this logic, it's impossible and I _must_ hold more
> configuration files, no matter what I do to make that easier.
>

 From http://www.squid-cache.org/Versions/v3/3.0/cfgman/:

  Configuration options can be included using the "include" directive.
  Include takes a list of files to include. Quoting and wildcards is
  supported.

  For example,

  include /path/to/included/file/squid.acl.config

  Includes can be nested up to a hard-coded depth of 16 levels.
  This arbitrary restriction is to prevent recursive include references
  from causing Squid entering an infinite loop whilst trying to load
  configuration files.

So you could define unique_hostname in a file (different on each server)
that is included by the main config file (which is the same on all).
Squid 2.7 also supports the include directive.

> I would like to ask, could the *hostname logic be changed, so people could
> set visible_hostname and leave unique_hostname to rely on the internal
> logic? Should I fill bugreport for this?
>
> Thank you.
>

Chris
Received on Wed Apr 22 2009 - 22:33:32 MDT

This archive was generated by hypermail 2.2.0 : Thu Apr 23 2009 - 12:00:01 MDT