Installing DrWEB server antivirus for Linux CPanel

Discussion in 'Security' started by sendemi, Aug 18, 2010.

  1. #1
    This document is a straightforward step-by-step instruction on how to install DrWEB antivirus on Linux server running CPanel.

    I. Doing backups

    Following files are need to be saved:
    /etc/exim.conf

    /etc/antivirus.exim or

    system_filter.exim>


    II. Installing DrWEB

    First, download DrWEB antivirus RPM package from here
    http://www.sald.com/get.html

    Install it using rpm -Uvh command. For example, for glibc 2.3 use
    # rpm -Uvh ftp://ftp.drweb.ru/pub/unix/drweb-4.30-glibc.2.3.i586.rpm

    Start drweb daemon using command
    # /opt/drweb/drwebd start

    Now lets take care about automatic antivirus databases updates.
    Add the following cron job:
    00 12 * * * /opt/drweb/update/update.pl


    III. Installing and configuring DrWEB-Exim

    Download drweb-exim from http://www.sald.com/get.html

    Untar tgz archive.
    For example,
    tar xzvf drweb-exim-4.29.12-F-linux.tar.gz

    Article provided by WebHostGear.com

    Now we need to copy drweb-exim files to proper directories.

    # cp -r drweb-exim/etc/drweb/* /etc/drweb/
    # cp -r drweb-exim/opt/drweb/doc/* /opt/drweb/doc/
    # cp -r drweb-exim/opt/drweb/drweb-* /opt/drweb/


    Edit /etc/drweb/drweb_exim.conf

    Change

    AdminMail = postmaster>
    to

    AdminMail = >

    Lets test how it works so far:
    # /opt/drweb/drweb-exim --check_only --check_user=drweb
    All tests should be "passed".


    IV. Configuring Exim

    We need to make changes in two files to make drweb and exim work together.
    First, edit /etc/exim.conf
    Black are lines which we will need to add.


    ###### begin exim.conf ########

    [skipped]>

    ###########################
    # Runtime configuration file for Exim #
    ###########################

    trusted_users = drweb
    trusted_groups = drweb

    [skipped]


    #!!# message_filter renamed system_filter
    system_filter = /etc/antivirus.exim
    message_body_visible = 5000

    >system_filter_pipe_transport = filter_pipe
    system_filter_reply_transport = address_reply

    [skipped]

    ###########################
    # TRANSPORTS CONFIGURATION #
    ########################### ORDER DOES NOT MATTER #
    # Only one appropriate transport is called for each delivery. #
    ############################ A transport is used only when referenced from a director or a router that
    # successfully handles an address.

    # This transport is used for delivering messages over SMTP connections.

    begin transports

    filter_pipe:
    driver = pipe
    user = drweb
    group = mail
    return_fail_output

    >

    ###### end exim.conf ########>


    CPanel comes with /etc/antivirus.exim filter file.
    In clean Exim install it is called system_filter.exim

    Add the following at the end of the file:

    ###### begin antivirus.exim #######>>

    # to prevent from mail loop, skip already scanned message
    if $received_protocol is "drweb-scanned"
    then
    finish
    endif


    >pipe "/opt/drweb/drweb-exim -f $sender_address -- $recipients"


    >>finish



    ###### end antivirus.exim ########>>


    V. Restart Exim and test virus checking

    Thats it with configuration.
    Now restart exim:
    # /etc/rc.d/init.d/exim restart
    and test your email delivery.
    If email is not going through, inspect /var/logs/exim_mainlog and /var/logs/exim_paniclog
    Gönderen Levent Cengiz zaman: 3:13 PM 0 yorum
    Etiketler: cpanel, drweb, install
    Changing Your Sites MX Record
    Change the MX record of your website HOWTO is an easy guide for modifying your MX record to direct mail from one mail server to another for Cpanel users. The MX record, short for mail exchange record, an MX Record is an entry in a domain name database that identifies the mail server that is responsible for handling e-mail for that domain name.

    Basically you can have one server handle your website and another handle your email, such as Cpanel for the site and a Windows Exchange machine for mail if you want. You can also have multiple MX records so mail can go to more than one server and order them in priority by number, the lowest number will receive mail first but more on that later.

    Requirements: Cpanel server with admin access

    Cpanel MX Record - How to change your MX record

    First off there are a few different ways to change your websites MX record. If you are not a server administrator then you have limits to doing this and may need to contact your system admin to have them set this up for you. As a regular Cpanel user you can only add one mx record and can't set any type of priority on it, secondly you cannot set a MX record as an IP address. You'll need to contact the admin once again. Otherwise go to Cpanel, Mail, MX record and enter the full domain of the server you want mail to go to and it will do the rest.

    Article provided by WebHostGear.com


    Advanced MX Changes - CHANGE TO IP ADDRESS


    1) Login to the server WHM as the root user.

    2) Go to DNS Functions and Edit DNS Zone
    Edit DNS Zone

    3) Select the domain you want to edit, or type it in, and click on Edit.

    4) You should see the following, or something very close to it:

    Edit DNS Zone MX

    5) Now the MX has a priority of 0 meaning its the only MX entry used for the domain. Replace the domainame.com. with mail.domainame.com.

    6) Now change mail from CNAME to A record and take out the domain, and replace it with the IP address.

    WHM edit dns mx

    7) Save the changes. Bind will reload, if it shows any errors then you did something wrong, make sure the MX entry has a . after it!

    8) Login to your server by shell as the root user. Edit the /etc/localdomains file
    pico /etc/localdomains then ctrl+w to and type in the domain you modified.
    Delete the entry for the domain.
    Save the changes to the file, ctrl+x then Y

    9) Edit the /etc/remotedomains file - this tells Exim to not handle mail for this domain.
    pico /etc/remotedomains
    Add the domain name to this file.
    Save the changes.

    10) Your now done! Make sure you dns is updated, in shell run:
    host -t mx domainname.com

    You should see mail.domainname.com
     
    sendemi, Aug 18, 2010 IP
  2. CaNeRiuM

    CaNeRiuM Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    thanks information
     
    CaNeRiuM, Aug 27, 2010 IP