Re: Squid...a firewall..and virtual hosts

From: Daniel Schild <>
Date: Wed, 17 Jun 1998 10:54:16 +0200

Dear Martijn,

I recently developed the same concept here. First you need 1 squid
process per virtual webserver listening on a dedicated IP address in
accellerator mode. Then you have to reconfigure your webserver in a way
that it provides a listing of the defferent servers on one address (e.g.
make links of the different server roots into the main webserver root).
The accel squids now need a little script, the famous redirector, that
transforms the real URL to the translated URL for your inside webserver.

Sample configuration:


acl psycho src
http_access deny psycho
http_port 80
icp_port 0
httpd_accel 80
cache_effective_user squid squid
cache_dir /accel/
cache_access_log /accel/
cache_log /accel/
cache_store_log none
cache_swap 100
#redirect_program /accel/
dns_children 1
redirect_children 5
pid_filename /accel/
emulate_httpd_log on
cache_stoplist cgi-bin ?

while(<>) {

As you can see, this sample squid plays the webserver,
but redirects all request to a machine called in a
subdirectory /saw/. (The squid.conf shows current config with a private
adress for the webserver and the one that was befor this with the redir

The best thing is to provide real adresses per inside webserver. This
doesnt require the famous redir script as the webserver-process listens
on one address per virtual webserver. As you have a firewall around your
webserver it should be easy to use private addresses.)

If you need some startup scripts I can provide them too. ;)

Martijn Spronk wrote:
> I have a question about the use of Squid to allow outside users to see
> websites inside the firewall.
> We have a setup where we have virtual sites hosted by a few machines,
> where the sites
> all have one IP address but are distinguished by the hostname (so the
> webserver has to
> get the actual hostrequest to figure out which site to server, pretty
> common i think).
> These sites are set up inside the firewall (set up on a linux machine).
> Now we want to
> add the Squid proxy to a machine outside the firewall, to be able to
> serve the secure sites
> to the inside world.
> So the way we want to enable the websites to be seen is:
> for example points to the ip address of the
> proxy, the proxy
> will go through the firewall (which has a hole in there to enable only
> the proxy server to
> go through), and from there on to the correct machine inside the secure
> area.
> Our main concern is. Will the actual hostname of the URL request, be
> lost in the path
> through the firewall?? Cause in that case, if the proxy for example
> changes it to a request
> to the firewall, the virtual server wouldnt be able to distinquish the
> request (that seems to be coming
> from the firewall) between and
>, cause they
> would both be translated to by Squid?,
> since they are both hosted on the same machine with the same IP inside
> the firewall.
> Any thoughts about this setup, has anyone used Squid this way before and
> has any experience
> with it? Is it possible to set Squid up on the firewall itself, to save
> ourself a machines, and maybe even
> improve overall performance?

Its faster, it saves machines 'cause your webserver(machines) can
handler more requests.
Test with a whole class C network aliased on one interface do not show
any performance leaks. (I had half of the class C play the webserver and
half the accel squid, and a script thatf requently gets the whole
server. good hardware is the point ;) )

The setup here runs without inspection ~40 days now.

Daniel Schild
Dienst- und Applikationsentwicklung
Teleport Sachsen-Anhalt GmbH | RegioCom GmbH
Tel:    ++49 39203 8 3300    | ++49 39203 8 2030
Fax:    ++49 39203 8 3399    | ++49 39203 8 2031
E-Mail:        |
S-Mail: Steinfeldstr. 3, 39179 Barleben, Germany
Received on Wed Jun 17 1998 - 01:55:14 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:40:43 MST