Howto Install Samba Plus Support Clamav

Posted on Updated on


Hanya mendokumentasikan tutorial dari Pak Arief Yudhawarman

Fedora Core 3 : Howto Install samba plus support clamav.

A. CLAMAV

Preparing
———
Clamav need zlib newer than package's zlib from FC3.
# cd /usr/local/src
# tar zxf zlib-1.2.3.tar.gz
# ./configure –prefix=/usr/local/zlib
# make && make install

adduser
———
# groupadd clamav
# useradd -g clamav -d /var/lib/clamav -s /bin/false -c 'ClamAV Antivirus Daemon' clamav

Configuring & Installing
————————
# cd /usr/local/src
# tar zxf clamav-0.88.tar.gz
# cd /usr/local/src/clamav-0.88
# ./configure –prefix=/usr/local/clamav –disable-clamuko –with-dbdir=/var/lib/clamav –with-zlib=/usr/local/zlib/
# make && make check && make install && make clean

Symbolic link
————-
# mkdir /var/run/clamav
# chown clamav.clamav /var/run/clamav
# cd /etc/
# ln -s /usr/local/clamav/etc/ clamav
# cd /usr/local/sbin/
# for i in /usr/local/clamav/sbin/*; do j=`basename $i`; ln -s $i $j; done
# cd /usr/local/bin
# for i in /usr/local/clamav/bin/*; do j=`basename $i`; ln -s $i $j; done
# cd /usr/local/lib
# for i in /usr/local/clamav/lib/*; do if [ -f $i ]; then j=`basename $i`; ln -s $i $j; fi; done
# cd /usr/local/include
# for i in /usr/local/clamav/include/*; do j=`basename $i`; ln -s $i $j; done

Man Path
——–
Just edit /etc/man.config and add this line:
MANPATH /usr/local/clamav/man

Edit clamd.conf & freshclam.conf

B. SAMBA

# cd /usr/local/src
# tar zxf /SRC/samba-3.0.21b.tar.gz
# cd samba-3.0.21b/source/
# ./autogen.sh
# ./configure –prefix=/usr/local/samba –with-smbmount –with-winbind
# make proto

B.1 SAMBA-VSCAN

B.1.2 Filetype support

FC3 already support filetype so these steps no needed
Supporting filetype (libmagic)
# cd /usr/local/src/
# tar zxvf /SRC/file-4.16.tar.gz
# cd file-4.16/
# ./configure –prefix=/usr/local/file && make && make check && make install
# echo '/usr/local/lib/' >> /etc/ld.so.conf
# ldconfig

# cd /usr/local/src
# tar jxf /SRC/samba-vscan-0.3.6b.tar.bz2
# cd samba-vscan-0.3.6b
# ./configure –with-samba-source=/usr/local/src/samba-3.0.21b/source/ –with-samba-version=3 –with-filetype
# make clamav
Do this when samba is already configured.
# cp vscan-clamav.so /etc/samba

# make
# make install

Configuring samba
—————–
# ln -s /usr/local/samba/lib/ /etc/samba
# cd /etc/samba

Edit smb.conf & vscan-clamav.conf

/etc/samba/smb.conf:

[temp]
comment = Temporary file space
path = /home/data/tmp
vfs object = vscan-clamav
vscan-clamav: config-file = /etc/samba/vscan-clamav.conf
read only = no
public = yes

/etc/samba/vscan-clamav.conf:
[samba-vscan]
max file size = 5000000
verbose file logging = no
scan on open = yes
scan on close = yes
deny access on error = yes
deny access on minor error = yes
send warning message = yes
infected file action = delete
quarantine directory = /tmp
quarantine prefix = vir-
max lru files entries = 100
lru file entry lifetime = 20
# these filetype below will not been scanned
# this's just a real example, add some wheen in need.
exclude file types = application/vnd.rn-realmedia;application/x-arc;application/x-archive;application/x-arj;application/x-awk;application/x-bittorrent;application/x-bzip2;application/x-compress;application/x-cpio;application/x-dbf;application/x-dbm;application/x-dv
clamd socket name = /var/run/clamav/clamd.sock
libclamav max files in archive = 1000
libclamav max archived file size = 10485760
libclamav max recursion level = 5
# cd /usr/local/bin/
# for i in /usr/local/samba/bin/*; do if [ -f $i ]; then j=`basename $i`; ln -s $i $j; fi; done
# cd /usr/local/include/
# for i in /usr/local/samba/include/*; do if [ -f $i ]; then j=`basename $i`; ln -s $i $j; fi; done
# cd /usr/local/sbin/
# for i in /usr/local/samba/sbin/*; do if [ -f $i ]; then j=`basename $i`; ln -s $i $j; fi; done

Man Path
——–
Just edit /etc/man.config and add this line: MANPATH /usr/local/samba/man

Library needed to mount smbfs
—————————
# cd /usr/local/lib
# ln -s /usr/local/samba/lib/libsmbclient.so libsmbclient.so
# ln -s /usr/local/samba/lib/libmsrpc.so libmsrpc.o
# cp /usr/local/src/samba-3.0.21b/source/bin/libsmbsharemodes.so /usr/local/lib
# cp /usr/local/src/samba-3.0.21b/source/nsswitch/libnss_winbind.so /usr/local/lib
# cp /usr/local/src/samba-3.0.21b/source/nsswitch/libnss_wins.so /usr/local/lib
# cd /lib/
# ln -sf /usr/local/lib/libnss_winbind.so libnss_winbind.so
# ln -sf /usr/local/lib/libnss_wins.so libnss_wins.so
# echo /usr/local/lib >> /etc/ld.so.conf
# ldconfig
# mkdir /var/log/samba

Start Samba
# mnbd -D && smbd -D

Make directory contains sample virus on folder Public & do some test to copy
the viruses into folder docs.

One thought on “Howto Install Samba Plus Support Clamav

    Anonymous said:
    May 29, 2006 at 5:41 pm

    Google

    Google news and reviews

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s