Configuring Squid & HAVP(ClamAV) in Ubuntu : Example #2

March 7, 2010

In this article, it is assumed that Squid has been installed and running well, because the contents of this article will not discuss the installation of squid. The following is just an example of the steps in configuring Squid as a parent proxy (not transparent proxy) and HAVP (in collaboration with ClamAV) as a virus scanner (transparent proxy).

1. Information schema.

                  [ClamAV]
                     ||
                     || 
               Transparent Proxy*
               192.168.0.253:8080
                     ||                     [eth1]
                     ||                       ||
 [Intranet]--------[HAVP]-+-[Squid]--------[Internet]
     ||                        ||
   [eth0]                  Parent Proxy
192.168.0.0/24            127.0.0.1:3128

2. Installing HAVP, ClamAV and ClamAV update virus databases for the first time.

~# apt-get install havp clamav
~# freshclam

3. Add the following line into file “/etc/squid/squid.conf”. If the existing configuration, like this “http_port 192.168.0.253:3128 transparent”, please change the following lines like this.

http_port 127.0.0.1:3128

4. Make sure the configuration files in “/etc/havp/havp.config”, at least as the following lines.

USER havp
GROUP havp
DAEMON true
PIDFILE /var/run/havp/havp.pid
SERVERNUMBER 20 # please adjust itself
MAXSERVERS 100 # please adjust ifself
ACCESSLOG /var/log/havp/access.log
ERRORLOG /var/log/havp/havp.log
USESYSLOG false
SYSLOGNAME havp
SYSLOGFACILITY daemon
SYSLOGLEVEL info
LOG_OKS true
LOGLEVEL 1
SCANTEMPFILE /var/spool/havp/havp-XXXXXX
TEMPDIR /var/tmp
DBRELOAD 60
TRANSPARENT true
FORWARDED_IP true
PARENTPROXY 127.0.0.1
PARENTPORT 3128
PORT 8080
BIND_ADDRESS 192.168.0.253
TEMPLATEPATH /etc/havp/templates/en
ENABLECLAMLIB true
CLAMDBDIR /var/lib/clamav
ENABLECLAMD false
ENABLEFPROT false
ENABLEAVG false
ENABLEAVESERVER false
ENABLESOPHIE false
ENABLETROPHIE false
ENABLENOD32 false
ENABLEAVAST false
ENABLEARCAVIR false
ENABLEDRWEB false

5. Make sure the rules in the IPTables NAT in this case as step 1, at least as the following lines. If the IPTables NAT rule to redirect port prior to 3128, please change it to 8080.

~# iptables -t nat -A PREROUTING -j REDIRECT -p tcp -i eth0 -s 192.168.0.0/24 –dport 80 –to-ports 8080
~# iptables -t nat -A POSTROUTING -j MASQUERADE -p tcp -s 192.168.0.0/24 -o eth1

6. Restart Squid and HAVP service.

~# squid -k reconfigure
~# /etc/init.d/havp force-reload
– or –
~# /etc/init.d/squid restart
~# /etc/init.d/havp restart

7. Finish.

*) Don’t forget to open tcp ports 80 & 8080.

In this article, I use Ubuntu Server 8.04 LTS, Squid 2.6, HAVP 0.89, and ClamAV 0.94.2.
For more information, please visit the website at http://www.server-side.de.

Advertisements

One Response to “Configuring Squid & HAVP(ClamAV) in Ubuntu : Example #2”

  1. Thouddide Says:

    i very love your writing taste, very attractive,
    don’t quit and keep writing due to the fact it simply just worth to follow it,
    impatient to look into way more of your own content pieces, enjoy your day 😉


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: