How to set Tigase up

Now we will focus on setting things up to have both services up and running together. Below is example of the most complex environment to run where LibreSource is using PostgreSQL database and Tigase is using a MySQL database. All basic user data needed for authentication is kept by LibreSource, so Tigase has to connect to PostgreSQL database also in order to authenticate users.

  1. First you need LibreSource system up and running. Please refer to LS documentation for details.
  2. Install Tigase server in the normal way including loading Tigase database schema. Database tables used by Tigase server use different naming convention so you can simply load Tigase DB schema to the same database as LibreSource data. It is also possible and recommended to keep Tigase data in separate database.
  3. Using configuration wizards generate configuration for Tigase server to connect to LibreSource database. Here is the sample file with parameters for configuration wizard assuming following setup:

    • LibreSource data are kept in PostgreSQL database: libresource, user: demo
    • Tigase data are kept in MySQL database: tigase, user: dbuser, password: dbpass
    • No external components are connected to Tigase server
    • Tigase works for domain: domain.net

      ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"
      DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver"
      
      JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx100M "
      TIGASE_CONFIG="etc/tigase-mysql-libresource.xml"
      TIGASE_OPTIONS="--gen-config-def \
        --user-db mysql \
        --user-db-uri jdbc:mysql://localhost/tigase?user=dbuser&password=dbpass&autoCreateUser=true \
        --auth-db libresource \
        --auth-db-uri jdbc:postgresql://localhost/libresource?user=demo \
        --virt-hosts domain.net,localhost "
  4. A simpler example where all data (LibreSource and Tigase) are stored in the same database:

    • LibreSource data are kept in PostgreSQL database: libresource, user: demo
    • Tigase data are kept also in PostgreSQL database: libresource, user: demo
    • No external components are connected to Tigase server
    • Tigase works for domain: domain.net

      ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"
      DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver"
      
      JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx100M "
      TIGASE_CONFIG="etc/tigase-mysql-libresource.xml"
      TIGASE_OPTIONS="--gen-config-def \
        --user-db pgsql \
        --user-db-uri jdbc:postgresql://localhost/libresource?user=demo&autoCreateUser=true \
        --auth-db libresource \
        --auth-db-uri jdbc:postgresql://localhost/libresource?user=demo \
        --virt-hosts domain.net,localhost "

Now, you can run Tigase as normal and it all works.

Note! You have to load Tigase database schema for user data. Please refer to guide for specific database: MySQL or PostgreSQL.