On a redhat distro, this is what I have done, for 2 squid instances... This
is only in the lab so I may have missed something, hope it helps a
little....
Make a /etc/squid2 directory & copy data into it, also make a cache dir for
the second instance & copy the init script
mkdir /etc/squid2
cp -r /etc/squid /etc/squid2
cp /etc/init.d/squid /etc/init.d/squid2
mkdir -p /var/spool/squid2 ; chmod 750 /var/spool/squid2 ; chown
squid.squid /var/spool/squid2
Link squid2 to squid ( to get a different process to look for in the
initscripts pidof() )
ln -s /usr/sbin/squid /usr/sbin/squid2
Differences between /etc/init.d/squid & /etc/init.d/squid2 ( < = squid > =
squid2 )
< [ -f /etc/squid/squid.conf ] || exit 0
> [ -f /etc/squid2/squid.conf ] || exit 0
< if [ -f /etc/sysconfig/squid ]; then
< . /etc/sysconfig/squid
> if [ -f /etc/sysconfig/squid2 ]; then
> . /etc/sysconfig/squid2
< [ -f /usr/sbin/squid ] && SQUID=squid
> [ -f /usr/sbin/squid2 ] && SQUID=squid2
< CACHE_SWAP=`sed -e 's/#.*//g' /etc/squid/squid.conf | \
> CACHE_SWAP=`sed -e 's/#.*//g' /etc/squid2/squid.conf | \
< [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid
> [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid2
< $SQUID -z -F -D 2>/dev/null
> $SQUID -f /etc/squid2/squid.conf -z -F -D 2>/dev/null
< [ ! -f /var/run/squid.pid ] || break
> [ ! -f /var/run/squid2.pid ] || break
< $SQUID -k shutdown &
> $SQUID -f /etc/squid2/squid.conf -k shutdown &
< [ -f /var/run/squid.pid ] || break
> [ -f /var/run/squid2.pid ] || break
< [ -e /var/lock/subsys/squid ] && restart || :
> [ -e /var/lock/subsys/squid2 ] && restart || :
Differences between /etc/squid/squid.conf & /etc/squid2/squid.conf ( < is
squid/squid.conf > is squid2/squid.conf )
< cache_dir aufs /var/spool/squid 5000 32 256
> cache_dir aufs /var/spool/squid2 5000 32 256
> cache_access_log /var/log/squid2/access.log
> cache_log /var/log/squid2/cache.log
> pid_filename /var/run/squid2.pid
chkconfig squid2 on
service squid2 start
Hope this helps as well...
J.J.
-----Original Message-----
From: Chris Robertson [mailto:crobertson@gci.com]
Sent: Tuesday, May 03, 2005 2:35 PM
To: squid-users@squid-cache.org
Subject: RE: [squid-users] 2 squid processes
>> -----Original Message-----
>> From: Chris Robertson [mailto:crobertson@gci.com]
>> Sent: Friday, April 29, 2005 10:55 AM
>> To: squid-users@squid-cache.org
>> Subject: RE: [squid-users] 2 squid processes
>>
>>
>> > -----Original Message-----
>> > From: Discussion Lists [mailto:discussions@lagraphico.com]
>> > Sent: Friday, April 29, 2005 8:16 AM
>> > To: squid-users@squid-cache.org
>> > Subject: [squid-users] 2 squid processes
>> >
>> >
>> > All,
>> > Obscure question here: Has anyone been able to get 2 squid
>> processes
>> > running? I remember corresponding to a gentleman a while
>> back who was
>> > able to get it to work, and he gave me his init-scripts, and conf
>> > files. Since then I have been unable to find that stuff try
>> as I may,
>> > so I wanted to check with you good folks to see if any of you have
>> > something like that which can help me? The problem is that
>> the single
>> > squid process can't handle all of what I want:
>> >
>> > -Internal squid listener for proxy clients -External squid listener
>> > to publish our websites Port 80. -External squid listener to
>> > publish SSL Port 443.
>> >
>> > I found the following link (scroll down a third of the way) and it
>> > describes how to do this, but it would be really helpful to
>> see config
>> > files, and init files.
>> >
>> >
>> http://66.102.7.104/search?q=cache:OwnNlpbABqgJ:www.swelltech.com/sup
>> p
>> > or
>> >
>> t/webminguide/ch03.html+%22two+squid+processes%22&hl=en&client
>> =firefox-a
>> >
>> > Thanks!
>>
>> I have two squid processes running on one box, but only to take
>> advantage of a second processor. One instance Squid is capable of
>> running as both a caching proxy, and a web-accelerator
>> (http://www.squid-cache.org/Doc/FAQ/FAQ-20.html).
>>
>> In any case, if you want to follow the path of running two processes,
>> then you just need to follow the FAQ on setting up each conf file.
>> The directives that MUST be different for each conf file are
>> http_port, icp_port (if it's not set to 0), cache_dir,
>> cache_access_log (if not set to /dev/null), cache_log,
>> cache_swap_log, pid_filename, and snmp_port (if squid was compiled
>> with snmp support).
>>
>> You can use the same squid binary for both processes, just specify a
>> different conf file for them to use (e.g. squid -f
>> /path/to/accelerator.conf && squid -f /path/to/cache.conf).
>>
>> Chris
>>
> -----Original Message-----
> From: Discussion Lists [mailto:discussions@lagraphico.com]
> Sent: Tuesday, May 03, 2005 11:24 AM
> To: squid-users@squid-cache.org
> Subject: RE: [squid-users] 2 squid processes
>
>
> Okay I read your adivice and finally was able to find blurb about it
> in the FAQ. So my question is this . . . How do I get the second
> process to create its own cache? I can see how to set it up in init
> to use a different cache location, but it still needs to know how to
create it.
> How would I go about doing that?
>
> Thanks!
>
"squid -f /path/to/second/squid.conf -z" ought to do it.
Chris
Received on Tue May 10 2005 - 19:59:50 MDT
This archive was generated by hypermail pre-2.1.9 : Wed Jun 01 2005 - 12:00:02 MDT