Artur Hefczyc <artur.hefczyc@tigase.net> v2.0, June 2014: Reformatted for AsciiDoc. :toc: :numbered: :website: http://tigase.net :Date: 2010-04-06 21:16
From the build #247 you can use configuration generators to easily and quickly create configuration file for even complex case.
Tigase configuration is not too easy to understand and maintain. Even with current command line tools you still have to know what the all options are for.
To make it easier for average administrators or people who run the server for the first time or even for those who want to quickly test Tigase server in different scenarios configuration generators have been created. For each generator you can have also a few extra options which allows you to create configuration which you don’t need to change for some time.
A few definitions first to make it easier to read the rest:
The are 4 generators currently available:
For each of above generator you can use additional parameters specifying other configuration details like database type you want to connect to, virtual hosts you want to support, administrator accounts and details for external component connection:
--user-db-uri connection-uri - where 'connection-uri' is a full resource uri for user repository data source. If you skip this parameter default value is used depending on database type you selected:
-- jdbc:mysql://localhost/tigase?user=root&password=mypass -- jdbc:postgresql://localhost/tigase?user=tigase -- user-repository.xml
--ext-comp connection-string - possible values: connection string 'localdomain,remotedomain,port,passwd,plain/ssl,accept/connect,routing'
Note: It is also possible to generate configuration for many external components. To do so place --ext-comp_1 'parameters' --ext-comp_2 'parameters' and so on…
Note! If configuration file already exists none of existing settings are overwritten. Configuration generator is activated only if config file does not exist at program startup or for config entries which are missing at startup time. So you can as well leave these settings in the file.
Note! tigase.conf property file is NOT read by the tigase server. These properties are read by the bash shell to create proper tigase server startup command. It will not work on MS Windows unless you run it in bash (using CygWin for example). On windows however you can use configuration wizards too by preparing proper server startup command manually. For example command for the first below presented conf file would look like (all in single line):
java -Djdbc.drivers=org.postgresql.Driver -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -server -Xms100M -Xmx100M -cp "libs/pg73jdbc3.jar;jars/tigase-server.jar;libs/tigase-xmltools.jar;libs/tigase-utils.jar" tigase.server.XMPPServer -c "etc/tigase.xml" --gen-config-def --user-db pgsql --user-db-uri "jdbc:postgresql://localhost/tigase?user=tigase"
So for example to take advantage of these options you can create tigase.conf and start Tigase server with usual command to generate ''tigase-config.xml'' configuration file:
./bin/tigase.sh run tigase.conf
A few sample files are included below for your convenience:
tigase-def-pgsql.conf - default installation with PostgreSQL database support:
ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" DRV="-Djdbc.drivers=org.postgresql.Driver" JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx100M " TIGASE_CONFIG="tigase-pgsql.xml" TIGASE_OPTIONS="--gen-config-def --user-db pgsql --user-db-uri jdbc:postgresql://localhost/tigase?user=tigase "
ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" DRV="-Djdbc.drivers=org.postgresql.Driver" JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx100M " TIGASE_CONFIG="tigase-pgsql.xml" TIGASE_OPTIONS="--gen-config-def --user-db pgsql "
tigase-cs.conf - installation of network connections management components (no DB is used by this instance):
ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" JAVA_OPTIONS="${ENC} -server -Xms100M -Xmx100M " TIGASE_CONFIG="etc/tigase-cs.xml" TIGASE_OPTIONS="--gen-config-cs --virt-hosts cs.tigase.org,tigase.org,sm.tigase.org \ --ext-comp cs.tigase.org,sm.tigase.org,5678,very-secret,plain,connect"
tigase-sm-mysql.conf - installation of session manager instance and resource connection string is the same as default so we can skip '--user-db-uri' parameter:
ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" DRV="-Djdbc.drivers=com.mysql.jdbc.Driver" JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx100M " TIGASE_CONFIG="etc/tigase-sm-mysql.xml" TIGASE_OPTIONS="--gen-config-sm --user-db mysql --auth-db mysql --virt-hosts tigase.org,sm.tigase.org \ --ext-comp sm.tigase.org,cs.tigase.org,5678,very-secret,plain,accept"