Macromedia flash media server 2-server-side actionscript language reference Benutzerhandbuch

Seite von 74
64
Server Management ActionScript Language Reference
You must be a server administrator to change the values of most configuration keys in the 
Server.xml and Adaptor.xml files.
For a description of the XML configuration files, see Managing Flash Media Server
Examples
The following examples show how to set new values for configuration keys in each of the four 
XML files:
// Establish connection to server
nc = newNetConnection();
nc.connect("rtmp://localhost:1111/admin", "LGreen", "123jn098");
// For a virtual host administrator, change key in Server.xml
// Set Password for user LGreen to "strawman28"
key = "Admin/Server/UserList/User:LGreen/Password";
val = "strawman28"
nc.call("setConfig", new onSetConfig(), key, val, "/");
// For a server administrator, change key in Server.xml
// Set LicenseInfo to "Helloworld"
key = "Server/LicenseInfo";
val = "Helloworld";
nc.call("setConfig", new onSetConfig(), key, val, "/");
// Change key in Adaptor.xml
// Set HostPort to 128.0.0.1:1938
key = "Adaptor:_defaultRoot_/HostPortList/HostPort";
val = "128.0.0.1:1938";
nc.call("setConfig", new onSetConfig(), key, val, "/");
// Change key in Vhost.xml
// Set RecordAccessLog to true
key = "Adaptor:_defaultRoot_/VirtualHost:_defaultVHost_/RecordAccessLog";
val = "true";
nc.call("setConfig", new onSetConfig(), key, val, "/");
// Change key in Application.xml for an application on the virtual host 
// you connected to when you logged on to the administration server.
// Note that the previous subkeys and the final parameter "/" are not
// necessary.
key = "Application:FinanceApp/RecordAppLog";
TI
P
It is possible to have more than one XML tag with the same name at the same level in the 
XML tree. In the configuration file, you should distinguish such tags by using a name 
attribute in the XML tag (for example, if you have more than one virtual host: 
<VirtualHost name="www.redpin.com"></VirtualHost>
.) When you call the 
setConfig
 
command and specify the configuration subkeys, you can indicate which tag you want 
by specifying the tag name, followed by a colon and the correct name attribute, for 
example: 
Adaptor:_defaultRoot_/VirtualHost:www.redpin.com
.