Configuring the Verj.io
Server
See also: Introduction to the Server, Starting and stopping the Server, Server File System
Verj.io
Changes using Server Administration Application
Installing/Changing
Windows Service
Change Java memory or Java
parameters
Windows changes when started via bat
file
Change Java memory or Java
parameters
Change Java memory or Java
parameters
Change Java memory or Java
parameters
Application
server configuration
Change
the web application name
Add
additional Java jar, class or properties files
Add
Database Connection to Application Server
Add
certificate to the Java trust store
Apache Derby JDBC Configuration
Using external tools to view/modify the
Verj.io database
Most Verj.io related aspects of the server can be configured using the Server Administration Application. This supports configuration of:
A Windows
service can optionally be created as part of the installation, or at any time after
the installation. Each Windows service has a Service Name which must be unique, and a Display Name which does not have to be unique and is the name
displayed in the Windows Services Dialog. The Verj.io
Server service is given a unique Service Name consisting of “VerjioServer” plus a timestamp, and is given a Display Name
which can be entered during the installation (the default display name is VerjioServer).
This
service can then be started and stopped using the Windows Services dialog.
The Windows
service can additionally be managed using scripts in installation_directory/Server/winservice. These scripts can be used to start,
stop, install, update or remove a service. These scripts all execute the verjio_service
utility script, enter “verjio_service
help” for full syntax. These scripts should all be run as administrator.
The verjio_service script obtains the default service name from
the xxx.server.inst file (VERJIO_SERVICE_NAME
variable) which is in the parent directory of the installation file system.
Warning: The verjio_service
utility has an edit option that
allows you to change the service parameters using the Tomcat service properties
dialog. However any changes made in this way will be lost when the Verj.io system is upgraded. Therefore it’s better to make
any changes as described below to ensure that the changes are maintained across
an upgrade.
Edit file userdata/winservice/setvars.bat
* Set
Java maximum memory
set JvmMx=2048
* Set
Java initial memory
set JvmMs=1024
* Set
Java –D parameters (multiple parameters are delimited by a semicolon)
set JvmArgs=-Dprop1=test;-Dprop2=test
After changing the setvars.bat file, update then
restart the service to implement the change. Run these scripts as administrator:
update_verjio_service
restart_verjio_service
Edit file VerjioServer.server.inst at the root of the installation and change or set the VERJIO_SERVER_JAVA variable to point to the root of the Java installation
Then update and restart the service to
implement the change. Run these scripts as administrator:
update_verjio_service
restart_verjio_service
Edit file VerjioServer.server.inst at the
root of the installation and change the VERJIO_SERVER_USERDATA variable
Then update and restart the service to
implement the change. Run these scripts as administrator:
update_verjio_service
restart_verjio_service
Alternatively, it is possible to change the userdata directory by setting environment variable
VERJIO_SERVER_USERDATA, then update and restart the service to implement the
change. Run these scripts as administrator:
update_verjio_service
restart_verjio_service
.
This
section describes how to make server changes when the server is started using
the start_verjio_server.bat
file in installation_directory/Server.
Edit file userdata/tomcat/bin/setenv.bat
* -Xmx :
Java maximum memory
* -Xms :
Java initial memory
* -Dxx : Java
–D parameters (multiple parameters are delimited by a space)
set CATALINA_OPTS=%CATALINA_OPTS% -Xmx2048m
-Xms512m -Dprop1=test -Dprop2=test
Restart the server:
cd installation_directory/Server
stop_verjio_server.bat
start_verjio_server.bat
Edit file VerjioServer.server.inst at the
root of the installation and change or set the VERJIO_SERVER_JAVA variable to
point to the root of the Java installation
Restart the server:
cd installation_directory/Server
stop_verjio_server.bat
start_verjio_server.bat
Edit file VerjioServer.server.inst at the root of the installation and change the VERJIO_SERVER_USERDATA variable
Restart the server:
cd installation_directory/Server
stop_verjio_server.bat
start_verjio_server.bat
Alternatively, it is possible to change the userdata directory by setting environment variable VERJIO_SERVER_USERDATA,
then restarting the server:
Edit file userdata/tomcat/bin/setenv.sh
* -Xmx :
Java maximum memory
* -Xms :
Java initial memory
* -Dxx :
Java –D parameters (multiple parameters are delimited by a space)
set CATALINA_OPTS=%CATALINA_OPTS% -Xmx2048m
-Xms512m -Dprop1=test -Dprop2=test
Restart the server:
cd installation_directory/Server
verjio_server.sh
restart
Edit file VerjioServer.server.inst at the
root of the installation and change or set the VERJIO_SERVER_JAVA variable to
point to the root of the Java installation
Restart the server:
cd installation_directory/Server
verjio_server.sh
restart
Edit file VerjioServer.server.inst at the root of the installation and change the VERJIO_SERVER_USERDATA variable
Restart the server:
cd installation_directory/Server
verjio_server.sh
restart
Alternatively, it is possible to change the userdata directory by setting environment variable
VERJIO_SERVER_USERDATA, then restarting the server:
This
section applies to use of the Embedded Server (Studio only)
In the Studio, select: File > Preferences > Test Server
-Xmx : sets Java maximum memory
-Xms : sets Java initial memory
-Dxx : sets Java –D parameters
This is not supported as an option for just the
embedded server. The Java used by the studio, including the embedded test
server, can be changed – see Configuring the
Studio.
This is not supported as an option for just the
embedded server. The userdata directory used by the
studio, including the embedded test server, can be changed – see Configuring the Studio.
This section contains information on some of the commonly performed configuration tasks for the Verj.io Server using Tomcat. In some cases, it may be helpful to refer to the Tomcat documentation for full details. For other application servers, refer to the application server documentation.
For external servers, the default web application name is ebase. This can be changed to newname as follows:
1. Stop the server
2. Rename ebase.xml to newname.xml in userdata/tomcat/conf/Catalina/localhost
3. Rename the ebase folder to newname in <userdata>/apps
4. Check the workspace location in userdata/apps/newname/ebaseConf/workspace.properties. This may need to be changed.
5. Restart the server
For the embedded test server used by the studio, the default web application name is ebasetest. This can be changed as follows:
1. Shut down the studio
2. Edit file <user home>/Verjio/Studio/properties/designer.properties
3. Change parameter testServerWebAppName
4. Restart the studio
(Note that web resource files can also be added to the workspace and do not need to be added to the application server)
· The root of the web application for an external server is userdata/apps/<appname>/webapp.
· The root of the web application for the embedded server used by the studio is userdata/app/webapp
· Web resources and folders should be added to these locations.
For external servers:
· Copy jar or zip files to userdata/apps/<appname>/webapp/WEB-INF/lib
· Copy individual class or properties files to userdata/apps/<appname>/webapp/WEB-INF/classes
For the embedded server used by the studio:
· Copy jar or zip files to userdata/app/webapp/WEB-INF/lib
· Copy individual class or properties files to userdata/app/webapp/webapp/WEB-INF/classes
· Copy files to userdata/tomcat/lib
(Note that it’s easier to add a pooled Database Connection using the Server Admin App)
· Edit the web application context file userdata/tomcat/conf/Catalina/localhost/<webappname>.xml or userdata/tomcat/conf/<webappname>.xml for the embedded server (the default web app name for external servers is ebase, for the embedded server is ebasetest )
· Add the new Database Connection
· Restart the server
· Add a Database Connection using the Server Admin App “configured as application server”
This defaults to 3030 for external servers and 3050 for the embedded server used by the studio.
· For external servers this can be changed by editing file userdata/tomcat/conf/server.xml, locating the appropriate <connector> tag and changing the port attribute:
· For the embedded server, change the port in Studio Preferences: File > Preferences > Test Server, click on Use port, then specify the port number.
A number of standard error pages are provided for situations such as session timeouts, application error, signon error etc. Click here for details of how these can be customized.
The Java trust store is where you
configure trusted certificates for communicating to external servers e.g. when
calling REST or SOAP web services where the service’s certificate is not signed
by a recognised certification authority. The Java trust store file path is userdata/security/truststore;
this location is pre-configured into the Verj.io Server
and does not require the specification of any Java parameters.
The following command uses the keytool utility program to add the certificate; it will also create the trust store file if it doesn’t already exist.
<path-to-java>/bin/keytool -import -file <certfile>
-alias <alias-name> -keystore <truststore location>
Where alias name needs to be unique for each certificate, but can be any name of your choice. This name does not affect the functioning of the certificate, but is required to subsequently remove the certificate.
Then answer any prompts from the keystore utility.
e.g.
cd to installation/jre/bin
keytool -import -file C:\cacerts\firstCA.cert -alias firstCA -keystore userdata/security/truststore
See the Java keytool standard documentation for more information.
The application server’s home directory (or working directory) is installation_directory/tomcat/bin and this can’t be changed. Note that this directory is within the installation file system and therefore may be overwritten by a subsequent Verj.io upgrade. For this reason, application files should not be saved or loaded using relative directories e.g. “../loc” etc. Best practice is to locate any such files in the userdata file system which can be accessed using the Javascript services.file.getUserDataApplicationPath() method.
For external servers:
· The Verj.io log file is in userdata/apps/<appname>/logs
· Tomcat log files are in userdata/tomcat/logs
For the embedded server used by the studio. System.out (which includes most of the server logging) can also be displayed using the Manage Server icon in the top right-hand corner of the studio, then selecting Show Server Log:
· The Verj.io log file is in userdata/app/logs
· Tomcat log files are in userdata/tomcat/logs
The Verj.io Server is shipped with
Apache Derby database. This database is an embedded database and starts up when
the server is started. It is a fully relational database implemented in 100%
Java. For more information about derby see http://db.apache.org/derby/
Apache Derby is the default database when running Verj.io out of the box. There is no additional
configuration required when starting Verj.io for the
first time.
The JDBC Connection URL should be configured as follows:
jdbc:derby:UFS;create=false
The UFS part of the JDBC URL can be changed to an absolute
location of a database e.g
jdbc:derby:c:/mydatabase/UFS;create=false
To create the database if it does not exist (useful for
creating your own database separate from Verj.io)
substitute the create=false with
create=true
There are several client tools that you can use to
view/modify the Verj.io data or configure a new
database.
Note: you cannot connect to the database while the Verj.io
Server is running as only one client can attach to the database at any one time
in embedded mode.