Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Configure Multiple IP for Squid Proxy Server & hide Version and Hostname  (Read 8218 times)

0 Members and 1 Guest are viewing this topic.

sajugovind

  • Guest

Proxy server is a computer system or application which is installed on computer system that works as a  acts as an agent or channel for requests from clients looking for resources from other servers.

Now after installation when you try to check your IP in any site like whatismyip.com it will show that you are using proxy along with the hostname and version of Squid proxy server which is a security concern.


1) Hide Proxy version & server hostname

a) Hide Squid Version

open “/etc/squid/squid.conf” in a editor like vim and search for “httpd_suppress_version_string” and enable it.

Change FROM:
#  TAG: httpd_suppress_version_string   on|off
#       Suppress Squid version string info in HTTP headers and HTML error pages.
#
#Default:
#httpd_suppress_version_string off

TO:
#  TAG: httpd_suppress_version_string   on|off
#       Suppress Squid version string info in HTTP headers and HTML error pages.
#
#Default:
httpd_suppress_version_string on


b) Hide Hostname

Search for “visible_hostname” and change FROM:
#  TAG: visible_hostname
#       If you want to present a special hostname in error messages, etc,
#       define this.  Otherwise, the return value of gethostname()
#       will be used. If you have multiple caches in a cluster and
#       get errors about IP-forwarding you must set them to have individual
#       names with this setting.
#
#Default:
# none

TO:
#  TAG: visible_hostname
#       If you want to present a special hostname in error messages, etc,
#       define this.  Otherwise, the return value of gethostname()
#       will be used. If you have multiple caches in a cluster and
#       get errors about IP-forwarding you must set them to have individual
#       names with this setting.
#
#Default:
visible_hostname <your desired hostname>

<your desired hostname> will be the name you want to show to world


2) Configure Multiple IP for Squid

Sometime it happens that the Proxy server which you have setup have multiple IP address and you want to configure squid server to use multiple IP addresses (i.e. Systems will show the secondary IP of the server instead of primary). Open squid configuration file; search for “tcp_outgoing_address” and add following
acl ip1 myip <IP Address 1>
acl ip2 myip <IP Address 2>
tcp_outgoing_address <IP Address 1> ip1
tcp_outgoing_address <IP Address 2> ip2

Replace <IP Address> with the IP assigned to your Proxy Server.

Restart Squid Server with command “service squid restart“