Skip to content

Instantly share code, notes, and snippets.

@arsperger
Last active May 28, 2021 04:26
Show Gist options
  • Save arsperger/a4299eca0fdb06dc04ec7c1bbb85fc34 to your computer and use it in GitHub Desktop.
Save arsperger/a4299eca0fdb06dc04ec7c1bbb85fc34 to your computer and use it in GitHub Desktop.
Install Homer Debian Ubuntu 16.04

Homer setup Ubuntu 16.04

First I would suggest to use vanilla Debian8 for Homer installation on the host. In this case you can just execute following command:

bash <( curl -s https://cdn.rawgit.com/sipcapture/homer-installer/masterhomer_installer.sh

Hard way:

System Requirements:

  • Apache2 or nginx
  • PHP-5, MySQL + InnoDB (barracuda) ( >= 5.6)
  • Kamailio + sipcapture
  • Homer-API + Homer-UI

1 Update system:

apt-get update && sudo apt-get -y upgrade

2 MySQL server:

apt-get -y install mariadb-server mariadb-client

3 Apache server:

apt-get -y install apache2 4 Install PHP5 and required PHP Modules. Ubuntu 16.04 doesn't have php5 which is required for Homer. So first we need to add php5 and enable it.

add-apt-repository ppa:ondrej/php apt-get update apt-get -y install php5.6 libapache2-mod-php php5.6-mysql php5.6-curl php5.6-gd php5.6-intl php-pear php5.6-imagick php5.6-imap php5.6-mcrypt php5.6-memcache php5.6-ps php5.6-pspell php5.6-recode php5.6-snmp php5.6-sqlite php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-apcu php5.6-dev php5.6-gd git curl

a2dismod php7.0 && a2enmod php5.6

service apache2 restart

update-alternatives --set php /usr/bin/php5.6

5 Enable SSL in Apache

a2enmod ssl a2ensite default-ssl a2enmod rewrite service apache2 reload

6 Install InfluxDB required by Homer

wget http://get.influxdb.org.s3.amazonaws.com/influxdb_0.8.9_amd64.deb dpkg -i influxdb_0.8.9_amd64.deb /etc/init.d/influxdb start

7 Install ElasticSearch required by Homer

apt-get install default-jre apt-get install default-jdk add-apt-repository ppa:webupd8team/java apt-get update apt-get install oracle-java8-installer wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.1/elasticsearch-2.3.1.deb dpkg -i elasticsearch-2.3.1.deb systemctl enable elasticsearch.service

8 Install HomerAPI and Front End HomerUI

cd /var/www/html git clone https://github.com/sipcapture/homer-api.git git clone https://github.com/sipcapture/homer-ui.git mv homer-api/ ./homer-ui/api

9 Create MySQL Database for Homer

mysql -u root -p

CREATE USER ‘sipcapture’@’localhost’ IDENTIFIED BY ‘sipcapture’;

CREATE DATABASE homer_data; CREATE DATABASE homer_configuration; CREATE DATABASE homer_statistic;

GRANT ALL PRIVILEGES ON homer_data.* TO sipcapture@’%’ IDENTIFIED BY ‘sipcapture’; GRANT ALL PRIVILEGES ON homer_configuration.* TO sipcapture@’%’ IDENTIFIED BY ‘sipcapture’; GRANT ALL PRIVILEGES ON homer_statistic.* TO sipcapture@’%’ IDENTIFIED BY ‘sipcapture’;

FLUSH PRIVILEGES;

9.1 Quit from mysql prompt

mysql -u root -p homer_data < /var/www/html/homer-ui/api/sql/schema_data.sql mysql -u root -p homer_configuration < /var/www/html/homer-ui/api/sql/schema_configuration.sql mysql -u root -p homer_statistic < /var/www/html/homer-ui/api/sql/schema_statistic.sql

10 configure Homer-api

cp /var/www/html/homer-ui/api/api/preferences_example.php /var/www/html/homer-ui/api/preferences.php cp /var/www/html/homer-ui/api/api/configuration_example.php /var/www/html/homer-ui/api/configuration.php

Edit configuration.php file with your Database details.

/* AUTH DB homer. User and Configuration */ define(‘DB_HOSTNAME’, “localhost”); define(‘DB_PORT’, 3306); define(‘DB_USERNAME’, “sipcapture”); define(‘DB_PASSWORD’, “sipcapture”); define(‘DB_CONFIGURATION’, “homer_configuration”); define(‘DB_STATISTIC’, “homer_statistic”); define(‘DB_HOMER’, “homer_data”); define(‘SINGLE_NODE’, 1);

11 Install and configure daily cron jobs

30 4 * * * root /var/www/html/homer-ui/api/scripts/mysql/homer_mysql_rotate > /dev/null 2>&1

12 Install Kamailio capture agent

apt-get -y install git gcc flex bison libmysqlclient-dev make libssl-dev libcurl4-openssl-dev libxml2-dev libpcre3-dev unixodbc-dev libmyodbc make

git clone –depth 1 https://github.com/kamailio/kamailio kamailio cd kamailio make FLAVOUR=kamailio include_modules=”db_mysql sipcapture pv textops rtimer xlog sqlops htable sl siputils” cfg

make all && sudo make install

Copy and configure the Kamailio configure file for sipcapture cp /var/www/html/homer-ui/api/examples/sipcapture/sipcapture.kamailio /usr/local/etc/kamailio/kamailio.cfg

13 Final step is to configure your kamailio to get the input packets on network interface.

vim /usr/local/etc/kamailio/kamailio.cfg

Change the User Name and password for Database !substdef “!HOMER_DB_USER!sipcapture!g” !substdef “!HOMER_DB_PASSWORD!sipcapture!g”

Done! Access Home:

http://Your_IP/homer-ui/ User Name – admin Password – test123

@ski522
Copy link

ski522 commented Aug 21, 2018

ubuntu 16.04 doesn't include libmyodbc, so this line fails "apt-get -y install git gcc flex bison libmysqlclient-dev make libssl-dev libcurl4-openssl-dev libxml2-dev libpcre3-dev unixodbc-dev libmyodbc make"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment