Setting up NexJ Server
Set up a NexJ Server environment on a server where you plan to install NexJ Customer Relationship Management.
NexJ Server supports the following configurations:
- A standalone server instance
- A server cluster
To set up a NexJ Server instance or cluster, you create a directory in which to install the servers and then install the servers in that directory. For more information, see Installing NexJ Server.
Info
NexJ Server is compatible with previous releases of the NexJ application.
The instructions in this section refer to the following locations and variables:
NEXJ_PLUGIN
The location where the NexJ Studio plugin is installed, for example, c:\nexj_studio\12.0\pluginscom.nexjsystems.nexjstudio_<version>
.
SERVER_HOME
The root directory of the NexJ Server instance, for example, \\<projectdir>\<sams>
.
In a clustered environment, <SERVER_HOME>
refers to the directory where you are installing and configuring the first node for your deployment, SERVER_HOME2 refers to the directory where you are installing and configuring the second node, and so on.
The <SERVER_HOME>
directory should be readable and writable only to the deployment administrator, as it contains sensitive information, including the deployed code and authentication information.
JAVA_HOME
The location where the Java JDK is installed.
platform
The name of the directory that contains the files for your version of Windows. For example, win32-x86
.
Info
Before deploying your application, you must configure the application server to use standards-compliant TCP stacks. See Configuring TCP on application servers.
Configuring TCP on application servers
You need to set Linux kernel parameters or Windows registry keys to correctly configure TCP on the application server.
This allows the application server to recover more efficiently when TCP connections are dropped by the server.
To configure TCP on an application server:
- Change the kernel parameter values or registry keys, based on operating-system-specific files provided with the NexJ Studio plugin.
- On Linux, do one of the following:
- If the
/etc/sysctl.conf
file exists, edit the file to match the values in the <NEXJ_PLUGIN>/core/etc/config/os/tcp-linux.conf
file. - Otherwise, copy the <
NEXJ_PLUGIN>/core/etc/config/os/tcp-linux.conf
file to the/etc/sysctl.d
directory. Ensure that none of the other.conf
files in that directory specify the parameters listed in thetcp-linux.conf
file.
- If the
- On Windows, double-click the <
NEXJ_PLUGIN>\core\etc\config\os\tcp-<os>.reg
file, where<os>
is one of:xp
,server2003
, orserver2008-Vista-7
. Accept the confirmation messages to update registry settings.
- On Linux, do one of the following:
- Restart the computer.
The TCP stack standard-compliance on the application server is now correctly configured.
You can now continue deploying the application server.
Installing NexJ Server
You can install NexJ Server as an instance or as a server cluster.
Before you begin installing NexJ Server, ensure that Java JDK is installed on your machine and that the Java JDK installation directory is set as the system environment variable <JAVA_HOME>
.
You must also acquire the correct JDBC driver for your database. Contact your NexJ representative or see the Release Notes document for your version of NexJ CRM for more information.
If you are installing NexJ Server on Linux:
- You must install the Arial font, which is required by predefined reports. You must install the
Arial.ttf
font file for each JVM on the application server machine and then restart each JVM. For example, copy the font to the following location:<JAVA_HOME>/jre/lib/fonts
Alternatively, install the font system-wide. Consult your Linux documentation for the appropriate install location. - You must trust all hosts. To trust all hosts, run the following Apache Ant command from a command-line window:
installer.cmd.jsch.knownHostsFile=<trust-all>
In Linux Bash shell, the command results in the following:
$ANT_HOME/bin/ant \ -f $NEXJ_PLUGIN/build/build.xml \ -Dplugin.dir=$NEXJ_PLUGIN \ -Dpublish.dir=$MIXINS \ -Dbase.jar=$JAR_FILE \ -Dproject=".tmp" \ -Dout.dir=$OUT_DIR \ -Dserver.properties=$PROP_FILE \ -Dbuild.jnlp=false \ -Dcipher.master.url=$MASTER_PWD \ -Declipse.dir=$ECLIPSE_DIR \ -Dinstaller.cmd.jsch.knownHostsFile=\<trust-all\> \ server.config server.deploy | tee $SCRIPT_DIR/../log/deploy.log
To install NexJ Server as a standalone instance or as a server cluster:
- In NexJ Studio, on the Deployment layer, in the Environment tab, open the environment file for the current deployment.
- In the Overview tab, ensure that Type is set to
Generic
. - In the Deployment Location field, specify the folder directories for all the server nodes. For example, to install two NexJ Server nodes, specify
\\<projectdir1>\<sams>,\\<projectdir2>\<sams>,
or\\{<projectdir1>,<projectdir2>}\<sams>.
- If you are installing a NexJ Server cluster, in the Clustering/Session subtab, select the Distributed (Enable Clustering) checkbox.
- Save the updated environment file and click the Deploy Model button .
The NexJ Server instance or cluster is installed in the directories that you specified. - Copy the appropriate JDBC driver, such as
jtds-1.2.2-7.jar
orojdbc6.jar
, to the <SERVER_HOME>\jvm
directory for each deploy location that you specified earlier in the Deployment Location field.
The NexJ Server instance or cluster is installed.
Related links
Configuring the cluster discovery protocol
Installing NexJ Server remotely using ssh
You can install NexJ Server as a single instance or as a server cluster remotely using ssh.
Before you begin installing NexJ Server, ensure that Java JDK is installed on your machine and that the Java JDK installation directory is set as the system environment variable JAVA_HOME.
You must also acquire the correct JDBC driver for your database. Contact your NexJ representative or see the Release Notes document for your version of NexJ CRM for more information.
To install NexJ Server as a standalone instance or as a server cluster remotely using ssh:
- In NexJ Studio, on the Deployment layer, in the Environment tab, open the environment file for the current deployment.
- In the Overview tab, ensure that Type is set to
Generic
. - In the Deployment Location field, specify the ssh folder directories for all the server nodes. For example, to install two NexJ Server nodes, specify
ssh://<hostname>/<projectdir1>/
sams,ssh://<hostname>/<projectdir2>/<sams>
orssh://{<hostname>/<projectdir1>,<hostname>/<projectdir2>}/<sams>
. - If you are installing a NexJ Server cluster, in the Clustering/Session subtab, select the Distributed (EnableClustering) checkbox.
- Save the updated environment file.
- Click Window → Preferences.
The Preferences dialog opens. - Click NexJ Studio → Remote Deployment → SSH.
- In the Known hosts file field, enter the path to the known hosts file.
The known hosts file allows NexJ Studio to authenticate the server. - In the Personal key field, do one of the following:
- If basic authentication is enabled in the environment file, select the Use password from the .server file (basic authentication) checkbox.
- If basic authentication is not enabled in the environment file, in the Identity file field, enter the path to the private key for the client.
- Click OK.
The Preferences dialog closes. - Click the Deploy Model button .
The NexJ Server instance or cluster is installed in the directories that you specified. - Using a tool such as sftp or scp, copy the appropriate JDBC driver, such as
jtds-1.2.2-7.jar
orojdbc6.ja
r, to the <SERVER_HOME>\jvm
directory for each deploy location that you specified earlier in the Deployment Location field.
The NexJ Server instance or cluster is installed remotely on the specified servers.
Related links
Configuring the cluster discovery protocol
Setting up password encryption on NexJ Server
If required, you can set up password encryption on NexJ Server. Use the Cipher Tool in NexJ Studio to generate the password file, copy it to the NexJ Server machine, and then enable encryption on the server.
Before you can set up password encryption, use the NexJ Studio Cipher Tool to generate the master password file master.pwd
. If you do not have access to NexJ Studio, someone else might need to generate the file for you.
To set up password encryption on NexJ Server:
- Get the master password file
master.pwd
, which was generated using the NexJ Studio Cipher Tool. - Set file permissions to make the
master.pwd
file readable only to the server process user (that is, the login account specified in the application server service) and the deployment administrator. - Open the
modeld.conf
file, which is located in theconf
directory in the NexJ Server deployment location.
Add the following line to the file:cipher.master.url=<location of master.pwd>
- Save and close the file.
Password encryption is now enabled for your NexJ Server.
Restart NexJ Server for the changes to take effect.
Starting NexJ Server on Windows
You can start NexJ Server using a batch file. Starting NexJ Server runs NexJ applications that are deployed on the server.
To start NexJ Server:
Open a Command Prompt window using the Run As Administrator option.
Run the following command from the <SERVER_HOME>/bin
directory:modeld.bat -i [-dm] [-X] [-D] [<NexJ Server options>]
Note
NexJ Server options require a space between the option and option value. JVM options do not require a space. Additionaly, values that contain a space must be enclosed in quotation marks.
Where the following options are supported:
-d <number>
Enables remote debugging on the specified port number, for example,-d 7777
.
-m <number>
Sets the heap size, for example,-m 1024M
or-m 1G
.
-X<argument>
Specifies additional JVM options that can be passed to the JVM to overwrite batch file defaults. For example, use-Xss4096k
to change the default thread stack size.
-D<property>
Specifies properties to pass through to the application. For example, use-Dnexj.ajp.port=8509
to set the AJP Port to 8509. The start command accepts the following NexJ Server options:
-c <url>
Path to the node configuration file, for example,-c <SERVER_HOME>\modeld.conf
.
-n <name>
Node name, for example,–n node1
.
-o <number>
Port offset number, for example,–o 100
.
-l <dir>
Path to the log file directory, for example,–l <SERVER_HOME>\log
.
-C <url>
Path to the environment file, for example,-C <SERVER_HOME>\workspace\env\envFile.environment
.
-P <url>
Path to the environment properties file, for example,-P <SERVER_HOME>\workspace\propertiesFile.properties
. If you want to issue the-P
command, ensure that an environment file exists and has been specified using the-C
command.
-M <url>
Path to the metadata directory, for example,-M <SERVER_HOME>\workspace\meta
.Info
You can also use the following command to view NexJ Server options:
modeld.bat -?
You have started NexJ Server.
To shut down the server, press CTRL + C in the command line.
Starting NexJ Server on Linux
You can start NexJ Server using a shell file. Starting NexJ Server runs NexJ applications that are deployed on the server.
To start NexJ Server on Linux:
Open a terminal and run the modeld.sh
from the <SERVER_HOME>\bin
directory.
The modeld.sh
file accepts the following options: modeld.sh -i [-dm] [-X] [-D] [<NexJ Server options>]
.
Info
NexJ Server options require a space between the option and option value. JVM options do not require a space. Additionaly, values that contain a space must be enclosed in quotation marks
Where the following options are supported:
-d number
Enables remote debugging on the specified port number, for example, -d 7777
.
-m number
Sets the heap size, for example, -m 1024M or -m 1G.
-Xargument
Specifies additional JVM options that can be passed to the JVM to overwrite batch file defaults. For example, use -Xss4096k
to change the default thread stack size.
-Dproperty
Specifies properties to pass through to the application. For example, use -Dnexj.ajp.port=8509
to set the AJP Port to 8509.
The start command accepts the following NexJ Server options.
-c url
Path to the node configuration file, for example, -c <SERVER_HOME>/modeld.conf
.
-n name
Node name, for example, –n node1
.
-o number
Port offset number, for example, –o 100
.
-l dir
Path to the log file directory, for example, –l <SERVER_HOME>/log
.
-C url
Path to the environment file, for example, -C <SERVER_HOME>/workspace/env/envFile.environment
.
-P url
Path to the environment properties file, for example, -P <SERVER_HOME>/workspace/propertiesFile.properties
. If you want to issue the -P
command, ensure that an environment file exists and has been specified using the -C
command.
-M url
Path to the metadata directory, for example, -M <SERVER_HOME>/workspace/meta
.
Info
You can also use the following command to view NexJ Server options:./modeld.sh -?
You have started NexJ Server.
To shut down the server, press CTRL + C in the command line.
Registering NexJ Server as a service on Windows
You can register NexJ Server as a Windows service.
To register NexJ Server as a Windows Service:
- Open a Command Prompt window using the Run As Administrator option.
Run the following command from the <
SERVER_HOME>/bin directory
:modeld-svc.bat [-dsm] [-X] [-D] [<NexJ Server options>]
.Info
NexJ Server options require a space between the option and option value. JVM options do not require a space. Additionaly, values that contain a space must be enclosed in quotation marks.
Where the following options are supported:
-d <number>
Enables remote debugging on the specified port number, for example,-d 7777
.
-s <name>
Specifies the name of the service, for example,–s "NexJ Server".
If this parameter is not specified, the service is named modeld.
-m <number>
Sets the heap size, for example,-m 1024M
or-m 1G
.
-X<argument>
Specifies additional JVM options that can be passed to the JVM to overwrite batch file defaults. For example, use-Xss4096k
to change the default thread stack size.
-D<property>
Specifies properties to pass through to the application. For example, use-Dnexj.ajp.port=8509
to set the AJP Port to 8509.
The command accepts the following NexJ Server options.
-c <url>
Path to the node configuration file, for example,-c <SERVER_HOME>\modeld.conf
.
-n <name>
Node name, for example,–n node1
.
-o <number>
Port offset number, for example,–o 100
.
-l <dir>
Path to the log file directory, for example,–l <SERVER_HOME>\log
.
-C <url>
Path to the environment file, for example,-C <SERVER_HOME>\workspace\env\envFile.environment
.
-P <url>
Path to the environment properties file, for example,-P <SERVER_HOME\>workspace\propertiesFile.properties
. If you want to issue the-P
command, ensure that an environment file exists and has been specified using the-C
command.
-M <url>
Path to the metadata directory, for example,-M <SERVER_HOME>\workspace\meta
.
Info
You can also use the following command to view NexJ Server options:modeld.bat -?
You have registered NexJ Server as a Windows service.
You can start the Services Microsoft Management Console (MMC) to verify that NexJ Server is registered as a service.
Registering NexJ Server as a service on Linux
You can register NexJ Server as a service on Linux.
You register NexJ Server by specifying the server location in the modeld.service configuration file, copying the configuration file to the appropriate location, and running a command to register the server as a service.
To register NexJ Server as a service:
- Navigate to <
SERVER_HOME>/bin
. - Open the
modeld.service
file in a text editor. - Modify the
Environment=MODELD_HOME
variable to point to <SERVER_HOME>
directory. For example, change the variable toEnvironment=MODELD_HOME=/teee
. - Save and close the
modeld.service
file. - Copy the
modeld.service
file to/etc/systemd/system/
. From the terminal, use the following command to register the server as a service:
systemctl enable modeld
Info
You can use the following command to disable the server as a service:
systemctl disable modeld
Use the following commands to start the service:
systemctl start modeld
Info
You can use the following command to stop the service:
systemctl stop modeld
You have registered NexJ Server as a service.
Configuring environment and node properties for NexJ Server
You can specify certain environment properties and node information for NexJ Server. The changes that you make do not require a redeploy of your NexJ application, however, you must restart the system for changes to take effect.
You specify configuration settings in the modeld.conf
file. By default, the modeld.conf
file is located in the <SERVER_HOME>\conf
directory. The environment properties that you add to the modeld.conf
file override properties
defined in the environment file.
You can update environment file properties using the following format: <attributeName>="<value>"
For example, to update the read audit logging level to access, enter:readAudit="access"
The node property defines the node name for the current application instance. By default, nodes are named node=<node1>, node=<node2> ...node=<nodeN>
for deployments to multiple locations. You can change a node value if you want to give the node a meaningful name. Each application instance requires a unique node name.
Deployment-time configuration for NexJ Server
Tomcat connector properties for NexJ Server, such as web container thread pool size, can be set or modified at deploy time.
You can set the properties in two locations:
- In the environment file for your deployment, using NexJ Studio. If you set the properties in the environment file, you will need to redeploy before the changes take effect.
- In the
modeld.conf
file. The properties in themodeld.conf
file override properties defined in the environment file. If you set the properties in themodeld.conf
file, you will need to restart the server before the changes take effect.
The format for setting the properties depends on where and for which Tomcat connector you want to make the changes.
AJP Connector properties in the environment file
modeld.ajp.<attributeName>="<value>"
AJP Connector properties in the modeld.conf file
modeld.ajp.<attributeName>=<value>
HTTP Connector properties in the environment file
modeld.http.<attributeName>="<value>"
HTTP Connector properties in the modeld.conf file
modeld.http.<attributeName>=<value>
HTTP Connector properties for the push redirector in the environment file
push.http.<attributeName>="<value>"
HTTP Connector properties for the push redirector in the modeld.conf file
push.http.<attributeName>=<value>
For example, to set the maximum number of request processing threads to be created by the AJP Connector, specify modeld.ajp.maxThreads="200"
in the environment file using NexJ Studio. Otherwise, specify modeld.ajp.maxThreads=200
in the modeld.conf
file.