$Id: $

NOTE: this document applies to the Xplico source releases.

Installation
============

0. This is software. Beware.

1. Update machine and install dependencies.

      cd
      sudo apt update
      sudo apt upgrade -y
      sudo apt install -y libmaxminddb-dev libpq-dev libmysqlclient-dev m4 automake libpcap-dev git pkg-config g++ cmake libsqlite3-dev

2. Install nDPI library.

      sudo apt install -y gcc autogen automake autoconf libtool
      git clone https://github.com/ntop/nDPI.git
      cd nDPI
      ./autogen.sh
      ./configure
      make
      sudo make install
      cd
      rm -rf nDPI

3. Install GeoIP library.

      wget https://github.com/maxmind/geoip-api-c/releases/download/v1.6.12/GeoIP-1.6.12.tar.gz
      tar -xvzf GeoIP-1.6.12.tar.gz
      rm GeoIP-1.6.12.tar.gz
      cd GeoIP-1.6.12
      ./configure
      make
      sudo make install
      cd
      rm -rf GeoIP-1.6.12

4. Install json-c.

      git clone https://github.com/json-c/json-c.git
      mkdir json-c-build
      cmake ../json-c
      make
      sudo make install
      cd
      rm -rf json-c json-c-build
      sudo wget https://raw.githubusercontent.com/json-c/json-c/master/json_object_private.h -O /usr/local/include/json-c/json_object_private.h

5. Run 'make' in the Xplico distribution directory. Hopefully, you won't run into any problems.

      cd xplico
      make
      sudo ldconfig

6. After running 'make', you will see xplico binary and modules directory.
      At this point you should have xplico binary in your working (~/xplico/xplico) and be able to run it.

      sudo ./xplico -m rltm -i eth0 # eth0 is network interface on which you are sniffing.

6.5 To check captured data:

      cd ~/xplico/xdecode

7. If you wish to decode network printer job, make sure you have Ghostpcl. The latest "official" 
   version can be found at

        http://www.ghostscript.com/awki/Ghostpcl .

   Copy "pcl6" in Xplico home directory (in the same directory of xplico binary).

8. If you wish to decode RTP, SIP, MEGACO, H323, MGCP... VoIP audio codec, make sure you have videosnarf-0.62 compiled and patched with videosnarf_xplico.patch ( http://projects.xplico.org/patch/videosnarf_xplico.patch.gz ).

   Copy "videosnarf" in Xplico home directory (in the same directory of xplico binary).
   
9. Run './xplico' and make sure that everything are working. You must have root privileges in order to capture live data.

10. At this point you have Xplico in console mode, see README for use it.

11. If you use Xplico GUI it requires Apache, PHP and Perl. If you use Xplico in console mode
   it isn't necesary this software, and you can skip this point and others.

12. Run 'make install'. Change the permisions of /opt/xplico, /opt/xplico/cfg and /opt/xplico/xi directories to permit that Apache user (PHP program) can create a subdirectory inside /opt/xplico
    Also change the permisions of all files in /opt/xplico/cfg to read and write by Apache.

13. With root permission run:
    /opt/xplico/script/sqlite_demo.sh

14. To configure Apache you can use the (example) configuration file: /opt/xplico/cfg/apache_xi

15. Enable proxy in Firefox. The proxy IP is the IP of machine where you have installed Xplico and port is 80 (Apache port).

16. The url to view Xplico Interface is: http://IP
    If you use the machine name and not IP it is possible that you don't enter in Web Interface

17. And now: Enjoy.

If you have trouble with the build or installation process, you can contact us.
