Tuesday, March 18, 2014

Using ejabberd as xmpp server

The ejabberd server you can backup with this command: ejabberdctl backup filename

or create a raw dump with this command:  
ejabberdctl dump filename

Backup creates a normal backup-file and dump creates a raw file of all data.  

For normal work the backup is good enough.

Restoring the data is equal to backup, only using restore or load(when using dump):  
ejabberdctl restore Datei

This command shows how many users are online at the moment:  
ejabberdctl connected-users-number

And this command shows the user names:
ejabberdctl connected-users

For showing all users with a account at the server use this command: ejabberdctl registered-users Servername

Wednesday, March 5, 2014

Firebird Database with Debian

Usind firebird as database with Debian

Before we install the database here a short overview of the different versions:

Classic Server
The classic server uses for each connection a different task. On multiprocessor systems the server uses all cores to share the usage.
Best performance for a small  number of connections.

SuperServer 
The superserver uses only one process and for each connection a thread. All connections use the same cache. Multiprocessing is not supportet. On server with more than one cpu there is no more performance improvement.
Best performance on many connections.


SuperClassic
Superclassis uses a thread for each connection and one cache, but supports multicore cpu's. Combination of the advantages of both systems but only available at firebird 2.5 or higher.


Installation

For installation i used aptitude:

aptitude install firebird2.5-superclassic

With this command aptitude installed the needed packackes. For using the database we need the user and group "firebird" and the masterpassword. For creating this we use the package manager dpkg-reconfigure:

dpkg-reconfigure firebird2.5-superclassic

While the package manager is creating the database he ask for the masterpassword for the mainuser.

The config files can be found here: /etc/firebird/2.5

At the config file firebird.conf i changed nothing. The aliases.conf i used for creating an database alias. So we can use the database without the complete path to the database file. When not using an alias you must set the complete path to the file from view of the server.

# ------------------------------
# List of known database aliases
# ------------------------------
#
# Example Database:
#
employee.fdb = /usr/share/doc/firebird2.5-common-doc/examples/empbuild/employee.fdb
employee = /usr/share/doc/firebird2.5-common-doc/examples/empbuild/employee.fdb
#
# Live Databases:
#
datenbank = /daten/datenbank.fdb

Here i create the alias "datenbank" for the database file  /daten/datenbank.fdb
It is importent to check the permissions of the database file and the complete path to it.

For creating a user of firebird we using gsec.

gsec -user sysdba -pass hauptpassword -add benutzername -pw benutzerkennwort

Here we create the user "benutzername" with the password "benutzerkennwort" while using the mainuser "sysdba" and his password "hauptpassword" whis was created during the installation with dpkg-reconfigure.

When everything is done we restart the database:

/etc/init.d/firebird2.5-superclassic restart