mkdir cache1 cache1
chown -R squid.squid cache1 cache2 var
cache_swap_low 75
cache_swap_high 98
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h"
access_log /opt/web-squid/var/logs/access.log combined
redirect_rewrites_host_header off
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow all
cache_effective_group squid
cache_dir aufs /opt/web-squid/cache1 50 32 64
cache_dir aufs /opt/web-squid/cache2 50 32 64
cache_log /opt/web-squid/var/logs/cache.log
cache_store_log none
cache_swap_log /opt/web-squid/var/logs/swap.log
log_ip_on_direct on
pid_filename /opt/web-squid/var/logs/squid.pid
visible_hostname testwebsquid
logfile_rotate 5
安� Clam AntiVirus
首先从http://www.clamav.net/下载clamav0.90包
wget http://aarnet.dl.sourceforge.net/project/clamav/clamav/0.96.3/clamav-0.96.3.tar.gz #这个是官方最新的。
./configure
make
make install
从http://www.server-side.de/download.htm下载
wget http://www.server-side.de/download/havp-0.92.tar.gz #目前最新版
make
make install
#REMOVETHISLINE deleteme
ENABLECLAMLIB true
CLAMDBDIR /var/lib/clamav
ENABLECLAMD true
CLAMDSOCKET /tmp/clamd
SERVERNUMBER 40
MAXSERVERS 200
LOGLEVEL 0
SCANIMAGES false
### 这个是havp的监听端口,默认是8080,因为8080是tomcat的默认端口,所以我改成3129了,
PORT=3129
mount -o mand /dev/ram0 /var/tmp/havp
mkfs.ext2 /root/havp_tmp.img
mount -o loop,mand /root/havp_tmp.img /var/tmp/havp
ldconfig
加入如下两行
cache_peer_access 127.0.0.1 allow all
使用squid做代理然后去http://www.eicar.org/anti_virus_test_file.htm这个网站进行测试吧
您只要使用 ClamAV 的 freshclam �更新 ClamAV 的病毒�就行了,
方法如下:
以 crontab 排程: 0 0 * * * /usr/local/bin/freshclam --verbose(每天午夜更新病毒�)
vi /usr/local/clamav/etc/freshclam.conf
##
## Example config file for freshclam
## Please read the clamav.conf(5) manual before editing this file.
## This file may be optionally merged with clamav.conf.
##
# You can change the default database directory here.
#DatabaseDirectory /var/lib/clamav
# Path to the log file (make sure it has proper permissions)
UpdateLogFile /var/log/freshclam.log
# Enable verbose logging.
LogVerbose
# Use system logger (can work together with UpdateLogFile).
LogSyslog
# By default when freshclam is started by root it drops privileges and
# switches to the "clamav" user. You can change this behaviour here.
#DatabaseOwner clamav
# The main database mirror is database.clamav.net (this is a round-robin
# DNS that points to many mirrors on the world) and in most cases you
# SHOULD NOT change it.
DatabaseMirror database.clamav.net
# How many attempts to make before giving up.
MaxAttempts 3
# How often check for a new database. We suggest checking for it every
# two hours.
Checks 12
# Proxy settings
#HTTPProxyServer myproxy.com
#HTTPProxyPort 1234
#HTTPProxyUsername myusername
#HTTPProxyPassword mypass
# Send the RELOAD command to clamd.
#NotifyClamd [/optional/config/file/path]
# Run command after database update.
#OnUpdateExecute command
# Run command if database update failed.
#OnErrorExecute command