|
||||||||||||||||||||||||
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! The first thing you must do is make sure that you've got a recent version of Perl installed on your box. Using the command "perl -v" will typically tell you what version is running. Spamassassin 3, at least when I installed it, required Perl 5.8. If you're running something older than 5.8, you will likely need to upgrade. I'm not going to go into a great deal of detail into how to upgade Perl here, but I will tell you a little story that might help. My FreeBSD box was running a default 5.005 version of perl. Using the "pkg_delete" command, I removed that version. I then installed the new Perl 5.8 from the FreeBSD ports collection. After that, I ran the following command to instruct the system to use the ports installation of Perl from now on: use.perl port And viola! My box was now using the new 5.8 version of Perl. I hope you like my little story. Once you've got the right version of Perl installed on your box, you will now want to verify that you have all the required Perl modules and packages that will enable Clam AV and Spamassassin to function correctly. The following Perl Modules/packages are required. If you find that I'm missing one here, let me know. Digest::SHA1
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 Spamassassin. Installing Clam Anti Virus... cd /downloads/qmailrocks/ tar zxvf clamav-x.xx.tar.gz cd clamav-x.xx pw useradd clamav -s /sbin/nologin -d /tmp pw useradd qscand -s /sbin/nologin -d /tmp ./configure make && make check && make install && make clean Now we'll do a few configuration settings to the /usr/local/etc/clamd.conf file. This file won't get use much, since we aren't going be using the daemonized version of ClamAV, but it does get accessed occasionally by other processes. vi /usr/local/etc/clamd.conf "Example" - needs be commented out. If it is not, make sure that it is commented out (#) vi /usr/local/etc/freshclam.conf "Example" - needs be commented out. If it is not, make sure that it is commented out (#) vi /usr/local/etc/rc.d/clamd.sh #!/bin/sh FOO_BIN=/usr/local/sbin/clamd case "$1" in ;; ;; ;; chmod 755 /usr/local/etc/rc.d/clamd.sh /usr/local/etc/rc.d/clamd.sh start 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/local/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: [root@crescent clamav]# freshclam -l /var/log/clamav/clamav-update.log 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:40 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:42 AM or something. The guys at ClamAV will thank you. crontab -e (make sure you run this command as root) 40 1* * * /usr/local/bin/freshclam --quiet -l /var/log/clamav/clam-update.log Now save your new crontab and exit. That's it! We're all done with Clam Anti Virus! You will now have a server-wide e-mail virus scanner that updates itself every night with the latest and greatest virus definitions! Now we install SpamAssassin... cd /downloads/qmailrocks Install most current version of SpamAssassin using the pkg_add utility... pkg_add -r Mail-SpamAssassin If you are unable to getch SpamAssassin in the above command, I've included a copy of the package in the qmailrocks bundle. I'm so nice. pkg_add p5-Mail-SpamAssassin-3.0.1_2.tgz Note: Alternatively, if you're a source junkie, I've included a tarball of Spamassassin 3.01 in the qmailrocks bundle. SpamAssassin is now installed, so let's configure it... cd /usr/local/etc/mail/spamassassin cp local.cf.sample local.cf vi local.cf Make sure the following lines exist and are not commented out. rewrite_subject 1 Now save and exit out of the file. And now we will configure the server to start SpamAssassin on boot: vi /etc/rc.conf Add the following line: spamd_enable="YES" Now save and exit out of the file. Start up SpamAssassin: /usr/local/etc/rc.d/sa-spamd.sh start and check the status to make sure it's running: /usr/local/etc/rc.d/sa-spamd.sh status If spamd is runnign correctly, you should get an status output like this: spamd is running as pid 65467 65470 65471 65472 65473 65474. If all has gone well, both Spamassassin and Clam Anti Virus should now be installed and SpamAssassin should be running. 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:59:20 CEST
|
||||||||||||||||||||||||