How to set Tigase up.
Prev | Chapter 75. Integrating Tigase Server With LibreSource | Next

## 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 MySQL database. All basic user data needed for authentication are kept by LibreSource so Tigase has to connect to PostgreSQL database too 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. And 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 in usual way and all works.

Note! In any case you have to load Tigase database schema for user data. Please refer to guide for specific database: ////<<mysql2database,////MySQL or ////<<postgresDB2,////PostgreSQL.

Prev | Up | Next
Chapter 75. Integrating Tigase Server With LibreSource | Home | Migration From old Tigase Installation to LibreSource