3. Installation

3.2. Requirements

Exakat relies on several parts. Some are necessary and some are optional.

Basic requirements :

  • exakat.phar, the main code.
  • Gremlin server : exakat uses this graph database and the Gremlin 3 traversal language. Currently, only Gremlin Server is supported, with the tinkergraph and neo4j storage engine. Version 3.2.x are supported, 3.3.x not yet.
  • Java 8.x. Java 9.x/10.x will be supported later. Java 7.x was used, but is not actively supported.
  • PHP 7.0 or later to run. This version requires curl, hash, phar, sqlite3, tokenizer, mbstring and json.

Optional requirements :

  • PHP 5.2 to 7.3 for analysis. Those versions only require the ext/tokenizer extension.
  • VCS (Version Control Software), such as Git, SVN, bazaar, Mercurial. They all are optional, though git is recommended.
  • Archives, such as zip, tgz, tbz2 may also be opened with optional helpers.

OS requirements : Exakat has beed tested on OSX, Debian and Ubuntu (up to 14.04). Exakat should work on Linux distributions, may be with little work. Exakat hasn’t been tested on Windows at all.

For installation, curl or wget, and zip are needed.

3.3. Download Exakat

You can download exakat directly from http://dist.exakat.io/.

This server also provides older versions of Exakat. It is recommended to always download the last version, which is available with http://dist.exakat.io/index.php?file=latest.

For each version, MD5 and SHA256 signatures are available. The downloaded MD5 must match the one in the related .md5 file. The .md5 also has the version number, for extra check.

curl -o exakat.phar http://dist.exakat.io/index.php?file=latest

curl -o exakat.phar.md5 http://dist.exakat.io/index.php?file=latest.md5
//22110fe2fa1b412f5d2f4b716947760d  exakat-1.2.0.phar
md5sum exakat.phar.md5
// Example :
//22110fe2fa1b412f5d2f4b716947760d  exakat.phar

curl -o exakat.phar.sha256 http://dist.exakat.io/index.php?file=latest.sha256
//a2a2b9c41ae94c6446d43e370c6ba4cdd970d232d817bf30207e58a61c5adfd9  exakat-1.2.0.phar
sha256sum exakat.phar.md5
// Example :
//a2a2b9c41ae94c6446d43e370c6ba4cdd970d232d817bf30207e58a61c5adfd9  exakat.phar

// Check with GPG signature
curl -o exakat.sig http://dist.exakat.io/index.php?file=latest.sig
// Optional step : Download the Key
gpg --recv-keys 5EDF7EA4
// Check with GPG signature
gpg --verify exakat.sig exakat.phar
// Good result :
//gpg: Signature made Tue Apr  3 08:28:52 2018 CEST using RSA key ID 5EDF7EA4
//gpg: Good signature from "Seguy Damien <damien.seguy@gmail.com>" [ultimate]

3.4. Quick installation with OSX

Paste the following commands in a terminal prompt : the first script download the exakat.phar, and the second sets up Gremlin 3 on Neo4j 2.3. PHP 7.0 or more recent, curl, homebrew are required.

mkdir exakat
cd exakat
curl -o exakat.phar http://dist.exakat.io/index.php?file=latest
curl -o apache-tinkerpop-gremlin-server-3.2.9-bin.zip "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=tinkerpop/3.2.9/apache-tinkerpop-gremlin-server-3.2.9-bin.zip"
unzip apache-tinkerpop-gremlin-server-3.2.9-bin.zip
mv apache-tinkerpop-gremlin-server-3.2.9 tinkergraph
rm -rf apache-tinkerpop-gremlin-server-3.2.9-bin.zip

# Optional : install neo4j engine.
cd tinkergraph
./bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin 3.2.9
cd ..

php exakat.phar doctor

It has be reported that installation fails on OSX 10.11 and 10.12, with error similar to ‘Error grabbing Grapes’. To fix this, use the following in command line :

rm -r ~/.groovy/grapes/
rm -r ~/.m2/

They remove some files for grapes, that it will rebuild later. Then, try again the optional install instructions.

3.5. Full installation with Debian/Ubuntu

The following commands are an optional pre-requisite to the Quick installation guide, that just follows. If something is missing in the next section, check with this section that all has beed installed correctly.

//// Installing PHP from sury.org
apt update
apt install apt-transport-https lsb-release ca-certificates

wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt update

apt-get install php7.2 php7.2-common php7.2-cli php7.2-curl php7.2-json php7.2-mbstring php7.2-sqlite3

//// Installing Java
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-get update

echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
DEBIAN_FRONTEND=noninteractive  apt-get install -y --force-yes oracle-java8-installer oracle-java8-set-default

//// Installing other tools
apt-get update && apt-get install -y --no-install-recommends git subversion mercurial lsof unzip

3.6. Quick installation with Debian/Ubuntu

Paste the following commands in a terminal prompt : the first script download the exakat.phar, and the second sets up Gremlin 3.*, with tinkergrpah and Neo4j. PHP 7.2 (7.0 or more recent), wget and unzip are expected.

mkdir exakat
cd exakat
wget -O exakat.phar http://dist.exakat.io/index.php?file=latest
wget -O apache-tinkerpop-gremlin-server-3.2.9-bin.zip "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=tinkerpop/3.2.9/apache-tinkerpop-gremlin-server-3.2.9-bin.zip"
unzip apache-tinkerpop-gremlin-server-3.2.9-bin.zip
mv apache-tinkerpop-gremlin-server-3.2.9 tinkergraph
rm -rf apache-tinkerpop-gremlin-server-3.2.9-bin.zip

# Optional : install neo4j engine.
cd tinkergraph
./bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin 3.2.9
cd ..

php exakat.phar doctor

3.7. Installation guide with Composer

Composer installation requires the creation of two folders : config and tinkergraph. This may interfere with your own installation. ‘tinkergraph’ is used as default name in the installation process, and may be updated later. The config folder is compulsory and can’t be renamed.

cd /path/to/code
composer require exakat/exakat:~1.2.8
wget -O apache-tinkerpop-gremlin-server-3.2.9-bin.zip "https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=tinkerpop/3.2.9/apache-tinkerpop-gremlin-server-3.2.9-bin.zip"
unzip apache-tinkerpop-gremlin-server-3.2.9-bin.zip
mv apache-tinkerpop-gremlin-server-3.2.9 tinkergraph
rm -rf apache-tinkerpop-gremlin-server-3.2.9-bin.zip

# Optional : install neo4j engine.
cd tinkergraph
./bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin 3.2.9
cd ..

php vendor/bin/exakat doctor

When running exakat in composer mode,

php vendor/bin/exakat init -p sculpin -R https://github.com/sculpin/sculpin.git
php vendor/bin/exakat project -p sculpin

The final audit is now in the projects/sculpin/report directory.

3.7.1. Various versions of PHP

You need one version of PHP (at least) to run exakat. This version needs the curl, hash, Semaphore , tokenizer and sqlite3 extensions. They all are part of the core.

Extra PHP-CLI versions allow more checks on the code. They only need to have the tokenizer extension available.

Exakat recommends PHP 7.2.5 (or latest version) to run Exakat. We also recommend the installation of PHP versions 5.2, 5.3, 5.4, 5.5, 5.6, 7.1, 7.2 and 7.3 (aka php-src master).

To install easily various versions of PHP, use the ondrej repository. Check The main PPA for PHP (5.6, 7.0, 7.1). You may also check the dotdeb repository, at dotdeb instruction.

3.7.1.1. Exakat

Download the exakat.phar archive from exakat.io and place it in the exakat folder.

3.7.1.2. Test

From the commandline, run php exakat.phar doctor. This will check if all of the above has be correctly run and will report some diagnostic.

3.8. Optional installations

By default, exakat works with Git repository for downloading code. You may also use

The binaries above are used with the init and update commands, to get the source code. They are optional.

3.9. Installation guide with Docker

Installation with docker is easy, and convenient. It hides the dependency on the graph database, and keeps all files in the ‘projects’ folder, created in the working directory.

Currently, Docker installation only ships with one PHP version (7.1), and with support for git, svn and mercurial.

docker pull exakat/exakat
  • Run exakat :
docker run -it -v $(pwd)/projects:/usr/src/exakat/projects --rm --name my-exakat exakat/exakat version
  • Init a project :
docker run -it -v $(pwd)/projects:/usr/src/exakat/projects --rm --name my-exakat exakat/exakat init -p <project name> -R <vcs_url>

_Please note_: The init command usually makes a local clone of your repository. In case you want to analyse a private repository for which you need an SSH key, init will fail silently on the cloning process. Before running the project command below, run:

::
cd projects/<project name> git clone <git_url> code

If you don’t use git, or don’t want to use version control, make sure that your project code ends up in projects/<project name>/code for Exakat to work correctly.

  • Run exakat :
docker run -it -v $(pwd)/projects:/usr/src/exakat/projects --rm --name my-exakat exakat/exakat project -p <project name>

You may simply run any exakat command by prefixing it with the following command :

docker run -it -v $(pwd)/projects:/usr/src/exakat/projects --rm --name my-exakat exakat/exakat

You may also create a handy shortcut, by creating an exakat.sh script and put it in your PATH :

cat 'docker run -it -v $(pwd)/projects:/usr/src/exakat/projects --rm --name my-exakat exakat/exakat $1' > /etc/local/sbin/exakat.sh
chmod u+x  /etc/local/sbin/exakat.sh
./exakat.sh version

3.10. Installation guide with Vagrant and Ansible

3.10.1. Installation list

The exakat-vagrant repository contains an automated install for exakat. It installs everything in the working directory, or the system. Vagrant install works with Debian 8 and Ubuntu 15.10 images. Other images may be usable, but not tested.

3.10.2. Pre-requisites

You need the following tools :

Most may easily be installed with the local package manager, or with a direct download from the editor’s website.

3.10.3. Install with Vagrant and Ansible

git clone https://github.com/exakat/exakat-vagrant
cd exakat-vagrant
// Review the Vagrant file to check the size of the virtualbox
vagrant up --provision
vagrant ssh

You are now ready to run a project.