CmapServer FAQs

How do I increase the amount of memory allocated to a CmapServer

If the CmapServer is giving problems because of the amount of memory allocated, possibly because the number of folders or resources stored is in the tens or hundreds of thousands, you may need to increase the amount of memory allocated to run it.

The CmapServer is written in Java. The Java Virtual Machine (VM) is assigned a specific amount of memory when launched, and is limited by that amount. On the other hand, the VM consumes memory until it uses all the memory allocated to it, so you need to be careful not to allocate too much memory, particularly if your computer does not have a lot of memory.

By default, IHMC CmapServer is assigned 512 MB for the minimum heap size and 1024 MB for the maximum heap size of memory. This has been found to be adequate for most users. (For reference, the large Public CmapServers at IHMC run with a maximum heap size of 3072 MB. The smaller CmapServers at IHMC run with a maximum of 1024 MB).

Under Windows and Linux (see below for Mac OS X):
  1. To increase the amount of memory allocated, you need to modify a file called "CmapServer.lax" which is found in a directory (folder) called "bin", under the directory (folder) where the CmapServer program was installed. By default, this file is located in the directory (folder):

    C:\Program Files\IHMC CmapServer\bin (Windows)

    /home/<user_name>/IHMC_CmapServer (Linux)

  2. Inside the file, using a text editor (e.g. NotePad, vi), find the line that indicates, in bytes, the amount of memory that will be used by the CmapServer. It should look something like (the number at the end may be different):

    lax.nl.java.option.java.heap.size.max =1073741824
    (where the number at the end indicates the number of bytes)

  3. To increase the amount of memory, for example to 2048 MB , you need to change the line to:

    lax.nl.java.option.java.heap.size.max =2122317824
    (where 2,122,317,824 bytes = 2048 * 1024 * 1024 = 2048 MB)

  4. For this change to take effect, save the file and start the CmapServer again.

Under Mac OS X:
  1. Locate the folder where the CmapServer application is installed. Open the "bin" folder.

  2. Right-click on the "CmapServer.app" file and select "Show Package Contents".

  3. Open the "Contents" folder.

  4. With a text editor, edit the "Info.plist" file.

    Look for the entries:
    <string>-Xms256M</string>
    <string>-Xmx512M</string>

    These are the minimum and maximum sizes. Change and 256M and 512M for whatever value you need, particularly the maximum size.

  5. For this change to take effect, save the file and start the CmapServer again.

How to move a CmapServer to another location

A CmapServer is identified within the CmapTools network by its "serverid", its unique identifier. This identifier is defined in the "serverconfig.txt" file, located in the "bin" directory, which is under the directory where the CmapServer is installed. It is therefore key that this "serverid", and in general that this "serverconfig.txt" file be kept.

The following steps show how to copy a CmapServer to another directory within the same computer or to another computer.

  1. Shutdown the CmapServer
  2. Copy the folder: “serverRootFolder” to the new location. The "serverRootFolder" contains the folder structure of Cmaps and resources. You can copy it to a different directory on the same computer, or to another directory in another computer (if you use the slash ("/") as the file separator you can copy across platforms):

    COPY  “…/<current CmapServer installation directory>/serverRootFolder”
    TO  “…/<destination CmapServer installation directory>/serverRootFolder”

  3. Copy the CmapServer configuration file: “serverconfig.txt” to the new location with the same directory structure. The file is located in the "bin" directory.

    If you use the slash ("/") as the file separator you can copy across platforms:

    COPY  “…/<current CmapServer installation directory>/bin/serverconfig.txt”
    TO  “…/<destination CmapServer installation directory>/bin/serverconfig.txt”

  4. Install the latest version available of the CmapServer into the <destination CmapServer installation directory>. Upon installation, the CmapServer installer will recognize that you have a previous CmapServer configuration file and use these values as default in the new installation. The contents of your serverRootFolder will be preserved.

    Important ! If you move the CmapServer to another computer, its best if you maintain the Host Name, domain name and IP Address of the original computer on the destination computer so that URL links pointing to resources stored in your CmapServer are preserved. This includes the HTML version of Cmaps already stored on your CmapServer.

    If there are blanks next to “server.hostname=” and “server.ip.address=” in the CmapServer Configuration File (serverconfig.txt) on the new location, then fill them in with the Host Name and IP Address that you just assigned to the destination computer in these two locations on the "serverconfig.txt" file (located in the "bin" directory). If your host computer has more than one network card, make sure you give the IP Addres to the "server.bind.address=" parameter.

    ##################################################################################
    # The bind address is the Internet address that the server and the
    # webserver will be listening on for incoming requests. When not specified,
    # the server and the webserver will listen on any/all local addresses
    # (including 127.0.0.1).
    #
    # Unless the server and the webserver need to be configured to run in a
    # multi-homed environment, it is recommended to leave this parameter
    # empty.
    #
    # Example: server.bind.address = 123.123.123.1

    server.bind.address= ################################################################################# # The hostname is the Internet address that will be used to generate the  URLs  of  the  web # pages of the Cmaps stored on the CmapServer, and  it  is  determined  automatically  by  the # server. # # Edit this property if you want the server to use a specific hostname to generate  the  URLs. # It is recommended that you enter a full computer name rather than an IP address. # # Example: server.hostname=mypc.mydomain # server.hostname= # ################################################################################# # The IP address is the Internet address that CmapTools will use to contact the CmapServer and # it is automatically determined and registered by the server. # # Edit this property if you want the server to register a specific IP address. Use only dotted- # decimal TCP/IP addresses. # # Example: server.ip.address=123.123.123.1 # server.ip.address= # ##################################################################################
  5. Run the new CmapServer to verify that the new CmapServer is working as expected.
Preventing a CmapServer from Registering with the DOP

By default, the CmapServer registers its services with the Directoy of Places (DOP). The CmapTools client contacts the DOP to get a list of registered CmapServers. To prevent your CmapServer from automatically registering with the DOP, you need to locate and edit the "slp.conf" configuration file which is found in a directory (folder) called "bin", under the directory (folder) where the CmapServer program was installed. Edit the file and locate the line:

net.slp.registerWithDa=true

Change the entry to read:

net.slp.registerWithDa=false

The CmapServer must be restarted for change to take effect. The entry will be removed from the DOP after it timesout.

Can the CmapServer use an LDAP server for User and Group Permissions

Yes. The CmapTool Desktop client and the CmapServer can use an LDAP server for permissions. For more information on how to configure LDAP with a CmapServer and use LDAP permissions in CmapTools, please visit the LDAP documentation for both CmapTools and the CmapServer:

http://cmap.ihmc.us/docs/permissions-through-LDAP

Can Userids and Passwords in the CmapServer Configuration File be Changed?

Yes, you can change passwords and add additional server admins to the standard and LDAP root folder Administrator lists. You can also change the the SSL keystore password, the PKI keystore password, the current "AdminTool" admin password, and replace the admin account of the existing "AdminTool" admin of the server with a different admin.

Here is the procedure:

  1. Shut down the CmapServer.
  2. Using a text editor, edit the "serverconfig.txt" file, located in the bin directory (folder) found under the directory (folder) where the CmapServer was installed.
  3. Remove the "encrypted_(some random characters)=" (no quotes) value completely from one or more of these parameters as needed:

    ssl.keystore.password=
    pki.keystore.password=
    admin.password=
    root.folder.password=
    ldap.root.folder.password=

  4. Change user ID(s) as needed.
    There is no corresponding User ID to change for the SSL and PKI keystore password parameters.
    Please note that if you replace the "AdminTool" admin user ID listed as the value for the following parameter, the previously listed admin will no longer have admin control over the CmapServer and will effectively be replaced by the new admin upon relaunching the CmapServer:

    admin.account=

    To add a new Administrator for either of the root folder accounts, you'll need to replace the user ID(s) with the new admin's user ID for one or both of these parameters:

    root.folder.account=
    ldap.root.folder.account=

  5. Supply new password(s) for the value(s) of the password parameters listed in step 3 that you wish to change.
  6. Save and exit the file, then launch the CmapServer.

If you added a new root folder admin, they should now be successfully added as an additional root folder Administrator in the permissions list in CmapTools. Additionally if you added a new root folder admin, you will not have to worry whether or not the first admin's account was replaced; the previously-listed admin should still be listed as an Administrator of the server root folder when viewing its permissions list using CmapTools. If you just changed the existing root folder admin's password, that admin must now authenticate in CmapTools using their new password.

All passwords that were replaced will again be encrypted in the "serverconfig.txt" file once the CmapServer has been launched.

How to import a PKCS12 certificate with private key (without the chain)

If you have a .p12 file (PKCS12 certificate) which already includes the private key, certificate, and certificate chain, you can skip to step 3.

Here is the procedure:

  1. If your private key is in .p12 format, convert the private key to PEM format. (If it's already in PEM or DER format, continue to step 2).

    openssl pkcs12 -in <certificate.p12> -out clientcert.pem -nodes –clcerts

  2. Create a new .p12 file which includes the certificate and private key, along with the CA chain (make sure to enter an output password when it prompts you, rather than leaving it blank):

    openssl pkcs12 -export -in <server certificate> -inkey <private key> -out <server.p12> -name <chose-an-alias> -CAfile <CA certificate chaine> -caname root -chain

  3. Import the .p12 file into a Java keystore:

    keytool -importkeystore -deststorepass <output password> -destkeypass <output password>
    -destkeystore <output keystore filename> -srckeystore <.p12 file> -srcstoretype PKCS12
    -srcstorepass <password to open .p12 file> -alias <alias from step 2>

  4. Configure the CmapServer to use the keystore create in step 3.
Will the CmapServer authenticate with Active Directory

Versions of the CmapServer that are v4.11 Beta 2 or higher can successfully authenticate and bind with the Active Directory LDAP server, but only for users at this time. No groups are currently recognized when using CmapTools to browse the list of groups for permissions on a folder stored in a CmapServer that binds with an AD server. When configuring the CmapServer to use an AD LDAP server, the server admin should keep the following in mind:

  1. The "ldap.user.directory.userAttr" should be set to "userPrincipalName" (no quotes).
  2. User IDs, both for the "ldap.root.folder.account" parameter and for searching and adding users to permissions lists of folders in CmapTools, should be in the form: <userID>@<domain name> (e.g. alopez@IHMC).