Chapter 86. Configuration Management Tool
Prev |  | Next

# Chapter 86. Configuration Management Tool

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

Configuration tool allows to look at configuration settings and modify parameters. It takes care about proper parameters types and encoding.

First answer to the question: "Why to use configuration tool instead of directly, manually edit config file?"

There are a couple of reason why you should NOT manually edit configuration file and use the tool to modify settings:

1. Configuration is kept in XML file which can be easily broken if not edited carefully. The tool takes care of creating valid XML configuration file for you. So you can focus on your task - setting proper parameters for your server.
2. Configuration values are kept UUEncoded in config file. If you edit file manually you have to take care fo proper encoding special characters. The tool presents parameters to you in decoded form which is easy to read and accept all settings also in decoded form which is easier for you to write. Then when writing your parameters to configuration file settings are automaticly encoded to correct form.
3. Data in configuration file have TYPES. That is some parameters are expected to be Strings other are expected to be Integers, Booleans or arrays keeping data in any of that type. If data type is set incorrectly then server may have problems with reading configuration data. Configuration tool takes care of propert data type in configuration file.

Configuration management tool is a Java class - tigase.conf.Configurator. To make it easier to use this class there is also shell script available - config.sh.

First thing you can do is running the script with -h parameter:

    ./scripts/config.sh -h

In response you get description of all available parameters:

    Parameters:
     -h             this help message
     -c file        configuration file
     -key key       node/key for the value to set
     -value value   value to set in configuration file
     -set           set given value for given key
     -add           add given value to the values list for given key
     -print         print content of all configuration settings or of given node/key
     -f             force creation of the new property - dangerous option...
    Samples:
     Setting admin account - overwriting any previous value(s)
     $ ./scripts/config.sh -c tigase-config.xml -print -set -key session_1/admins -value admin1@localhost
     Adding next admin account leaving old value(s)
     $ ./scripts/config.sh -c tigase-config.xml -print -add -key session_1/admins -value admin2@localhost

    Note: adding -print option is useful always, even with -set or -add
          option as it prints set value afterwards.

Let’s assume configuration for your server is located in tigase-config.xml file. So the first thing you need to set when calling the tool is location of the configuration file.

Prev |  | Next
Chapter 85. Command Line Admin Tools | Home | Chapter 87. Best Practices for Connecting From Web Browser to Tigase XMPP Server