Working with configuration files



Editing configuration files

Note: For information about configuration file names, locations, and hierarchy, see Configuration folder structure.

To edit a configuration file, open it in a text editor, modify and save it, and restart the server. If you modify Users.xml, you also must restart Flash Media Administration Server.

It’s a good idea to check that the XML is valid after editing an XML configuration file.

Edit the fms.ini file

  1. Open RootInstall/conf/fms.ini in a text editor.

  2. Save a copy to another location as a backup.

  3. Enter a new value for the SERVER.ADMIN_PASSWORD parameter.

  4. Save the file and restart the server.

  5. Open the Administration Console and log in with your new password.

Using symbols in configuration files

To simplify configuration, you can use symbols as values for XML elements in configuration files. Create a file named substitution.xml in the RootInstall/conf folder that maps the symbols to strings that the server substitutes when it reads the configuration files. After you’ve set up a map file, future updates are faster: you can edit the map file instead of editing each configuration file.

The installer defines a few mappings during the installation process and stores them in the fms.ini file. When the server starts, it looks for the fms.ini file and the substitution.xml file in the RootInstall/conf directory. You can also create additional map files and reference them from the substitution.xml file.

The server has two predefined symbols, ROOT and CONF, that are always available. The ROOT symbol is mapped to the location of the FMSMaster.exe file and the CONF symbol is mapped to the location of the Server.xml file.

The server builds the symbol map in the following order:

  1. The predefined symbols ROOT and CONF are evaluated.

  2. The fms.ini file is evaluated.

  3. If the substitution.xml file exists, the server looks for the Symbols tag and processes the child tags in the order in which they appear.

  4. The server processes the additional map files in the order in which they appear (in KeyValueFile elements in the substitution.xml file).

  5. Symbols defined in external map files are processed in the order in which they appear in each file.

Create a substitution.xml file:

  1. Create a new XML file and save it in the RootInstall/conf folder as substitution.xml.

  2. Enter the following XML structure:

    <Root> 
        <Symbols> 
            <SymbolName>StringToMapTo</SymbolName> 
        </Symbols> 
    </Root>

    Add a SymbolName element for each symbol you want to create.

  3. For example, this substitution.xml file maps the symbol TESTUSERNAME to the value janedoe:

    <Root> 
        <Symbols> 
            <TESTUSERNAME>janedoe</TESTUSERNAME> 
        </Symbols> 
    </Root>
  4. Open the RootInstall/conf/Users.xml file in a text editor.

  5. Locate the line <User name="${SERVER.ADMIN_USERNAME}"> and replace the symbol SERVER.ADMIN_USERNAME with the symbol TESTUSERNAME.

    When the server reads the XML file, it substitutes the value from the substitution.xml file as follows:

    <User name="janedoe"> 
    Note: Because this symbol is used as an attribute, it is surrounded by quotation marks. If the symbol were used as a regular value, it would not be surrounded by quotation marks.
  6. Restart the Administration Server.

Note: If you change the Users.xml file, you must restart the Administration Server. If you change any other XML configuration file, you must restart the server.

Creating additional map files

You can specify all of your text substitution mappings under the Symbols tag in substitution.xml. However, you can also create additional map files. To do this, create one or more KeyValueFile elements in the substitution.xml file. Each element can hold the location of one external file.

For example, the following references the file C:\testfiles\mySymbols.txt:

<Root> 
    <KeyValueFile>C:\testfiles\mySymbols.txt</KeyValueFile> 
</Root>

These external files are not in XML format. They simply contain a collection of symbol-value pairs, where each pair appears on a separate line and takes the following form:

symbol=value

The following example shows three symbol-value pairs:

USER_NAME=foo 
USER_PSWD = bar 
HELLO= "world and worlds"

Place comments on separate lines that begin with a number sign (#). Do not place comments on the same line as a symbol definition.

The first equal sign (=) in a line is considered the delimiter that separates the symbol and the value. The server trims leading or trailing white space from both the symbol and the value, but no white space within double quotation marks.

Using environment variables

To refer to an environment variable in one of the XML configuration files, use the name of the environment variable within percent (%) characters. The % characters indicate to the server that the symbol refers to an environment variable and not to a user-defined string.

The syntax for specifying an environment variable as a symbol is ${%ENV_VAR_NAME%}.

For example, the server maps the following symbol to the COMPUTERNAME variable:

${%COMPUTERNAME%}

When you use an environment variable, you don’t have to define it in the substitution.xml file.