|
||||||||||||||||||||||||
Part
14 - Clam Antivirus & SpamAssassin |
||||||||||||||||||||||||
Alright, the next 2 steps are going to be the trickiest of the entire installation. First, on this page, we're going to install Clam Antivirus and Spamassassin. Then, on the next page, we will install qmail-scanner which will tie ClamAV and Spamassassin into the operation of our qmail server. I'm going to warn you again that these next two steps are typically a pain in the ass. I am constantly trying to make these steps as universal and easy as possible, but the ease of these steps depends heavily on how your system is configured and how experienced you are. If you've never done this before, you can pretty much bet you're going to have a problem or 2 along the way. But don't give up. If you get into a bind, feel free to consult the qmailrocks mailing list, mailing list archive, IRC channel or chat forum. Using these 4 resources, you've got an excellent chance of getting any help you may need. OK, it's time to put some hair on your chest! First, let's make sure you have all the required perl modules and required packages. All of the perl modules below are required for Spamassassin and Qmail-Scanner to work. I'll talk more about this further down in the install. The following Perl Modules/packages are required: Digest::SHA1 You will also need these other packages: perl-suid
Ok, so at this point you should have all 4 of the above Perl modules installed on your system. So let's install Clam Anti Virus and then Spammassin.. Installing Clam Anti Virus.. cd /downloads/qmailrocks/ tar zxvf clamav-x.xx..tar.gz cd clamav-x.xx useradd -s /sbin/nologin -d /tmp clamav groupadd clamav useradd -s /sbin/nologin -d /bin/false qscand groupadd qscand ./configure --prefix=/usr --sysconfdir=/etc make && make check && make install mkdir /var/log/clamav /var/lib/clamav chown -R clamav:clamav /var/log/clamav /var/lib/clamav Now we'll do a few configuration settings to the /etc/clamd.conf file... vi /etc/clamd.conf "Example" - should be commented out. And some settings to the /etc/freshclam.conf file... vi /etc/freshclam.conf "Example" - should be commented out. Ok, Clam AV is now installed, but let's go ahead and set it up so that it will auto-update every night with the latest virus definitions! First we will want to set up the proper logging for the updater.... /usr/bin/freshclam -l /var/log/clamav/clam-update.log If the server is able to get updates, you should see an output similar to this: ClamAV update process started at Thu Dec 16 16:14:51 2004 Woohoo! You're updated with the latest virus definiations from the Clam database! Now we just set a crontab to run every night, which will run the auto-update procedure! In the example below, I've set mine to run every day at 1:35 AM. The odd run time came reccomended from ClamAV, if you're wondering. Running freshclam at times other than the top of an hour reduces the load on their servers. so feel free to adjust the time to something even more offbeat, like 1:33 AM or something. The guys at ClamAV will thank you. crontab -e (make sure you run this command as root) 35 1 * * * /usr/bin/freshclam --quiet -l /var/log/clamav/clam-update.log Now save your new crontab and exit. Now we need to create an init script for clamd... cp /downloads/qmailrocks/scripts/misc/debian_clamd /etc/init.d/clamd mkdir /var/run/clamav chown -R qscand:qscand /var/run/clamav And now let's crank up clamd... /etc/init.d/clamd stop /etc/init.d/clamd start If clamd has started successfully, a "ps -aux | grep clamd " command should reveal it... qscand 11613 0.0 0.5 5972 4984 ? S 07:17 0:00 /usr/sbin/clamd Once you have clamd successfully operating, let's configure the server so that clamd will start up on boot. Fortunately, Debian has a utility made just for doing this.. update-rc.d clamd start 75 2 3 4 5 . The above command should create the needed init symlinks for the 2, 3, 4 and 5 runlevels. You're all set! We're all done with Clam AV. Now let's install SpamAssassin... cd /downloads/qmailrocks tar zxvf Mail-SpamAssassin-3.0.2.tar.gz cd Mail-SpamAssassin-3.0.2 perl Makefile.PL (answer all questions. Use the default answers provided if you are unsure) make && make install Ok, Spamassassin is installed. Let's make some tweaks. First, we're going to add a user/group called "spamd" under which Spamassassin will be run... groupadd spamd useradd -g spamd -s /bin/false -m -d /home/spamassassin spamd Next, we set the spam threshold value and rewrite subject variable... vi /etc/mail/spamassassin/local.cf Replace the contents of the local.cf file with the following config settings: rewrite_subject 1 Save and exit from the file. And now, let's put a Spamassassin startup script in place... cp /downloads/qmailrocks/scripts/misc/debian_spamd /etc/init.d/spamd mkdir /var/run/spamd chown -R spamd:spamd /var/run/spamd The init script contains a variable specifying the location of spamd. Let's make sure it's correct. First, find out where spamd resides... whereis spamd You should get an answer like /usr/local/bin/spamd or /usr/bin/spamd or something like that. Make a note of where spamd is located. Now, open the /etc/init/dspamd init script for editing.... vi /etc/init.d/spamd Make sure that the following variable reflect the correct location of spamd: DAEMON=/correct/path/to/spamd And now let's crank up Spamassassin... /etc/init.d/spamd stop /etc/init.d/spamd start If spamd has started successfully, a "ps -aux | grep spam " command should reveal it... spamd 283 0.0 2.1 21152 19328 ? S 04:33 0:01 /usr/local/bin/spamd -x -u spamd -H /home/spamd -d --pidfile=/var/run/spamd/spamd.pid Once you have spamassin successfully operating, let's configure the server so that spamd will start up on boot. We'll do this just like we did with clamd... update-rc.d spamd start 75 2 3 4 5 . The above command should create the needed init symlinks for the 2, 3, 4 and 5 runlevels. You're all set! If all has gone well, both Spamassassin and Clam Anti Virus should now be installed! With both of these programs installed, we can now install qmail-scanner. |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
home | about | the installation | utilities | faq | contact | journal | mailing list | list archive | forum | links | donate | merchandise |
||||||||||||||||||||||||
This mirror last modified:
Thursday, August 9th, 2012 15:58:50 CEST
|
||||||||||||||||||||||||