Sie sind auf Seite 1von 6

5/13/13

ClamAV - Updating Version - Zimbra :: Wiki

Zimbra
the leader in open source email and collaboration
Search

User Help | Forums | Blog | Contact Us | Buy Zimbra Learn Products Community Support Partners Downloads About

ClamAV - Updating Version


From Zimbra :: Wiki
- This article is a community contribution and may include unsupported customizations for network edition customers.

Contents
1 Background 2 Notes 3 Noticing Out-of-Date 4 Updating 5 Scripting 6 Related Articles

Article Information
T his article applies to the following ZCS versions.

ZCS 5.0

Background
Zimbra updates the ClamAV engine to latest with every release of ZCS. ClamAV Virus definitions update automatically every 2h by default (zimbraVirusDefinitionsUpdateFrequency attribute). However, there are times when you may want the latest package.

Notes
Some good tips for troubleshooting can be found in ClamAV - Reset Defs DB Definitions in n ZCS 5.0.3+ were moved to a data directory to keep separate from application data, replace applicable with:
/ o p t / z i m b r a / d a t a / c l a m a v / d b

Out of cycle updates RFE is Bug 15137 (http://bugzilla.zimbra.com/show_bug.cgi?id=15137) http://wiki.zimbra.com/wiki/ClamAV_-_Updating_clamd_for_releases_earlier_than_ZCS_5.0.16 http://wiki.zimbra.com/wiki/ClamAV_-_Updating_from_versions_lower_than_0.90.0 Original directions courtesy of Unilogic (http://www.zimbra.com/forums/members/Unilogic.html) . If you have no idea how to upgrade or are a little shaky in doing the upgrade yourself, I recommend that you wait for the Zimbra official release.
wiki.zimbra.com/wiki/ClamAV_-_Updating_Version 1/6

5/13/13

ClamAV - Updating Version - Zimbra :: Wiki

Step 1: Make a backup. Note: This was done on Fedora Core 4 minimal install. Also, all the following can be done either as root or as the zimbra user. If you do it all as 'root', make sure you change ownership for the resulting clamav-0.90.2 folder in /opt/zimbra to zimbra:zimbra. This HOWTO also assumes that you are upgrading from 0.90.1 to 0.90.2 Please substitute the versions above for what you are upgrading from and to. If upgrading from anything below 0.90.x, please refer to: ClamAV - Updating from versions lower than 0.90.0

Noticing Out-of-Date
When ClamAV releases a new version and gets out of date, it will complain in its log files as such. clamd.log shows the following warning:
L i b C l a m A VW a r n i n g :* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * L i b C l a m A VW a r n i n g :* * * T h i sv e r s i o no ft h eC l a m A Ve n g i n ei so u t d a t e d . * * * L i b C l a m A VW a r n i n g :* * *D O N ' TP A N I C !R e a dh t t p : / / w w w . c l a m a v . n e t / f a q . h t m l* * * L i b C l a m A VW a r n i n g :* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

freshclam.log shows the following warning:


R e c e i v e ds i g n a l :w a k eu p C l a m A Vu p d a t ep r o c e s ss t a r t e da tF r iM a y41 5 : 4 4 : 4 62 0 0 7 W A R N I N G :Y o u rC l a m A Vi n s t a l l a t i o ni sO U T D A T E D ! W A R N I N G :L o c a lv e r s i o n :0 . 9 0 . 1R e c o m m e n d e dv e r s i o n :0 . 9 0 . 2 D O N ' TP A N I C !R e a dh t t p : / / w w w . c l a m a v . n e t / f a q . h t m l m a i n . c v di su pt od a t e( v e r s i o n :4 2 ,s i g s :8 3 9 5 1 ,f l e v e l :1 0 ,b u i l d e r :t k o j m ) W A R N I N G :Y o u rC l a m A Vi n s t a l l a t i o ni sO U T D A T E D ! W A R N I N G :C u r r e n tf u n c t i o n a l i t yl e v e l=9 ,r e c o m m e n d e d=1 0 D O N ' TP A N I C !R e a dh t t p : / / w w w . c l a m a v . n e t / f a q . h t m l d a i l y . c v di su pt od a t e( v e r s i o n :2 5 8 0 ,s i g s :7 8 7 9 ,f l e v e l :1 3 ,b u i l d e r :c c o r d e s ) W A R N I N G :Y o u rC l a m A Vi n s t a l l a t i o ni sO U T D A T E D ! W A R N I N G :C u r r e n tf u n c t i o n a l i t yl e v e l=9 ,r e c o m m e n d e d=1 3 D O N ' TP A N I C !R e a dh t t p : / / w w w . c l a m a v . n e t / f a q . h t m l

Updating
To update, follow the following: First go grab the latest ClamAV source from http://www.clamav.net/download (Current Stable Version is 0.96 ) Extract it to where ever you please. All this can either be done as root or as the zimbra user. If you do it all as root make sure you change ownership for the resulting clamav folder in /opt/zimbra to zimbra:zimbra. Assuming that the new clamav version is in the directory: /home/snelson ( substitute your username for 'snelson' ) tar -xvf clamav-0.96.tar.gz cd clamav-0.96 Next run configure inside of the clamav extract as following: ./configure --prefix=/opt/zimbra/clamav-0.96 --with-user=zimbra --with-group=zimbra This assumes 'zimbra' is user and group id 'zimbra', change it accordingly to your system to match your zimbra user. Note: I had to install gmp-devel and bzip2-devel so the configure could find all its header files. Your mileage may very. If you get an error about GNU MP missing install gmp-devel. "yum install gmp-devel", and "yum install bzip2-devel" in Fedora and Red Hat. If your 'configure' goes well, and make sure it does as you don't really want ClamAV installed without some of its available testing ability being compiled. Run: make The following steps should be run as root. Assuming there are no errors, Run: make check and then make install. Again assuming no errors, you now have the new version installed into /opt/zimbra/clamav-0.96 Now we compare then copy your old clamd.conf and freshclam.conf from the previous version to the new version directory: cd /opt/zimbra/clamav-0.96/etc/
wiki.zimbra.com/wiki/ClamAV_-_Updating_Version 2/6

5/13/13

ClamAV - Updating Version - Zimbra :: Wiki

diff clamd.conf ../../clamav/etc/clamd.conf diff freshclam.conf ../../clamav/etc/freshclam.conf Above is just incase you are curious of what we are changing/over writing from the clamav defaults. mv clamd.conf clamd.conf.org mv freshclam.conf freshclam.conf.org cd /opt/zimbra/conf cp clamd.conf /opt/zimbra/clamav-0.96/etc/ cp freshclam.conf /opt/zimbra/clamav-0.96/etc/

As zimbra: zmcontrol stop to stop Zimbra. Now need to delete the symbolic link and re-link it to the new install. As root:

cd /opt/zimbra ls -la | grep clamav ( should see 'clamav -> /path/to/previous_clamAV' ) if so: rm -rf clamav (or if you want to keep the old install & link around, so you can easily back out, just do mv clamav clamav.old) ln -s /opt/zimbra/clamav-0.96 /opt/zimbra/clamav Create directory /opt/zimbra/clamav/db mkdir /opt/zimbra/clamav/db Now you should make sure zimbra owns all of clamav. chown -R zimbra:zimbra /opt/zimbra/clamav-0.96 zimbra also needs access to freshclam.conf chmod a+r /opt/zimbra/clamav/etc/freshclam.conf Next we need to update the virus database. su zimbra Run: /opt/zimbra/clamav/bin/freshclam If you get any warnings, just run the command again to confirm that everything was successfully updated. Need to start Zimbra. Run zmcontrol start Note: you may not need to stop Zimbra during this update. If you don't stop Zimbra, just do zmantivirusctl restart at this point. Run zmcontrol status to make sure antivirus is running. If it is, you're good to go. You should check /opt/zimbra/log/clamd.log for errors, as well as freshclam in the same directory. Also /var/log/zimbra.log. To test out ClamAV I would suggest http://www.webmail.us/testvirus to send different variations of the EICAR test virus to one of your email addresses. Depending on if you have "Send notice ot recipient" check in Global Settings of the Admin Web UI, the user should receive around 20 email notifications of the emails being quarantined. Don't worry about the two that got through. Apparently ClamAV doesn't check for the techniques. There are although no virii included in those two emails, so it doesn't worry me. You can delete the previous install of clamav once you make sure everything is working. Delete the /opt/zimbra/clamav-0.90.1 directory and everythnig it contains. Again may want to wait a weelk or two to make sure you have the other version working well first.

Scripting
wiki.zimbra.com/wiki/ClamAV_-_Updating_Version 3/6

5/13/13

ClamAV - Updating Version - Zimbra :: Wiki

Possible Script: (tweaked and tested on a CentOS server as of July 14, 2010)
# ! / b i n / b a s h # # # ! ! ! ! ! !W A R N I N G! ! ! ! ! ! ! ! ! ! # T h i ss c r i p ti sa b s o l u t e l yu n t e s t e d . Iw r o t ei ta f t e rt h ef a c t # a sr e f e r e n c e ,f o rt h en e x tt i m et h i sh a p p e n s . Ir e p e a tIh a v e # n o ta c t u a l l yt e s t e dt os e ei fi te v e nr u n s . Y o up r o b a b l yw a n t # t oj u s tr u nt h r o u g ht h es t e p sm a n u a l l yt op r e v e n th a r m i n gy o u r # s y s t e m . . . A g a i n ,t h i ss c r i p tt o o k2m i n u t e st ow r i t e ,a n dh a s # n e v e rb e e nt e s t e d ,a n dt h e r ea b s o l u t e l yn oe r r o rc h e c k i n g . # # O t h e r w i s e ,i fy o ur e a l l yw a n tt or u ni t ,u n c o m m e n tt h ee x i t # s t a t e m e n t . # # [ h t t p : / / w w w . z i m b r a . c o m / f o r u m s / m e m b e r s / a r t i m u s . h t m la r t i m u s ] -2 0 0 7 1 1 1 9u p d a t e sb yo t h e r s2 0 0 7 1 2 0 6 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # e x i t N O W = ` d a t e+ % Y % m % d % H % M % S ` B U I L D D I R = $ { N O W } _ c l a m a v _ b u i l d C l a m V e r = " c l a m a v 0 . 9 6 . 1 " C l a m U R L = " h t t p : / / e a s y n e w s . d l . s o u r c e f o r g e . n e t / s o u r c e f o r g e / c l a m a v / c l a m a v 0 . 9 6 . 1 . t a r . g z " e c h o" I n s t a l l i n gd e p e n d e n c i e si fn e c e s s a r y " y u myi n s t a l lg c cg l i b cz l i b d e v e lg m p d e v e lb z i p 2 d e v e l #o nD e b i a n / U b u n t uu s e :a p t g e tb u i l d d e pc l a m a v #a p t g e tb u i l d d e pc l a m a v e c h o" P r e p a r i n gS o u r c e " m k d i r$ { B U I L D D I R }& &c d$ { B U I L D D I R } w g e t$ { C l a m U R L }

t a rz x v f$ { C l a m V e r } . t a r . g z c d$ { C l a m V e r } e c h o" = = = =B u i l d i n ga n dI n s t a l l i n gC l a m A V= = = = " . / c o n f i g u r ep r e f i x = / o p t / z i m b r a / $ { C l a m V e r }w i t h u s e r = z i m b r aw i t h g r o u p = z i m b r a m a k e& &m a k ec h e c k& &m a k ei n s t a l l

c h o w nRz i m b r a : z i m b r a/ o p t / z i m b r a / $ { C l a m V e r } c d/ o p t / z i m b r a / $ { C l a m V e r } / e t c m vc l a m d . c o n fc l a m d . c o n f . o r i g m vf r e s h c l a m . c o n ff r e s h c l a m . c o n f . o r i g c p/ o p t / z i m b r a / c o n f / c l a m d . c o n f. c p/ o p t / z i m b r a / c o n f / f r e s h c l a m . c o n f. c h o w nz i m b r a : z i m b r a* . c o n f

s u d ouz i m b r a/ o p t / z i m b r a / b i n / z m c o n t r o ls t o p c d/ o p t / z i m b r a u n l i n kc l a m a v l ns$ { C l a m V e r }c l a m a v

e c h o" = = = =F r e s h e n= = = = = = = = = " s u d ouz i m b r a/ o p t / z i m b r a / c l a m a v / b i n / f r e s h c l a m

e c h o" = = = = =S t a r t i n gZ i m b r a= = = = = = = " e c h o"I fi td o e s n ' tw o r k ,t r yar e b o o t " s u d ouz i m b r a/ o p t / z i m b r a / b i n / z m c o n t r o ls t a r t

Related Articles
ClamAV - Updating from versions lower than 0.90.0

Verified Against: unknown Article ID: http://wiki.zimbra.com/index.php?title=ClamAV_-_Updating_Version Retrieved from "http://wiki.zimbra.com/index.php?title=ClamAV_-_Updating_Version&oldid=21652" Categories: Administration ZCS 5.0 Anti-virus
wiki.zimbra.com/wiki/ClamAV_-_Updating_Version

Date Created: 5/6/2007 Date Modified: 11/17/2010

4/6

5/13/13

ClamAV - Updating Version - Zimbra :: Wiki

Zimbra.com | Popular Searches | About Zimbra

Learn
What is Zimbra? Benefits Demos and Videos Industry Solutions Customers Case Studies Awards

Products
Zimbra Collaboration Server Zimbra Cloud and Virtualization Zimbra Open Source Zimbra Desktop Compare Products Pricing Whats New Downloads

Community
Forums Documentation Wiki Blog Gallery Submit Bug Release Status Developer Zone Contribute

Support
Zimbra Support Program Overview User Help Zimbra Customer Support Portal

Partners
Zimbra Hosting Providers Zimbra VARs Zimbra Training Providers Resources For Partners

About
Careers News Events Webinars Media Contact Us Twitter
wiki.zimbra.com/wiki/ClamAV_-_Updating_Version 5/6

5/13/13

ClamAV - Updating Version - Zimbra :: Wiki

LinkedIn Facebook Email Software Email Hosting Zimbra Mail Server Email Archiving and Compliance Software Calendar and Collaboration Microsoft Outlook Alternative Zimbra for BlackBerry & iPhone Secure Email & Anti Spam Unified Messaging Zimbra is open source server software for email and collaboration - email, group calendar, contacts, instant messaging, file storage and web document management. The Zimbra email and calendar server is available for Linux, Mac OS X and virtualization platforms. Zimbra syncs to smartphones (iPhone, BlackBerry) and desktop clients like Outlook and Thunderbird. Zimbra also features archiving and discovery for compliance. Zimbra can be deployed onpremises or as a hosted email solution. Zimbra Desktop is a free email and calendar client which runs on any Windows, Apple or Linux desktop computer. It works online and offline and works with any POP or IMAP email account as well as Yahoo! Mail.

wiki.zimbra.com/wiki/ClamAV_-_Updating_Version

6/6

Das könnte Ihnen auch gefallen