-
Notifications
You must be signed in to change notification settings - Fork 130
Installation
Be sure to meet all requirements
Especially, be sure you have already setup the Gammu SMSD database. If you haven't yet, this howto will guide you.
Kalkun uses the database that is created by gammu with all the tables created by gammy. Kalkun then adds supplementary tables and some columns to the gammu tables. So there is no such case where one has a gammu database separate from the kalkun database. Both software share the same database.
Download and extract the latest release or tag to your web root folder.
If you run Debian or Ubuntu or any related distribution, there is a kalkun debian package: installation procedure for Debian package. Then jump to Configure the connection to the database
For this we use Composer which must be installed on your system. From the root dir of kalkun, run:
composer install
If composer install
fails, read the error messages. You may need to run composer update
, or composer install --ignore-platform-reqs
instead.
In case you plan to deploy Kalkun on a server that has a different version of PHP than the one on your system, you can target a specific version of PHP by adding this into composer.json. For example for PHP 7.1.24:
...
"config": {
"platform": {
"php": "7.1.24",
"ext-mbstring": "7.1.24"
}
},
...
Then run:
composer update --no-dev
The "daemon" task is to manage inbox and autoreply. It is called by php-cli whenever new messages arrive.
-
This is done by setting the value of the
runonreceive
directive in the gammu-smsd configuration file (smsdrc). On Debian/Ubuntu systems you will find it at/etc/gammu-smsdrc
⚠️ Important: You must configure the "daemon" otherwise you will not see the messages in your inbox.- For example on Unix (using shell script):
[smsd] runonreceive = /var/www/html/kalkun/scripts/daemon.sh
- Or if you use Windows (using batch file):
[smsd] runonreceive = C:\xampp\htdocs\kalkun\scripts\daemon.bat
⚠️ Warning: It always a good idea to move the scripts directory outside the www, so it’s not accessible from browser. -
Set correct path (to
php-cli
anddaemon.php
) ondaemon.sh
ordaemon.bat
:# Configure this (use absolute path) PHP=/usr/bin/php # php cli path DAEMON=/path/to/kalkun/scripts/daemon.php # daemon.php path
-
Set correct path (to
php-cli
andoutbox_queue.php
) onoutbox_queue.sh
oroutbox_queue.bat
:# Configure this (use absolute path) PHP=/usr/bin/php # php cli path DAEMON=/path/to/kalkun/scripts/outbox_queue.php # outbox_queue.php path
-
Make sure that the daemon & outbox_queue scripts are executable.
sudo chmod +x daemon.php daemon.sh daemon.bat
-
Change URI path in
daemon.php
andoutbox_queue.sh
. Default is:// Please configure this $url = "http://localhost/kalkun";
Troubleshooting:
If somehow gammu-smsd fails to run the daemon script, it will throw an error like this:
gammu-smsd[3665]: Process failed with exit status 126
Check permission and try to run the script manually.
Although not mandatory, this is highly recommended. See Increase setup security.
Edit database.php
located at application/config/database.php
, you should see this line:
Set the correct value for the database you wish to use (here the example is with MySQL)
$active_group = 'kalkun_mysql';
Set the correction value at least for the database name, username & password fields:
$db['kalkun_mysql'] = array(
//...
'username' => 'root',
'password' => 'password',
'database' => 'kalkun',
//...
If you are upgrading:
- proceed with a backup of your database.
- be sure that you have a file called
install
next to the index.php file. Its presence will permit to enter the installer The content ofinstall
file is not important).
Now, you can launch the installer by opening your browser and going to http://localhost/kalkun. You will be redirected to http://localhost/kalkun/index.php/install (if not, place a file named install
next to index.php
) and you will see the installation wizard there. The wizard will guide you to complete the installation, it should be easy.
This is the recommended way as it will automatically set-up and update the database whether this is a fresh install or an upgrade from a previous version of Kalkun.
ℹ️ Note: You may proceed with a manual DB install by injecting these SQL script (in the order they are here) into your DB, but only in the case of a fresh kalkun install. Don't do this if you upgrade, you will mess things up in your database:
application/sql/DBENGINE/kalkun.sql
application/sql/DBENGINE/pbk_gammu.sql
application/sql/DBENGINE/pbk_kalkun.sql
At the end of installation wizard, if it tells to do so, you must delete the install
file yourself. It is likely the webserver hasn't the right to write to the directory. If you don't do so, you will be redirected to the begining of the installation wizard again. (Note: the installation wizard tries to do this automatically, but may fail due to lack of permission. Then you must delete it manually).
- To improve security, it's higly recommended to change the default
encryption_key
inapplication/config/config.php
. See setting your encryption key. - On unix/linux you may run
php -r 'echo bin2hex(random_bytes(16)), "\n";'
Write the value in application/config/config.php
and enclose it in a call to hex2bin()
function. For example:
$config['encryption_key'] = hex2bin('32_CHAR_LONG_ENC_KEY');
- CodeIgniter permits to use a http server environment variable named
CI_ENV
. By default we left it itdevelopment
. You may want to change it toproduction
. If your webserver is Apache's httpd it is set in.htaccess
file. However if you use another web server, set this environment variable in the configuration of your server. If set toproduction
no errors will be reported. While if set todevelopent
, the errors will be reported, what may be a security risk. More details in the CodeIgniter documentation.
Before you run kalkun, you should check the timezone of your PHP server is setup correctly. To do so, run
php -r 'echo date_default_timezone_get()."\n";'
If the timezone is not correct the time will be shown incorrectly in Kalkun and it is likely your SMS will never be delivered.
- Configure your PHP server with the correct timezone.
- If you can't update the php.ini file, you may set the timezone in
index.php
.
Open up your browser and go to http://localhost/kalkun
Default account for the Web Interface (you can change it after you login):
- username =
kalkun
- password =
kalkun
You should change the password after login for security issue.
Installing on Debian and derivatives systems like Ubuntu is easier since Debian packages are available. Most of the installation steps are already made by the package.
There are various sources to get the packages from:
- For the releases
- kalkun PPA (since Jul/2023) for releases.
- Releases page.
- For daily snapshots (produced on every commit)
- kalkun PPA (since Jul/2023) the latest snapshot.
- Get the bundle for the commit which you are interested in, on the github actions page. Find them this way:
- go to https://github.com/kalkun-sms/Kalkun/actions?query=workflow%3APackaging++
- filter the branch you wish to have the packages for
- click on the header of the 1st workflow to get the most recent
- download the "Debian packages" artifact (it probably requires to login with your Github account)
Installation steps:
- If you use the PPA, follow the installation instructions there
- If you you a debian bundle from github
-
Unpack the Debian bundle archive you downloaded and enter the unpack dir.
-
The Debian bundle archive contains kalkun but also some dependencies that you may need if your distribution doesn't ship them.
-
Install kalkun by running one of these commands:
- To install kalkun core only and the dependencies:
apt install \ ./php-*.deb \ ./kalkun_*.deb
- Optionally, you may install plugins.
apt install ./kalkun-plugins*.deb
- To install kalkun core only and the dependencies:
-
- Continue the installation instructions from Configure the connection to the database
- You may also read the README.Debian at /usr/share/doc/kalkun/