Skip to main content
Skip table of contents

Initial censhare Server and database configuration

After censhare-Server has been installed successfully, some further steps may be needed in order to run the software properly. Find the basics about what to configure after a fresh installation.


Configuration files

When you are logged in to the Server as user corpus, you can run the following command to get the config files in place:

CODE
mkdir -p ~/cscs/app/config
cd css
for file in app/config/server.xml app/config/launcher.xml
    do cp ~/css/$file ~/cscs/${file/.xml/.$CSS_ID.xml}
done
cd $OLDPWD

Server configuration

The CSS_ID is an ID to identify and address a server. It is available in this file:

CODE
vi cscs/app/config/server.master.xml


The default value for the current instance is master, and, generally, you don't need to change this setting:

  • Server name  

    CODE
    <server-core
            name="master"/>
  • RMI hostname

    The censhare Server always starts up with a specific RMI URL, for example:

    CODE
    RMI binding check ok: rmi://censhare.local:1099/corpus.RMIServer

    This is not only the hostname and port to which the server binds itself. It also tells the client after it connected to connect to this URL. If this is not reachable from the server itself, the startup will fail. Also in case of a remote-server, the remote-server has to be able to connect to the RMI hostname, otherwise the connect will fail for remote servers. For more information, see RMI hostname and port mapping and Default Trust Manager for secure RMI communication.

    If you want to bind the server at startup to a specific RMI hostname, configure it here. Just change the value to your desired hostname and set it to true: 

    CODE
    sysproperty key="java.rmi.server.hostname" value="censhare" enabled="false"

Change the CSS_ID 

You can change the default CSS_ID. Every server instance needs its own CCC_ID. For example, in multi-server environments, you must configure the instances separately.

  • In the censhare-Admin Client, you can define the Server ID via Masterdata > Application Servers. The server ID then displays in configurations drop-down menus, so you can set configurations for each Application Server separately.
  • At OS level, the server ID is stored in /etc/sysconfig/censhare


YML
#!## censhare.tpl
#### cenShare Parameters
 
## Description: corpus user
## Type:        string
## Mandatory:   yes
## Default:     "corpus"
CORPUS="corpus"
 
## Description: censhare ID - needed if not set in ~$CORPUS/.profile
## Type:        string
## Mandatory:   yes
## Default:     ""
CSS_ID="master"


After changing the setting, re-login with the user, for example, corpus, since the file is loaded upon corpus login:

CODE
##censhare-Server start: Do not remove the following section manually
# source CSS_ID from sysconfig
test -f /etc/sysconfig/censhare && source /etc/sysconfig/censhare
# export CSS_ID for environment
export CSS_ID
##censhare-Server end

Security checks to prevent Cross-Site Web Socket Hijacking

To comply with the Cross-Site WebSocket Hijacking protection in the censhare Server, activate the security checks for the Cloud Gateway connection. The property  com.censhare.websocket.allowed.origins  must be updated with the actual host:port value of the current Cloud Gateway installation. For more information, see Configure WebSocket connection

Remote server configuration

For more information, see Remote server setup.

Launcher configuration

Here, you can specify how much memory can be used for the Java Virtual Machine (JVM). The default of 4GB is usually not enough for production systems and should be only used on small developer installations and for testing purposes. 

CODE
vi cscs/app/config/launcher.master.xml

The XML file also has some examples, so you can put the default in comment, and uncomment one of the other settings, for example, change the first commented block with 2556MB JVM size, so it looks like this: 

CODE
<!-- @jvm1.start@ current: machines with 8 or more threads 64Bit Java, RAM greater-equal 4GB -->
...
...
<!-- @jvm1.end@ -->

Comment the last block to disable it: 

CODE
<!-- @jvm.replace.start@ defaults to machines 1-3 CPUs, poor RAM
...
...
@jvm.replace.end@ -->

For more information, see Memory management with G1 Garbage Collector and (2023.1) Monitor censhare with 3rd party tool Nagios.

Services

If you are logged in to the Server as user corpus, you can run the following command to get the config file in place: 

CODE
mkdir -p ~/cscs/app/services/database
cp ~/css/app/services/database/config.xml ~/cscs/app/services/database/

Database Service

If you run an Oracle Database on the same server as you installed censhare-Server and your database service is called  corpus  as well as the user and the password is corpus, you do not need to change anything here. To use this service, first set up your database.

Oracle Database

Find the following scripts to use with your Oracle Installation in order to create the user and database: 

CODE
css/database/create-user.sql
css/database/create-db.sql (only if you use standard edition)
css/database/create-db-enterprise-edition.sql (only if you use enterprise edition)

PostgreSQL

Find the following scripts to use with your PostgreSQL Installation in order to create the user and database: 

CODE
css/database/postgresql-create-user.sql|
css/database/postgresql-create-db.sql

Check database configuration

For more information on database troubleshooting, see Number of database connections - Configuration & troubleshooting and Monitor database performance.

Check the database setup as follows, for example:

CODE
[corpus@censhare-CentOS7 ~]$ CheckJDBC.sh
Starting JDBC check
using oracle JDBC jar file: 'app/common/lib/ojdbc8-18.3.0.0.jar'
using PostgreSQL JDBC jar file: 'app/common/lib/postgresql-42.3.3.jar'
java -Djava.security.egd=file:///dev/urandom -cp bin/censhare-launcher.jar:app/common/lib/*:app/common/lib/ojdbc8-18.3.0.0.jar:app/common/lib/postgresql-42.3.3.jar com.censhare.server.client.CheckJDBC master
Jul 13, 2022 4:59:28 PM com.censhare.server.config.ConfigResolver init
INFO: Using default config dir: /opt/corpus/censhare/censhare-Server/app
Jul 13, 2022 4:59:28 PM com.censhare.server.config.ConfigResolver init
INFO: Using custom config dir : /opt/corpus/censhare/censhare-Custom/censhare-Server/app
Jul 13, 2022 4:59:28 PM com.censhare.server.config.ConfigResolver init
INFO: Using runtime config dir: /opt/corpus/work/runtime.master
Jul 13, 2022 4:59:28 PM com.censhare.server.config.ConfigResolver refresh
INFO: Refreshing last changes
Jul 13, 2022 4:59:29 PM com.censhare.server.config.ConfigResolver scanConfig
INFO: scanned file:///opt/corpus/censhare/censhare-Server/app/ in 130ms
Jul 13, 2022 4:59:29 PM com.censhare.server.config.ConfigResolver scanConfig
INFO: scanned file:///opt/corpus/censhare/censhare-Custom/censhare-Server/app/ in 3ms
Jul 13, 2022 4:59:29 PM com.censhare.server.config.ConfigResolver scanConfig
INFO: scanned file:///opt/corpus/work/runtime.master/ in 23ms
Jul 13, 2022 4:59:29 PM com.censhare.server.config.ConfigResolver refresh
INFO: Refreshing configuration for url: file:services/database/
Jul 13, 2022 4:59:29 PM com.censhare.server.config.ConfigResolver refreshFromDefaultOrCustomScanner
INFO: Found 8 config changes.
Connecting to database with user 'corpus' and url: jdbc:postgresql://10.42.74.174:5432/corpus
Connecting to database with properties: {oracle.jdbc.FreeMemoryOnEnterImplicitCache=true, oracle.jdbc.TcpNoDelay=true, user=corpus}
Connected!
SQL test successful. Found 0 parties.
database.version: 2022.1.0.0000
successfully done.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.