NIH | National Cancer Institute | NCI Wiki  

WIKI MAINTENANCE NOTICE

Please be advised that NCI Wiki will be undergoing maintenance on Thursday, May 23rd between 1200 ET and 1300 ET.
Wiki will remain available, but users may experience screen refreshes or HTTP 502 errors during the maintenance period. If you encounter these errors, wait 1-2 minutes, then refresh your page.

If you have any questions or concerns, please contact the CBIIT Atlassian Management Team.

Error rendering macro 'rw-search'

null

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
    cd <path to install dir>/cts2Docs

Install CTS2 API Documentation project

  1. Clone git repository

    1. git clone https://github.com/cts2/lexevs-service-rest-docs.git
    2. This will create a project under <path to install dir>/usr/local/cts2Docs/lexevs-service-rest-docs
     

...

  1. Download Node.js (linux 64 bit) (v0.10.35) to <path to install dir>/usr/local/cts2Docs
    1. File download location: nodejs.org/dist/v0.10.35/node-v0.10.35-linux-x64.tar.gz
  2. Unzip the file node-v0.10.35-linux-x64.tar.gz in <path to install dir>/usr/local/cts2Docs
    1. tar -vxzf node-v0.10.35-linux-x64.tar.gz
  3. Create symbolic link /usr/local/cts2Docs/node -> /usr/local/cts2Docs/node-v0.10.35-linux-x64
  4. Add an environment variable for NPM
    1. export NPM_HOME=<path to install dir>/usr/local/cts2Docs/node-v0.10.35-linux-x64

    2. export PATH=${PATH}:$NPM_HOME/bin

  5. Update the port that node.js runs on (OPTIONAL step)
    1. Edit this file: <path to install dir>/usr/local/cts2Docs/lexevs-service-rest-docs/config.json
    2. 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
    languagebash
    titlenodejs_init_script
    linenumberstrue
    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

  1. Download Redis version 2.8.19 to <path to install dir>/usr/local/cts2Docs
    1. File download location: https://github.com/antirez/redis/archive/2.8.19.tar.gz
  2. Unzip the file redis-2.8.19.tar.gz in <path to install dir>/usr/local/cts2Docs
    1. tar -vxzf redis-2.8.19.tar.gz
  3. Build redis
    1. cd <path to install dir>/usr/local/cts2Docs/redis-2.8.19
    2. make
  4. Create symbolic link /usr/local/cts2Docs/redis -> /usr/local/cts2Docs/redis-2.8.19
  5. Created a copy of  redis.conf called  cts2_redis.conf

    1. Make the following changes in the cts2_redis.conf file

      Code Block
      languagebash
      titlects2_redis.conf
      linenumberstrue
      daemonize yes
      pidfile /usr/local/cts2Docs/redis/redis_6379.pid
      logfile "/usr/local/cts2Docs/logs/redis.log"
  6. Copy the file /usr/local/cts2Docs/redis/utils/redis_init_script to /usr/local/cts2Docs/bin and make the following modifications

    Code Block
    languagebash
    titleredis_init_script
    linenumberstrue
    #!/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

...

  1. Start the redis server
    1. nohup <path to install dir>/cts2Docs/redis-2.8.19/src/redis-server &
    2. By default, redis is running on port 6379
  2. Start the Node.js server
    1. cd <path to install dir>/cts2Docs/lexevs-service-rest-docs
    2. nohup npm start &
    3. 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
    languagebash
    title.bash_profile
    linenumberstrue
    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

...