In a computer network, the average client uses the Windows operating system, mostly of them have an antivirus program on their computer for data security reason. We can imagine if there are 10 clients updating their antivirus programs at the same time, automatic Internet connection will be affected for this task. This usually happens because most users after installing these antivirus programs by default settings given, they rarely make changes to the program settings, especially when updating the antivirus.
That’s why to save the internet bandwidth; I try to make my own local antivirus update server. Because the existing server in my network is using Ubuntu Server operating system 9.04, so for simplicity I installing antivirus that could work and was supported by Ubuntu Server, it was ClamAV. To start configuring the server, at least we already have OpenSSH and LAMP server in it and ClamAV of course. With a slight change in our freshclam.conf script can change the number of times ClamAV update every day. For that we type the following command line:
# vi /etc/clamav/freshclam.conf
Find the following lines:
# Check for new database 24 times a day
Checks 24
The number can be changed in accordance with our desire, if the number is 24 that means ClamAV will update as much as 24 times in a day or every 30 minutes. Then we can schedule the copying of files updated ClamAV (main.cvd and daily.cvd) that located in /var/lib/clamav to the folder that can be accessed by clients via http, here I try to copy them to the folder /htdocs/clamav_upd. For that we create a script that I give the name clam_upd.sh that contains the command line below:
#!/bin/bash
cd /var/lib/clamav
cp main.cvd /htdocs/clamav_upd/
cp daily.cvd /htdocs/clamav_upd/
Furthermore we make a script to retrieve update ‘thru the day’ virus updates. I give the name clam_ver.sh that containing the following command line:
#!/bin/bash
cd /tmp
ver=`host -t txt current.cvd.clamav.net > /tmp/version.txt && awk -F”:” ‘{print $3}’ /tmp/version.txt`
dl=”daily-$ver.cdiff”
wget http://db.clamav.or.id/$dl
mv /tmp/$dl /htdocs/clamav_upd/
Then we make cron jobs to perform the execution of the script on Ubuntu Server:
30 23 * * * bash /home/user/clam_upd.sh
15 * * * * bash /home/user/clam_ver.sh
Server will do update ‘thru the day’ every 15 minutes, every hour, every day and copy both daily.cvd and main.cvd files at 23:30 each a day. The last step changes the update address on ClamWin client to the server IP address (e.g. 192.168.111.1). Done.






Related Articles
3 users responded in this post
I hope this was a very interesting post thanks for writing it
Your blog keeps getting better and better! Your older articles are not as good as newer ones you have a lot more creativity and originality now keep it up!
Hi,
Very nice information. Thanks for this.
Regards,
Jane
Leave A Reply
Please Note: Comment moderation maybe active so there is no need to resubmit your comments