Instructions for installing LexEVS 6.x CTS2 Documentation API Service.
Clone git repository
export NPM_HOME=/usr/local/cts2Docs/node
export PATH=${PATH}:$NPM_HOME/bin
Created the nodejs start/stop script /usr/local/cts2Docs/bin/nodejs_init_script with the following properties
LEXEVSDOCS_HOME=/usr/local/cts2Docs/lexevs-service-rest-docs LOGDIR=/usr/local/cts2Docs/logs LOGFILE=${LOGDIR}/nodejs.log PIDFILE=${LEXEVSDOCS_HOME}/nodejs.pid |
Create a copy of redis.conf called cts2_redis.conf
Make the following changes in the cts2_redis.conf file
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
#!/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 |
At this point the install directory should have the following structure:
For security purposes, restrict access to the following directories/files:
Create Linux account cts2 and added the following to .bash_profile
export NPM_HOME=/usr/local/cts2Docs/node PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$NPM_HOME/bin:$HOME/bin:$PATH |
DEV Server: ncias-d1224
User account: cts2
Deploy Directory: /usr/local/cts2Docs
CTS2 Home: /local/home/cts2
Service Ports: 3000, 6379
Application URL: http://ncias-d1224:3000/ (DEV server)
Once redis and node.js have been successfully started, the CTS2 Documentation API service can be reached at the following URL:
http://<server_name>:port