Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jairosnyirenda19/699eef8a21232847d66a219c5cfacc90 to your computer and use it in GitHub Desktop.
Save jairosnyirenda19/699eef8a21232847d66a219c5cfacc90 to your computer and use it in GitHub Desktop.
HOW TO INSTALL KANNEL ON UBUNTU
~# uname -a
~# lsb_release -a
~# locale-gen en_US
~# locale-gen en_US.UTF-8
~# apt-get -y --force-yes remove ntpdate
~# apt-get -y --force-yes install ntp
~# /etc/init.d/ntp restart
~# dpkg-reconfigure tzdata
# Add PPA Repository
~# apt-get -y --force-yes install python-software-properties
~# apt-get -y --force-yes update
# apt-fast
~# add-apt-repository ppa:tldm217/tahutek.net
~# apt-get -y --force-yes update
~# apt-get -y --force-yes install axel
~# apt-get -y --force-yes install apt-fast
# Build System
~# apt-fast -y --force-yes install nano wget cvs subversion curl git-core unzip autoconf automake1.9 libtool flex debhelper pkg-config libpam0g-dev intltool automake checkinstall docbook docbook-xsl build-essential libpcre3 libpcre3-dev libc6-dev g++ gcc autotools-dev bison libncurses5-dev m4 tex-common texi2html texinfo texlive-base texlive-base-bin texlive-latex-base libxml2-dev
# Open SSL
~# ~# apt-fast -y --force-yes install openssl libssl-dev
# Apache
~# apt-fast -y --force-yes install apache2 apache2-dev apache2.2-common apache2.2-bin apache2-utils apache2-doc
~# a2enmod php5 rewrite actions include suexec ssl deflate auth_mysql
~# /etc/init.d/apache2 restart
# MySql
~# apt-fast -y --force-yes install mysql-server mysql-client libmysqlclient-dev libmysql++-dev
# PHP
~# apt-fast -y --force-yes install php5 php5-dev php5-common php-pear php5-xcache php5-curl php5-cli php5-cgi php5-gd php5-mysql php5-suhosin php5-memcache php5-imagick php5-sqlite php5-xmlrpc php5-xsl php5-imap php5-mcrypt php5-ffmpeg php5-tidy php5-mhash php5-memcache php5-pspell php5-recode php5-snmp php5-sqlite
~# apt-fast -y --force-yes install phpmyadmin
# Installing Kannel Gateway
~# groupadd kannel
~# useradd -g kannel kannel
~# cd /usr/local
~# mkdir /usr/local/src/kannel
~# cd /usr/local/src/kannel
~# svn co https://svn.kannel.org/gateway/trunk
~# mv trunk gateway
~# cd /usr/local/src/kannel/gateway
~# ./configure --prefix=/usr/local/kannel --with-mysql --with-mysql-dir=/usr/lib/mysql/ --enable-debug --enable-assertions --with-defaults=speed --disable-localtime --enable-start-stop-daemon --enable-pam
~# touch .depend
~# make depend
~# make
~# make bindir=/usr/local/kannel install
~# cd
# Sql Box Installation
~# cd /usr/local/src/kannel
~# svn co https://svn.kannel.org/sqlbox/trunk
~# mv trunk sqlbox
~# cd /usr/local/src/kannel/sqlbox
~# ./bootstrap
~# ./configure --prefix=/usr/local/kannel --with-kannel-dir=/usr/local/kannel
~# make
~# make bindir=/usr/local/kannel/sqlbox install
~# cd
# SMPP Box Installation
~# cd /usr/local/src/kannel
~# svn co https://svn.kannel.org/opensmppbox/trunk
~# mv trunk smppbox
cd /usr/local/src/kannel/smppbox
~# ./configure --prefix=/usr/local/kannel --with-kannel-dir=/usr/local/kannel
~# make
~# make bindir=/usr/local/kannel/smppbox install
~# cd
# Manage & Check Log files
~# mkdir /etc/kannel
~# mkdir /var/log/kannel
~# mkdir /var/log/kannel/gateway
~# mkdir /var/log/kannel/smsbox
~# mkdir /var/log/kannel/wapbox
~# mkdir /var/log/kannel/smsc
~# mkdir /var/log/kannel/sqlbox
~# mkdir /var/log/kannel/smppbox
~# chmod 755 /var/log/kannel
~# cp /usr/local/src/kannel/gateway/gw/smskannel.conf /etc/kannel/kannel.conf
~# cp /usr/local/src/kannel/gateway/debian/kannel.default /etc/default/kannel
~# cp /usr/local/src/kannel/gateway/debian/kannel.init /etc/init.d/kannel
~# cp /usr/local/src/kannel/sqlbox/example/sqlbox.conf.example /etc/kannel/sqlbox.conf
~# cp /usr/local/src/kannel/smppbox/example/opensmppbox.conf.example /etc/kannel/opensmppbox.conf
~# cp /usr/local/src/kannel/smppbox/example/smpplogins.txt.example /etc/kannel/smpplogins.txt
~# chmod 777 /etc/init.d/kannel
~# update-rc.d kannel defaults
# Clean Installtion Files
~# du -sh /var/cache/apt/archives
~# apt-get -y --force-yes clean
# Open Terminal and run following command to test your kannel
~# /usr/local/kannel/sbin/bearerbox -v 0 /etc/kannel/kannel.conf
~# /usr/local/kannel/sbin/smsbox -v 0 /etc/kannel/kannel.conf
~# /usr/local/kannel/sbin/wapbox -v 0 /etc/kannel/kannel.conf
~# /usr/local/kannel/sbin/sqlbox -v 0 /etc/kannel/kannel.conf
~# /usr/local/kannel/sbin/opensmppbox -v 0 /etc/kannel/opensmppbox.conf
@jairosnyirenda19
Copy link
Author

jairosnyirenda19 commented May 31, 2022

ip XXX.XX.XXX.XX
u root
p lsb_release -a

uname -a
lsb_release -a

hostname -I

hostname supplier

#restart terminal

sudo apt-get update
sudo apt-get upgrade

//Apache 2
sudo apt install -y apache2

sudo ufw app list

sudo ufw allow 'Apache'
sudo ufw status
sudo ufw disable

sudo systemctl status apache2

hostname -I
http://your_server_ip

apache2 -v

sudo apt-get -y install php
php -v

sudo apt install -y mysql-server
mysql --version

sudo mysql_secure_installation

// mysql password is Dollorinfotech@5050

#Webmin Installation

sudo nano /etc/apt/sources.list
deb http://download.webmin.com/download/repository sarge contrib

wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
sudo apt update
sudo apt install -y webmin

https://your_server_ip:10000
#to change webmin port
sudo nano -w /etc/webmin/miniserv.conf

sudo service webmin status

sudo service webmin restart

#Webmin install finish

sudo apt-get install -y nano wget cvs subversion curl git-core zip unzip autoconf automake libtool flex debhelper pkg-config libpam0g-dev intltool automake checkinstall docbook docbook-xsl build-essential libpcre3 libpcre3-dev libc6-dev g++ gcc autotools-dev bison libncurses5-dev m4 tex-common texi2html texinfo texlive-base texlive-base-bin texlive-latex-base libxml2-dev openssl libssl-dev software-properties-common axel mysql-client libmysqlclient-dev php-fpm php-cli php-mysql php-gd php-imap php-curl php-xml php-mbstring

a2enmod proxy_fcgi setenvif
systemctl reload apache2
a2enconf php7.2-fpm
systemctl reload apache2

sudo apt-get -y remove bison

wget --no-check-certificate https://ftp.gnu.org/gnu/bison/bison-1.28.tar.gz
tar -xvf bison-1.28.tar.gz
rm bison-1.28.tar.gz
cd bison-1.28

./configure --prefix=/usr/local/bison --with-libiconv-prefix=/usr/local/libiconv/

make
make install

ln -s /usr/local/bison/bin/bison /usr/bin/bison
ln -s /usr/local/bison/bin/yacc /usr/bin/yacc

groupadd kannel
useradd -g kannel kannel

mkdir /usr/local/src/kannel
cd /usr/local/src/kannel

wget --no-check-certificate https://www.kannel.org/download/1.4.5/gateway-1.4.5.zip

unzip gateway-1.4.5.zip
rm gateway-1.4.5.zip
mv gateway-1.4.5 gateway
cd gateway/

./configure --prefix=/usr/local/kannel --with-mysql --with-mysql-dir=/usr/lib/mysql/ --enable-debug --enable-assertions --with-defaults=speed --disable-localtime --enable-start-stop-daemon --enable-pam
touch .depend
make depend
make
chmod 0755 gw-config
mkdir /usr/local/kannel
make bindir=/usr/local/kannel install
cd

mkdir /usr/local/src/kannel/sqlbox
cd /usr/local/src/kannel/sqlbox

cp -r /usr/local/src/kannel/gateway/addons/sqlbox/* ./
./bootstrap
./configure --prefix=/usr/local/kannel --with-kannel-dir=/usr/local/kannel
make
make bindir=/usr/local/kannel/sqlbox install
cd

mkdir /usr/local/src/kannel/smppbox
cd /usr/local/src/kannel/smppbox

cp -r /usr/local/src/kannel/gateway/addons/opensmppbox/* ./
./configure --prefix=/usr/local/kannel --with-kannel-dir=/usr/local/src/kannel/gateway
make
make bindir=/usr/local/kannel/smppbox install
cd

mkdir /etc/kannel
mkdir /var/log/kannel
cd /var/log/kannel
mkdir gateway smsbox wapbox smsc sqlbox smppbox
chmod 755 /var/log/kannel

cp /usr/local/src/kannel/gateway/gw/smskannel.conf /etc/kannel/kannel.conf
cp /usr/local/src/kannel/gateway/debian/kannel.default /etc/default/kannel
cp /usr/local/src/kannel/gateway/debian/kannel.init /etc/init.d/kannel
cp /usr/local/src/kannel/sqlbox/example/sqlbox.conf.example /etc/kannel/sqlbox.conf
cp /usr/local/src/kannel/smppbox/example/opensmppbox.conf.example /etc/kannel/opensmppbox.conf
cp /usr/local/src/kannel/smppbox/example/smpplogins.txt.example /etc/kannel/smpplogins.txt

chmod 777 /etc/init.d/kannel
update-rc.d kannel defaults

du -sh /var/cache/apt/archives
apt-get -y clean

mysql
create database kannel;
use kannel;
CREATE USER 'kannel'@'localhost' IDENTIFIED BY 'Dollorinfotech@5050';
GRANT ALL PRIVILEGES ON * . * TO 'kannel'@'localhost';
GRANT ALL PRIVILEGES ON kannel.* TO 'kannel'@'localhost';
FLUSH PRIVILEGES;
quit;

cd
vi t.sql

mysql kannel < t.sql
mysql
use kannel

#Dlr cleanup for every 6 hour

ALTER TABLE dlr ADD COLUMN timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER boxc;

SET GLOBAL event_scheduler = ON;

CREATE EVENT IF NOT EXISTS dlr_clean ON SCHEDULE EVERY 6 HOUR DO DELETE FROM dlr WHERE TIME_TO_SEC(dlr.timestamp) + 604800 < TIME_TO_SEC(CURRENT_TIMESTAMP);

exit
To Start fake smsc

cd /usr/local/src/kannel/gateway/test
./fakesmsc -m 1 “123 789 text hello "
Configure kannel.conf file

cd /etc/kannel
vi kannel.conf(download file from given link )

#mysql connections setup in kannel.conf file(download file from given link)

/usr/local/kannel/sbin/bearerbox -v 0 /etc/kannel/kannel.conf &
/usr/local/kannel/sbin/smsbox -v 0 /etc/kannel/kannel.conf &
/usr/local/kannel/sbin/wapbox -v 0 /etc/kannel/kannel.conf &
/usr/local/kannel/sbin/sqlbox -v 1 /etc/kannel/sqlbox.conf &
/usr/local/kannel/sbin/opensmppbox -v 0 /etc/kannel/opensmppbox.conf &

ps -aux | grep box
or
ps aux |grep kannel
or
ps aux |grep sqlbox

#http administration command
http://xxx.xx.xxx.xx:13000/status?password=bar
http://xxx.xx.xxx.xx:13013/cgi-bin/sendsms?username=tester&password=foobar&from=DOLLOR&to=917999452711&&text=Hello
http://xxx.xx.xxx.xx:13013/cgi-bin/sendsms?username=tester&password=foobar&from=DOLLOR&to=917999452711&&text=Hello&forced-smsc=TelPRM&dlr-mask=31
http://xxx.xx.xxx.xx:13000/graceful-restart?password=bar
http://xxx.xx.xxx.xx:13000/stop-smsc?password=bar&smsc=TelWHL
http://xxx.xx.xxx.xx:13000/start-smsc?password=bar&smsc=TelWHL

mysql
CREATE DATABASE playsms;
CREATE USER 'playsms'@'localhost' IDENTIFIED BY 'Dollorinfotech@5050';
GRANT ALL PRIVILEGES ON playsms.* TO 'playsms'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

cd ~
wget -c "https://sourceforge.net/projects/playsms/files/playsms/Version%201.4.2/playsms-1.4.2.tar.gz/download" -O playsms-1.4.2.tar.gz
tar -zxf playsms-1.4.2.tar.gz
cd playsms-1.4.2/
cp install.conf.dist install.conf
nano install.conf
#set db and user name

#get-url = "http://167.114.113.206/playsms/index.php?app=call&cat=gateway&plugin=kannel&access=geturl&t=%t&q=%q&a=%a&Q=%Q&smsc=%i"

./install-playsms.sh

ps aux | grep playsms

service php7.2-fpm reload
service apache2 restart

If you need Professional Help on Kannel i am available to help.

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