Page History
...
Instructions for installing LexEVS 6.x CTS2 Documentation API Service.
- The installation directory can be anywhere.The name of the install directory will be "cts2Docs".
- The path to the install directory will be referred to as "<path to install dir>"
Create an install directory called <path to install dir>/cts2Docs
Go into the install directory
- be /usr/local/cts2Docs
- Create these additional directories
- /usr/local/cts2Docs/logs
- /usr/local/cts2Docs/bin
Install CTS2 API Documentation project
Clone git repository
- git clone https://github.com/cts2/lexevs-service-rest-docs.git
- This will create a project under <path to install dir>/usr/local/cts2Docs/lexevs-service-rest-docs
...
- Download Node.js (linux 64 bit) (v0.10.35) to <path to install dir>/usr/local/cts2Docs
- File download location: nodejs.org/dist/v0.10.35/node-v0.10.35-linux-x64.tar.gz
- Unzip the file node-v0.10.35-linux-x64.tar.gz in <path to install dir>/usr/local/cts2Docs
- tar -vxzf node-v0.10.35-linux-x64.tar.gz
- Create symbolic link /usr/local/cts2Docs/node -> /usr/local/cts2Docs/node-v0.10.35-linux-x64
- Add an environment variable for NPM
export NPM_HOME=<path to install dir>/usr/local/cts2Docs/node-v0.10.35-linux-x64
export PATH=${PATH}:$NPM_HOME/bin
- Update the port that node.js runs on (OPTIONAL step)
- Edit this file: <path to install dir>/usr/local/cts2Docs/lexevs-service-rest-docs/config.json
- The "port" parameter is set to 3000 by default. It can be changed as needed. This port used by the end URL to get to the CTS2 API Documentation: (http://<server_name>:port)
Create nodejs start/stop script
- Created the nodejs start/stop script /usr/local/cts2Docs/bin/nodejs_init_script with the following properties
Code Block language bash title nodejs_init_script linenumbers true LEXEVSDOCS_HOME=/usr/local/cts2Docs/lexevs-service-rest-docs LOGDIR=/usr/local/cts2Docs/logs LOGFILE=${LOGDIR}/nodejs.log PIDFILE=${LEXEVSDOCS_HOME}/nodejs.pid
Install Redis
- Download Redis version 2.8.19 to <path to install dir>/usr/local/cts2Docs
- File download location: https://github.com/antirez/redis/archive/2.8.19.tar.gz
- Unzip the file redis-2.8.19.tar.gz in <path to install dir>/usr/local/cts2Docs
- tar -vxzf redis-2.8.19.tar.gz
- Build redis
- cd <path to install dir>/usr/local/cts2Docs/redis-2.8.19
- make
- Create symbolic link /usr/local/cts2Docs/redis -> /usr/local/cts2Docs/redis-2.8.19
Created a copy of redis.conf called cts2_redis.conf
Make the following changes in the cts2_redis.conf file
Code Block language bash title cts2_redis.conf linenumbers true daemonize yes pidfile /usr/local/cts2Docs/redis/redis_6379.pid logfile "/usr/local/cts2Docs/logs/redis.log"
Copy the file /usr/local/cts2Docs/redis/utils/redis_init_script to /usr/local/cts2Docs/bin and make the following modifications
Code Block language bash title redis_init_script linenumbers true #!/bin/sh # # start/stop cts2doc-redis # chkconfig: 345 94 90 # description: Redis server # ## Instructions ## ## This is a template only. ## Rename appropriately and copy this file into /etc/init.d ## chkconfig --add FILENAME ########## # # Simple Redis init.d script conceived to work on Linux systems # as it does use of the /proc filesystem. DATE=`date +%Y%m%d-%H%M%S` REDISPORT=6379 REDISDIR=/usr/local/cts2Docs/redis EXEC=${REDISDIR}/src/redis-server CLIEXEC=${REDISDIR}/src/redis-cli LOGDIR=/usr/local/cts2Docs/logs/ #EXEC=/usr/local/bin/redis-server #CLIEXEC=/usr/local/bin/redis-cli PIDFILE=${REDISDIR}/redis_${REDISPORT}.pid CONF="${REDISDIR}/cts2_redis.conf" #PIDFILE=/var/run/redis_${REDISPORT}.pid #CONF="/etc/redis/${REDISPORT}.conf" REDIS_USER=cts2 case "$1" in start) if [ -f $PIDFILE ] then echo "$PIDFILE exists, process is already running or crashed" else if [ -f ${LOGDIR}/redis.log ]; then echo "Renaming redis.log" cd ${LOGDIR}/ mv redis.log redis.log-$DATE fi echo "Starting Redis server..." su - ${REDIS_USER} -c "$EXEC $CONF" fi ;; stop) if [ ! -f $PIDFILE ] then echo "$PIDFILE does not exist, process is not running" else PID=$(cat $PIDFILE) echo "Stopping ..." su - ${REDIS_USER} -c "$CLIEXEC -p $REDISPORT shutdown" while [ -x /proc/${PID} ] do echo "Waiting for Redis to shutdown ..." sleep 1 done echo "Redis stopped" fi ;; *) echo "Usage: $0 { start | stop }" ;; esac
Install Directory File Structure
...
- cts2Docs
- lexevs-service-rest-docs
- bin
- logs
- node-v0.10.35-linux-x64
- node (symbolic link)
- redis-2.8.19
- redis (symbolic link)
Change Directory permissions
...
- Start the redis server
- nohup <path to install dir>/cts2Docs/redis-2.8.19/src/redis-server &
- By default, redis is running on port 6379
- Start the Node.js server
- cd <path to install dir>/cts2Docs/lexevs-service-rest-docs
- nohup npm start &
- node.js is set to run on port 3000 by default.
Create a Linux account cts2
Create Linux account cts2 and added the following to .bash_profile
Code Block language bash title .bash_profile linenumbers true export NPM_HOME=/usr/local/cts2Docs/node PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$NPM_HOME/bin:$HOME/bin:$PATH
Accessing the CTS2 Documentation API Service
...