| by SuperBonBon |
|
Server settings
Server configuration file. ( Launching a new server. - Removing a server. ) > Settings to change. > Next step
Server configuration file.
JAFS can handle multiple server instances, each server instance needs to have its own configuration file that use the server config grammar.
A sample file named server_sample.xml using this grammar is available in the JAFS config directory.
Each server has its own code setting that will be used to identify the server in the administration console :
<server xmlns="http://www.sbbi.net/jafs/1.0/jafs-server"
...
code="sample_server" ... >
...
</server>
You can see here that the server code is "sample_server".
A server configuration file name need to start with "server_" and end with ".xml", make sure you follow this rule.
Drop the file in the servers configuration directory ( config ), start or restart JAFS and if your server match correctly the server XML grammar it will be started and available in the administration console. If you do not want to restart JAFS you can deploy a server from the administration console using the ServersDeploymentService deployFromFile or ServersDeploymentService deploy operation.
When a server does not start, you can find information in the JAFS "window" or logs/service_logs.xml file about the problem that has been encountered during deployment.
You can otherwise use the ServersDeploymentService createServer operation to create a server without to have to edit any XML configuration file.
If you want to remove a server simply delete the server configuration file from the config directory. Finally if JAFS is still running restart it or go to the admin console, click on the desired server link and click the stop button.
You can also use the administration console ServersDeploymentService deleteServer method.
Settings to change.
The following basic settings should be changed in the server configuration.
- port : This is the server listening port.
- loginMessage, disclamerMessage, logoutMessage, closedMessage : The message when a client logs in, is identified, logs out or the message received when the server is closed.
-
port : Ports settings for data transferts, you can enable or disable passive mode here.
Make sure that the PASV port allocation range is also big enough if
your server handles a lot of clients consider a ratio of 1 port for 5 clients.
WarningIf the PASV port range is too big, some problems can occurs with UPNP devices when UPNP is enabled. If you detect problems such as ports that are not mapped correctly, or that are always remapped by JAFS ( service logs entries contains such information ), try to lower this PASV ports allocation range.WarningThe allowFXP setting, when enabled, can allow FTP bounce attacks. Make sure that you enable this setting only if you REALLY NEED to have transferts between FTP servers. -
root : This is the server root directory that will be exposed to the clients. The cacheDirs setting let you cache directories
for a faster use of the SEARCHPATH command.
WarningThe cache does not detect circular symbolic links under unix systems. Please make sure to disable this feature if you have such symbolic links.
- timeOut : This is the timeout value for a unidentified client.
- maximumSessionsNumber : The maximum number of sessions on the server
- reverseLookup : This will lookup the name of clients and use it instead of the client IP in some parts of the application, disable this feature if you handle a lot of clients.
- authRealm name : Indicates which JAAS authentication relam will be used by the server, more info here.
Here is a small example of the settings in the configuration file that we have described above :
<server xmlns="http://www.sbbi.net/jafs/1.0/jafs-server"
...
code="sample_server"
port="2121"
firewallPort="2323"
networkInterface="default"
controlTOS="LOWDELAY"
dataTOS="THROUGHPUT"
wanAccess="true">
<disclamerMessage>
Some
Disclamer
message
</disclamerMessage>
<loginMessage>Hello client number ${currConn}</loginMessage>
<logoutMessage>Bye bye</logoutMessage>
<closedMessage>The server is closed</closedMessage>
<port pasv="true" allowFXP="false" pasvDownPort="1100"
pasvUpPort="44000" timeout="10" NATOnTheFlyPortsOpen="false"/>
<root>../config</root>
<timeOut value="10"/>
...
<maximumSessionsNumber value="5" perIPAddress="5"/>
...
<reverseLookup value="true"/>
...
<authRealm name="xml"/>
...
</server>
Next step
The next step will let you add/remove users.








