Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d00f97812ff32352182b54d5ffb3d519 > files > 55

clamav-0.102.4-1.mga7.armv7hl.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
  <link rel="stylesheet" href="/en/github.css" type="text/css" />
</head>
<body>
<h1 id="installation-on-debian-and-ubuntu-linux-distributions">Installation on Debian and Ubuntu Linux Distributions</h1>
<p>Below are the steps for installing ClamAV from source on Debian and Ubuntu Linux.</p>
<hr />
<h2 id="install-prerequisites">Install prerequisites</h2>
<ol>
<li>Install ClamAV dependencies
<ol>
<li>Install the developer tools<br />
<pre><br />
sudo apt-get install build-essential<br />
</pre></li>
<li>Install library dependencies<br />
<pre><br />
sudo apt-get install openssl libssl-dev libcurl4-openssl-dev zlib1g-dev libpng-dev libxml2-dev libjson-c-dev libbz2-dev libpcre3-dev ncurses-dev<br />
</pre></li>
<li>(very optional) Those wishing to use clamav-milter may wish to install the following<br />
<pre><br />
sudo apt-get install libmilter1.0.1 libmilter-dev<br />
</pre></li>
</ol></li>
<li>Install the unit testing dependencies<br />
<pre><br />
sudo apt-get install valgrind check check-devel<br />
</pre></li>
</ol>
<p><em>Note</em>: LLVM is also an optional dependency. LLVM will not provide any additional features, but is an alternative method for executing bytecode signatures versus using the built-in bytecode interpreter. Limited performance testing between LLVM and the bytecode interpreter did not yield conclusive evidence that one is &quot;better&quot; than the other. For the sake of simplicity, it is not recommended to install LLVM.</p>
<hr />
<h2 id="download-the-latest-stable-release">Download the latest stable release</h2>
<ol>
<li>Open a browser and navigate to <a href="https://www.clamav.net/downloads">the ClamAV downloads page</a></li>
<li>Click <code>clamav-&lt;version&gt;.tar.gz</code> link to download the latest stable release.</li>
</ol>
<hr />
<h2 id="extract-the-source-archive">Extract the source archive</h2>
<pre>
    cd ~/Downloads
    tar xzf clamav-[ver].tar.gz
    cd clamav-[ver]
</pre>
<hr />
<h2 id="configure-the-build">Configure the build</h2>
<p>ClamAV's configure script should detect each of the above dependencies automatically.</p>
<h3 id="typical-.configure-usage">Typical <code>./configure</code> usage</h3>
<pre>
    ./configure --enable-check
</pre>
<p>Once <code>./configure</code> completes, it will print a summary. Verify that the packages you installed are in fact being detected.</p>
<p>Example configure summary output:</p>
<pre>
    configure: Summary of detected features follows
                OS          : linux-gnu
                pthreads    : yes (-lpthread)
    configure: Summary of miscellaneous features
                check       : -lcheck_pic -pthread -lrt -lm -lsubunit
                fanotify    : yes
                fdpassing   : 1
                IPv6        : yes
    configure: Summary of optional tools
                clamdtop    : -lncurses (auto)
                milter      : yes (disabled)
                clamsubmit  : yes (libjson-c-dev found at /usr), libcurl-devel found at /usr)
    configure: Summary of engine performance features
                release mode: yes
                llvm        : no (disabled)
                mempool     : yes
    configure: Summary of engine detection features
                bzip2       : ok
                zlib        : /usr
                unrar       : yes
                preclass    : yes (libjson-c-dev found at /usr)
                pcre        : /usr
                libmspack   : yes (Internal)
                libxml2     : yes, from /usr
                yara        : yes
                fts         : yes (libc)
</pre>
<h3 id="additional-popular-.configure-options">Additional popular <code>./configure</code> options</h3>
<ul>
<li><code>--with-systemdsystemunitdir</code> - Do not install <code>systemd</code> socket files. This option disables systemd support, but will allow you to <code>make install</code> to a user-owned directory without requiring <code>sudo</code>/root privileges:<br />
<pre><br />
./configure --with-systemdsystemunitdir=no<br />
</pre></li>
<li><code>--sysconfdir</code> - Install the configuration files to <code>/etc</code> instead of <code>/usr/local/etc</code>:<br />
<pre><br />
./configure -–sysconfdir=/etc<br />
</pre></li>
<li><code>--prefix</code> - Install ClamAV to a directory other than <code>/usr/local/</code>:
<ul>
<li>Example 1: Install to a local <code>./install</code> directory.<br />
<pre><br />
./configure --prefix=<code>pwd</code>/install<br />
</pre></li>
<li>Example 2: Install ClamAV locally on an unprivileged shell account.<br />
<pre><br />
./configure --prefix=$HOME/clamav --disable-clamav --with-systemdsystemunitdir=no<br />
</pre></li>
</ul></li>
<li><code>--disable-clamav</code> - <em>Don't</em> drop super-user priveleges to run <code>freshclam</code> or <code>clamd</code> as the <code>clamav</code>* user.<br />
<pre><br />
./configure --disable-clamav<br />
</pre><br />
*<em>Tip</em>: Using this <code>--disable-clamav</code> means that <code>freshclam</code> and <code>clamd</code> will run with <em>root privleges</em> if invoked using <code>sudo</code>. Running <code>clamd</code> or <code>clamscan</code> as root is <strong>not recommended</strong>. Instead of using this option, you can configure <code>freshclam</code> or <code>clamd</code> to drop to any other user by:
<ul>
<li>setting the <code>DatabaseOwner</code> option in <code>freshclam.conf</code> and</li>
<li>setting the <code>User</code> option in <code>clamd.conf</code>.</li>
</ul></li>
</ul>
<p>Please see the <code>./configure --help</code> for additional options.</p>
<hr />
<h2 id="compile-clamav">Compile ClamAV</h2>
<p>Compile ClamAV with:<br />
<pre><br />
make -j2<br />
</pre></p>
<hr />
<h2 id="run-clamav-unit-tests-optional">Run ClamAV Unit Tests (Optional)</h2>
<p>For peace of mind, it can be helpful to run a small suite of unit and system tests.</p>
<p>Run:<br />
<pre><br />
make check<br />
</pre></p>
<p>All tests should pass.* Output will look something like this:</p>
<pre>
        ...
    PASS: check_clamav
    PASS: check_freshclam.sh
    PASS: check_sigtool.sh
    PASS: check_unit_vg.sh
    PASS: check1_clamscan.sh
    PASS: check2_clamd.sh
    PASS: check3_clamd.sh
    PASS: check4_clamd.sh
    PASS: check5_clamd_vg.sh
    PASS: check6_clamd_vg.sh
    SKIP: check7_clamd_hg.sh
    PASS: check8_clamd_hg.sh
    PASS: check9_clamscan_vg.sh
        ...
    ============================================================================
    Testsuite summary for ClamAV 0.100.2
    ============================================================================
    # TOTAL: 13
    # PASS:  12
    # SKIP:  1
    # XFAIL: 0
    # FAIL:  0
    # XPASS: 0
    # ERROR: 0
</pre>
<p><em>Notes</em>:</p>
<ul>
<li>The <code>*.vg.sh</code> tests will be skipped unless you run <code>make check VG=1</code>.</li>
<li>The <code>check7_clamd.hg.sh</code> (helgrind) is presently disabled and will be skipped.</li>
<li>For details, see: <a href="https://github.com/Cisco-Talos/clamav-devel/commit/2a5d51809a56be9a777ded02969a7427a3c26713">the Git commit</a></li>
</ul>
<p>If you have a failure or an error in the unit tests, it could be that you are missing one or more of the prerequisites.</p>
<p>If you are investigating a failure, please do the following:</p>
<p><code>cd unit_tests</code></p>
<p>Use <code>less</code> to read the log for the failed test.<br />
Example:</p>
<pre>
    less check4_clamd.sh.log`
</pre>
<p>To submit a bug report regarding unit text failures, please follow these <a href="../../UserManual/Installation-Unix.html#Reporting-a-unit-test-failure-bug">bug reporting steps</a>.</p>
<hr />
<h2 id="install-clamav">Install ClamAV</h2>
<p>Install ClamAV with:<br />
<pre><br />
make install<br />
</pre></p>
<p><em>Tip</em>: If installing to the default or other system-owned directory, you may need to use <code>sudo</code>.</p>
<hr />
<h2 id="first-time-set-up">First time set-up</h2>
<p><em>Note</em>: The following instructions assume you used the default install paths (i.e. <code>/usr/local</code>). If you modified the install locations using <code>--prefix</code> or <code>--sysconfdir</code> options, replace <code>/usr/local</code> with your chosen install path.</p>
<hr />
<h3 id="freshclam-config"><code>freshclam</code> config</h3>
<p>Before you can use <code>freshclam</code> to download updates, you need to create a <code>freshclam</code> config. A sample config is provided for you.</p>
<ol>
<li>Copy the sample config. You may need to use <code>sudo</code>:<br />
<pre><br />
cp /usr/local/etc/freshclam.conf.sample /usr/local/etc/freshclam.conf<br />
</pre></li>
<li>Modify the config file using your favourite text editor. Again, you may need to use <code>sudo</code>.
<ul>
<li>At a minimum, remove the <code>Example</code> line so <code>freshclam</code> can use the config.</li>
</ul>
<p>Take the time to look through the options. You can enable the sample options by deleting the <code>#</code> comment characters.</p>
<p>Some popular options to enable include:</p>
<ul>
<li><code>LogTime</code></li>
<li><code>LogRotate</code></li>
<li><code>NotifyClamd</code></li>
<li><code>DatabaseOwner</code></li>
</ul></li>
<li><p>Create the database directory. *Tip: <em>You may need to use <code>sudo</code>.</em><br />
<pre><br />
mkdir /usr/local/share/clamav<br />
</pre></p></li>
</ol>
<hr />
<h3 id="clamd-config-optional"><code>clamd</code> config (optional)</h3>
<p>You can run <code>clamscan</code> without setting the config options for <code>clamd</code>. However, the <code>clamd</code> scanning daemon allows you to use <code>clamdscan</code> to perform faster a-la-carte scans, allows you to run multi-threaded scans, and allows you to use <code>clamav-milter</code> if you want to use ClamAV as a mail filter if you host an email server.</p>
<p>Additionally, if you are a running modern versions of Linux where the FANOTIFY kernel feature is enabled, <code>clamd</code> has a feature run with On-Access Scanning<em>. </em>When properly configured*, On-Access Scanning can scan files as they are accessed and optionally block access to the file in the event that a signature alerted.</p>
<p><em>Note</em>: At this time, for On-Access Scanning to work, <code>clamd</code> must run with <code>sudo</code>/root privileges. For more details, please see our documentation on On-Access Scanning.</p>
<ol>
<li>Copy the sample config. You may need to use <code>sudo</code>:<br />
<pre><br />
cp /usr/local/etc/clamd.conf.sample /usr/local/etc/clamd.conf<br />
</pre></li>
<li>Modify the config file using your favourite text editor. Again, you may need to use <code>sudo</code>.
<ul>
<li>At a minimum, remove the <code>Example</code> line so <code>freshclam</code> can use the config.</li>
<li>You also <em>need</em> to select a Socket option for <code>clamd</code> so <code>clamdscan</code> and other utilities can communicate with <code>clamd</code>. You must enable <em>one</em> of the following.
<ul>
<li><code>LocalSocket</code></li>
<li><code>TCPSocket</code></li>
</ul></li>
</ul>
<p>Take the time to look through the options. You can enable the sample options by deleting the <code>#</code> comment characters.</p>
<p>Some popular options to enable include:</p>
<ul>
<li><code>LogTime</code></li>
<li><code>LogClean</code></li>
<li><code>LogRotate</code></li>
<li><code>User</code></li>
<li><code>ScanOnAccess</code>
<ul>
<li><code>OnAccessIncludePath</code></li>
<li><code>OnAccessExcludePath</code></li>
<li><code>OnAccessPrevention</code></li>
</ul></li>
</ul></li>
</ol>
<hr />
<h3 id="configure-selinux-for-clamav">Configure SELinux for ClamAV</h3>
<p>Certain distributions (notably RedHat variants) when operating with SELinux enabled use the non-standard <code>antivirus_can_scan_system</code> SELinux option instead of <code>clamd_can_scan_system</code>.</p>
<p>At this time, libclamav only sets the <code>clamd_can_scan_system</code> option, so you may need to manually enable <code>antivirus_can_scan_system</code>. If you don't perform this step, freshclam will log something like this when it tests the newly downloaded signature databases:</p>
<pre>
    During database load : LibClamAV Warning: RWX mapping denied: Can't allocate RWX Memory: Permission denied
</pre>
<p>To allow ClamAV to operate under SELinux, run the following:<br />
<pre><br />
setsebool -P antivirus_can_scan_system 1<br />
</pre></p>
<hr />
<h3 id="download-update-the-signature-database">Download / Update the signature database</h3>
<p>Before you can run a scan, you'll need to download the signature databases. Once again, you may need to run with <code>sudo</code>/root privileges.</p>
<p>If you installed to a location in your system PATH:<br />
<pre><br />
freshclam<br />
</pre></p>
<p>If you installed to another location:<br />
<pre><br />
/{path}/{to}/{clamav}/bin/freshclam<br />
</pre></p>
<p><em>Important</em>: It is common on Ubuntu after a fresh install to see the following error the first time you use ClamAV:<br />
<pre><br />
$ freshclam<br />
freshclam: error while loading shared libraries: libclamav.so.7: cannot open shared object file: No such file or directory<br />
</pre></p>
<p>You can fix this error by using ldconfig to rebuild the library search path.<br />
<pre><br />
sudo ldconfig<br />
</pre></p>
<hr />
<h3 id="users-and-on-user-privileges">Users and on user privileges</h3>
<p>If you are running <code>freshclam</code> and <code>clamd</code> as root or with <code>sudo</code>, and you did not explicitely configure with <code>--disable-clamav</code>, you will want to ensure that the <code>DatabaseOwner</code> user specified in <code>freshclam.conf</code> owns the database directory so it can download signature udpates.</p>
<p>The user that <code>clamd</code>, <code>clamdscan</code>, and <code>clamscan</code> run as may be the same user, but if it isn't -- it merely needs <em>read</em> access to the database directory.</p>
<p>If you choose to use the default <code>clamav</code> user to run <code>freshclam</code> and <code>clamd</code>, you'll need to create the clamav group and the clamav user account the first time you install ClamAV.</p>
<pre>
    groupadd clamav
    useradd -g clamav -s /bin/false -c "Clam Antivirus" clamav
</pre>
<p>Finally, you will want to set user ownership of the database directory.<br />
For example:<br />
<pre><br />
sudo chown -R clamav:clamav /usr/local/share/clamav<br />
</pre></p>
<hr />
<h2 id="usage">Usage</h2>
<p>You should be all set up to run scans.</p>
<p>Take a look at our <a href="../../UserManual/Usage.html">usage documentation</a> to learn about how to use ClamAV each of the utilities.</p>
</body>
</html>