Installation of the agent

Installing the agent and getting redirection.io work is rather easy and straightforward. This page will guide you through the redirection.io's agent installation steps.

Prerequisites and compatible platforms

Using redirection.io requires the ability to run redirection.io's agent on your server. In most of the cases, this means that you need a SSH access with root permissions. If your website uses a shared hosting without SSH access, you won't be able to use redirection.io's features.

Our agent works on Linux and FreeBSD.

Debian and APT-based distributions

  1. Install the apt-transport-https package:

    sudo apt-get install apt-transport-https
    
  2. Import our apt repository key:

    wget -qO- https://packages.redirection.io/gpg.key | sudo tee /etc/apt/keyrings/redirectionio-archive-keyring.asc
    
  3. Add the debian repository:

    echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/redirectionio-archive-keyring.asc] https://packages.redirection.io/deb/stable/2 any main" | sudo tee -a /etc/apt/sources.list.d/packages_redirection_io_deb.list > /dev/null
    
  4. Update the apt cache and install redirection.io's agent:

    sudo apt update && sudo apt install redirectionio-agent
    
  5. Once the agent is installed, edit its configuration file (in /etc/redirectionio/agent.yml - basically, you only need to change the instance name, which will help you identify the origin of logs collected by redirection.io), and start the service - this depends on the service manager used in your distribution. It can be for instance:

    sudo systemctl --system daemon-reload
    sudo systemctl restart redirectionio-agent
    

You'll have to restart the service every time you change the agent configuration. If something goes wrong, if you need help or have questions, feel free to contact our support!

A note on the systemd service file

If you wish to use environment variables in the agent execution environment when the agent is launched using systemctl (for example, in order to use a HTTPS proxy), you can tweak the content of the systemd service file.

Red Hat and RPM-based distributions

  1. Import the signature key:

    wget -qO- https://packages.redirection.io/gpg.key -O /tmp/redirectionio-gpg.key && sudo rpm --import /tmp/redirectionio-gpg.key && rm /tmp/redirectionio-gpg.key
    
  2. Add the repository:

    sudo yum-config-manager --add-repo https://packages.redirection.io/rpm/stable/2/any
    
    # or (Fedora)
    sudo dnf config-manager --add-repo https://packages.redirection.io/rpm/stable/2/any
    
  3. Install redirection.io's agent:

    sudo yum install redirectionio-agent
    
    # or (Fedora)
    sudo dnf install redirectionio-agent
    
  4. Once the agent is installed, edit its configuration file (in /etc/redirectionio/agent.yml - basically, you only need to change the instance name, which will help you identify the origin of logs collected by redirection.io), and start the service - this depends on the service manager used in your distribution. It can be for instance:

    sudo systemctl --system daemon-reload
    sudo systemctl restart redirectionio-agent
    

We also provide a SysV Init script for systems which do not use systemd.

Manual installation

In particular cases, a manual install might be the way to go.

  1. Download the last version of redirection.io's agent here: https://packages.redirection.io/dist/stable/2/any/redirectionio-agent-latest_any_amd64.tar.gz
  2. Extract the archive, move files and edit the configuration according to your needs
  3. Run the agent

Windows

At the time of writing, we do not have a Windows binary of the agent, but we may investigate the topic in the future. Feel free to ask us!

Ansible

An Ansible role is available. You may install it using Ansible Galaxy:

ansible-galaxy install redirectionio.agent

System V init script

Our packages do not provide SysV init scripts. However, should your system require such a script, you can create a /etc/init.d/redirectionio-agent file:

#!/bin/sh
#
# redirectionio-agent start stop daemon for CentOS (sysvinit)
#
# chkconfig: - 64 36
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 2 3 4 6
# Required-Start:
# description: redirectionio-agent start stop daemon for CentOS
# processname: redirectionio-agent
# pidfile: none
# lockfile: /var/lock/subsys/redirectionio-agent

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

USER="redirectionio"
APPNAME="redirectionio-agent"
APPBIN="/usr/bin/redirectionio-agent"
APPARGS=""
LOGFILE="/var/log/redirectionio.log"
LOCKFILE="/var/lock/subsys/$APPNAME"

LOGPATH=$(dirname $LOGFILE)

start() {
        [ -x $prog ] || exit 5
        [ -d $LOGPATH ] || mkdir $LOGPATH
        [ -f $LOGFILE ] || touch $LOGFILE

        echo -n $"Starting $APPNAME: "
        daemon --user=$USER "$APPBIN $APPARGS >>$LOGFILE &"
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch $LOCKFILE
        return $RETVAL
}

stop() {
        echo -n $"Stopping $APPNAME: "
        killproc $APPBIN
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
        return $RETVAL
}

restart() {
        stop
        start
}

rh_status() {
        status $prog
}

rh_status_q() {
        rh_status >/dev/null 2>&1
}

case "$1" in
        start)
                rh_status_q && exit 0
                $1
        ;;
        stop)
                rh_status_q || exit 0
                $1
        ;;
        restart)
                $1
        ;;
        status)
                rh_status
        ;;
        *)
                echo $"Usage: $0 {start|stop|status|restart}"
                exit 2
esac
This page has been updated on September 29th, 2023.
Can't find your answer?