Running Cipango
Cipango may be started and stopped as follows:
- From the #Command Line
- As a #Unix daemon
Command Line
The most straightforward way to start Cipango is to go to your Cipango installation directory and type:
java -jar start.jar --ini=start-cipango.ini
To stop, simply use Ctrl-C in the same terminal. You may also start Cipango so that it listens on a local port for stop commands:
java -DSTOP.PORT=8079 -DSTOP.KEY=secret -jar start.jar --ini=start-cipango.ini
The server can then be stopped using a different terminal window on the same machine:
java -DSTOP.PORT=8079 -DSTOP.KEY=secret -jar start.jar --stop
If you omit the stop port or key, they are displayed on the standard output so that you may know their values.
Unix daemon
To start Cipango under *nix system,
- set in
${jetty.home}/etc/jetty.conf
(The line--ini=start-cipango.ini
--pre=etc/jetty-logging.xml
must be removed) - go to
${jetty.home
} and type:./bin/jetty.sh start
This script allows also the commands stop, run, restart, check and supervise.
shell commands
jetty.sh lookup for
/etc/default/jetty
$HOME/.jettyrc
If it exists, these files are read at the start of script. It may perform any sequence of shell commands, like setting relevant environment variables
# Where Cipango is installed JETTY_HOME=/home/user/cipango JAVA_HOME=/usr/local/jdk1.6.0 # Set max heap sise to 512MB and initial size to 256MB JAVA_OPTIONS=="-Xmx512M -Xms256M -XX:+UseParNewGC -XX:+UseConcMarkSweepGC" # Override the default SIP host SIP_HOST=192.168.1.2 #Override the default SIP port SIP_PORT=5060 #Override the default HTTP port JETTY_PORT=8080 if [ ! -z "$SIP_PORT" ] then JAVA_OPTIONS="${JAVA_OPTIONS} -Dsip.port=${SIP_PORT}" fi if [ ! -z "$SIP_HOST" ] then JAVA_OPTIONS="${JAVA_OPTIONS} -Dsip.host=${SIP_HOST}" fi
Environnement properties
Property |
Description |
---|---|
JETTY_HOME |
Where Cipango is installed. If not set, the script will try go guess it by first looking at the invocation path for the script, and then by looking in standard locations as
|
JAVA_HOME |
Home of your Java installation |
JAVA |
Command to invoke Java. If not set, |
JAVA_OPTIONS |
Extra options to pass to the JVM |
JETTY_CONSOLE |
Where Jetty console output should go. Defaults to first writeable of
|
JETTY_PORT |
Override the default HTTP port for Cipango servers. If not set then the default value in the xml configuration file will be used. The java system property "jetty.port" will be set to this value for use in |
JETTY_RUN |
Where the jetty.pid file should be stored. It defaults to the first available of |
JETTY_PID |
The jetty PID file, defaults to |
JETTY_ARGS |
The default arguments to pass to Jetty. |
jetty.conf
It also search for jetty.conf
in
/etc/jetty.conf
${jetty.home}/etc/jetty.conf
This file will be used as this script's configuration.
Each line in the file may contain:
- A comment denoted by the pound (#) sign as first non-blank character.
- The path to a regular file, which will be passed to Cipango as a config.xml file.
- The path to a directory. Each *.xml file in the directory will be passed to Cipango as a config.xml file.
If more than one argument is passed to the script (jetty.sh start etc/cipango.xml
), jetty.conf is not read
Absolute path must be used if Cipango is not started from ${jetty.home}/bin