CentOS 6.4 Installation (with unix socket, geoip, profiling and MD5 features)

This is a guide for installation of Suricata from git (latest) on a CentOS 6.4, 64 bit.

The server OS and kernel level used for this guide is:

[root@localhost PTP]# uname -a
Linux localhost.localdomain 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Mar 13 00:26:49 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost PTP]# cat /etc/redhat-release 
CentOS release 6.4 (Final)

General packages needed.

Add a repo for some packages that we need:

rpm -Uvh

Install the packages:

yum -y install libpcap libpcap-devel libnet libnet-devel pcre pcre-devel gcc gcc-c++ automake autoconf libtool make libyaml libyaml-devel zlib zlib-devel file-devel

In order to be able to get the latest git:

yum install wget git-core

We also need libcap-ng:

tar -zxf libcap-ng-0.7.3.tar.gz 
cd libcap-ng-0.7.3
./configure && make clean && make && make install

For MD5 functionality and availabilty.

yum install nss-util nss-util-devel nss-devel nspr-devel nspr

For the GeoIP functionality.

yum install GeoIP-devel GeoIP

For the unix socket functionality.

Unix socket usage guide - Interacting via Unix Socket

yum install python-simplejson python-setuptools python-instant python-distutils-extra
tar -zxf jansson-2.4.tar.gz
cd jansson-2.4/
./configure --prefix=/usr/ && make clean && make && make install

CentOS 6.4 comes with python 2.6.6:

[root@localhost ~]# rpm -qa python
[root@localhost ~]#

This could the following drawback when you run suricatasc :

[root@localhost ~]# suricatasc 
Traceback (most recent call last):
  File "/usr/bin/suricatasc", line 18, in <module>
    import argparse
ImportError: No module named argparse
[root@localhost ~]#

In order to solve this we need to:
Download argparse from here -

tar -zxf argparse-1.2.1.tar.gz 
cd argparse-1.2.1
python install

Configure,compile and install.

We get the latest Suricata:

git clone git:// && cd oisf/
git clone -b 0.5.x

Then we configure , compile and install:

./ && \
./configure --prefix=/usr/ --sysconfdir=/etc/ --localstatedir=/var/  \
--enable-unix-socket --enable-profiling --enable-geoip \
--with-libnss-libraries=/usr/lib64 --with-libnss-includes=/usr/include/nss3 \
--with-libnspr-libraries=/usr/lib64 --with-libnspr-includes=/usr/include/nspr4  \
&& make clean && make && make install && ldconfig

If this is your first installation on that particular server , you might want to consider "make install-full" instead of "make install".
Please read Basic Setup.

Now you have installed Suricata with the following features enabled - unix socket, GeoIP, MD5, profiling:

NOTE: version 2.0dev (rev 40a5ce8) - at the moment of this writing

[root@localhost oisf]# suricata --build-info
This is Suricata version 2.0dev (rev 40a5ce8)
64-bits, Little-endian architecture
GCC version 4.4.7 20120313 (Red Hat 4.4.7-3), C version 199901
compiled with libhtp 0.2.12, linked against 0.2.12
Suricata Configuration:
  AF_PACKET support:                       yes
  PF_RING support:                         no
  NFQueue support:                         no
  IPFW support:                            no
  DAG enabled:                             no
  Napatech enabled:                        no
  Unix socket enabled:                     yes

  libnss support:                          yes
  libnspr support:                         yes
  libjansson support:                      yes
  Prelude support:                         no
  PCRE jit:                                no
  libluajit:                               no
  libgeoip:                                yes
  Non-bundled htp:                         no
  Old barnyard2 support:                   no
  CUDA enabled:                            no

  Suricatasc install:                      yes

  Unit tests enabled:                      no
  Debug output enabled:                    no
  Debug validation enabled:                no
  Profiling enabled:                       yes
  Profiling locks enabled:                 no

Generic build parameters:
  Installation prefix (--prefix):          /usr
  Configuration directory (--sysconfdir):  /etc/suricata/
  Log directory (--localstatedir) :        /var/log/suricata/

  Host:                                    x86_64-unknown-linux-gnu
  GCC binary:                              gcc
  GCC Protect enabled:                     no
  GCC march native enabled:                yes
  GCC Profile enabled:                     no
[root@localhost oisf]#

[root@localhost oisf]# which suricata

Peter Manev