Adobe/Flash Media Server 5.0 使用配置文件

来源:互联网 发布:js中bind方法 编辑:程序博客网 时间:2024/05/24 00:50
一、编辑配置文件
Note:
配置文件位于 rootinstall/conf 文件夹,如 /opt/adobe/ams/conf 

To edit a configuration file, including fms.ini, do the following:
编辑包括 fms.ini的配置文件,按照如下操作:
1). 在文本编辑器中打开文件
2). 编辑文件
3). 保存文件
4). 验证XML
5). 重启Flash Media Server. 
如果修改了 Users.xml文件,则需要重启 Flash Media Administration Server

二、编辑fms.ini文件中的参数
1. 文件 rootinstall/config/fms.ini是 Flash Media Server INI 文件. 
INI文件是默认的配置文件,这个文件包含了最常用的可编辑的配置参数;
编辑fms.ini文件可以修改服务器管理员的用户名和密码,adaptor host port, 包含应用的文件夹,包含媒体文件的文件夹等;

fms.ini文件包含一系列参数和值,如下所示:
SERVER.ADMIN_USERNAME = admin 

XML配置文件会使用这些参数。下面是User.xml文件的摘抄:
<UserList> 
    <!-- This tag defines an administrator for the server. --> 
    <User name="${SERVER.ADMIN_USERNAME}"> 
        <!-- Salted Password Hash for this vhost administrator. --> 
        <Password encrypt="true">6cb340fd77d3297cb6d82f57bb085a13d 
f45cd9513d042355a9a304c1d47ec433c97a8bdc2584424</Password>

当服务启动时,将使用fms.ini文件中的值替换XML配置文件的中的参数;

2. 编辑fms.ini文件
1). 在文件编辑器中打开 rootinstall/conf/fms.ini
2). 保存原文件的一个拷贝到另外的位置以用做备份
3). 输入参数的新值
4). 保存文件
5). 重启Flash Media Server. 
    如果编辑了User.xml文件的值, 则需要重启Flash Media Administration Server.
6). 使用新的密码打开Administration Console 并登录

三、在配置文件中使用符号
为了简化配置,可以在配置文件中对XML元素使用符号来作为值。
在 rootinstall/conf 文件夹中创建一个文件并命名为 substitution.xml,当服务器读取配置文件时会将这些符号映射成字符串。
当你创建了映射文件后,未来的升级会更快: 你可以编辑映射文件来替换每个配置文件;

安装器在安装时定义了少量的映射并将其存储在fms.ini文件中。
当服务器启动时,它会去查看rootinstall/conf目录下的fms.ini文件和substitution.xml文件;
你也可以创建额外的映射文件并引用substitution.xml文件;

服务器有两个预定义的符号, ROOT和CONF,它们是一直有效的;
ROOT符号映射成 FMSMaster.exe文件的位置;
CONF符号映射成 Server.xml文件的位置;

1. 服务器以下面的顺序创建符号映射:
1). 查看预定义的符号ROOT和CONF.
2). 查看 fms.ini文件.
3). 如果 substitution.xml 文件存在,服务器将会查找符号标签并依次处理子标签.
4). 服务器依据出现的顺序处理额外的映射文件(in KeyValueFile elements in the substitution.xml file).
5). 依据出现的顺序处理每个额外文件中的符号定义;

2. 创建substitution.xml 文件:
1). 创建一个新的XML文件并保存在rootinstall/conf文件夹,命名为substitution.xml.
2). 输入下列 XML 结构:
    <Root> 
        <Symbols> 
            <SymbolName>StringToMapTo</SymbolName> 
        </Symbols> 
    </Root>
对每个你想创建的符号,添加一个SymbolName元素.
3). 例如 ,substitution.xml 文件中映射的符号TESTUSERNAME ,其值为anedoe:
    <Root> 
        <Symbols> 
            <TESTUSERNAME>janedoe</TESTUSERNAME> 
        </Symbols> 
    </Root>
4). 在文本编辑器中打开rootinstall/conf/Users.xml.
5). 定位行  <User name="${SERVER.ADMIN_USERNAME}"> 并替换符号ERVER.ADMIN_USERNAME 为 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). 重启 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.

3. 创建额外的映射文件
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.

四、使用环境变量
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.
0 0
原创粉丝点击