The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Site Studio broke after WHM Tomcat Installer

Discussion in 'General Discussion' started by myusername, May 13, 2005.

  1. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    I was hoping dgbaker would help on this one since he seems to be the authority on the subject, but any help is much appreciated.

    The Tomcat installer in WHM did not do the trick, so I found the install script here:

    Code:
    cd /usr/local/cpanel/modules-install/tomcat-Linux-i686
    ./install
    http://forums.cpanel.net/showthread.php?t=37974&highlight=tomcat

    Great! Tomcat is now installed and running on :8080

    However I get the same error others have had but no luck with SS actually restarting:

    Code:
    cd /home/SiteStudio1.6
    ./ss.sh restart
    
    Error: The JAVA_HOME environment variable is not defined correctly
           It must point to directory of Sun JDK/JRE 1.3.x or 1.4.x
           This environment variable is needed to run SiteStudio
    So looking around I see a symlink to both jdk and jre in /usr/local

    I tried to reset the JAVA_HOME environment variable to both /usr/local/jre and /usr/local/jdk but it just spots out the same error every time....

    I am at a loss here. Here is some information that may help:

    Code:
    java -version
    java version "1.5.0_02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
    Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)
    Code:
    echo $JAVA_HOME
    /usr/local/jre
    Thanks in advance ;)
     
    #1 myusername, May 13, 2005
    Last edited: May 13, 2005
  2. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Yep! ran into this before.

    create a symlink for /usr/java to /usr/local/jdk


    cd /usr
    ln -s /usr/local/jdk java


    Now S.S. should start.


    Also something else you may find.

    Edit the ss.sh script and add the following near the top

    unset CLASSPATH

    This ensures no tomcat jar's or such will interfere.
     
  3. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Still no luck, but thanks for the suggestion none the less.

    Any other good ideas?
     
  4. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Same error?
     
  5. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Yes, same thing. I tred about every JAVA_HOME path I could think of.
     
  6. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    paste the ss.sh script, I'll match it to ours.
     
  7. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Thaks dgbaker. I have a sneaking suspision it is in the imaker.sh script, hard to say looking at the pair of them they seem to conflict, sometimes in the same script as to where JAVA_HOME is. so here's both:

    imaker.sh
    Code:
    #!/bin/sh
    #****************************************************************************
    #* <copyright>
    #*  Copyright (c) Positive Software Copyright 1999, 2004
    #* </copyright>
    #****************************************************************************
    
    # port (ImageMaker port) -  port on which ImageMaker must be started.
    # uses port 1922 as default
    port=1922
    # ImageMaker name
    imak=ImageMaker
    # ImageMaker script name
    self=`basename $0`
    # ImageMaker log file
    logf=logs/imaker.log
    # Null device
    null=/dev/null
    # Change to ImageMaker directory
    cd `dirname $0`
    
    die() {
      cd $OLDPWD
      [ -z "$1" ] && exit 0
      echo 'Error: '"$1" && exit 1
    }
    # Start ImageMaker
    start() {
      echo "`date` - STARTED" >>$logf
      $JAVA $JAVA_OPTS psoft.imaker.${imak}Server $port >>$logf 2>&1 &
    }
    # Start ImageMaker Monitoring
    monitor() {
      local sec=
      local int=5
      while true; do
         echo -n "`date` - "; sh $self status
         status && sec=60 || { start; sec=30; }
         sleep $(($int*$sec))
      done
    }
    # Stop Monitor & ImageMaker
    stop() {
      kill -9 `ps axww|grep $self|awk '$5 ~/sh/ && $NF !~/(stop|restart)/{print $1}'` 2>$null
      kill -9 `ps axww|grep $imak|awk '$5 ~/java/{print $1}'` 2>$null
    }
    # Return ImageMaker status: 0 if running and not 0 if not running
    status() {
      ps axww|grep $imak|grep -v grep >$null 2>&1
    }
    
    case "$#" in
    0) cmd="start";;
    1) if [ "$1" = "monitor" ]; then
          sleep 3 && status && rm .$$.pid && monitor
       else
          cmd=$1
       fi
    ;;
    esac
    
    case "$cmd" in
    restart|reload)
       status && sh $self stop; sh $self start
    ;;
    status)
       echo -n "$imak $1: "
       status && echo "[RUNNING]" || echo "[STOPPED]"
    ;;
    start)
       status && die "$imak is already started on port $port"
    
       [ -z "$JAVA_HOME" ] && {
          JAVA_HOME=/usr/local/jdk
          [ -h "$JAVA_HOME" ] || {
             JAVA_HOME=/usr/local/jdk
             [ -h "$JAVA_HOME" ] || {
                JAVA_HOME=`which java 2>$null` && \
                JAVA_HOME=`dirname $(dirname $JAVA_HOME)`
             }
          }
       }
    
       JAVA_OPTS="-Xmx128M"
       JAVA=$JAVA_HOME/bin/java
       JAVA_VERS=`$JAVA -version 2>&1|grep version|awk 'BEGIN {FS="."} {print $2}'`
    
       if [ "$JAVA_VERS" = '4' ]; then
          JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
       elif [ "$JAVA_VERS" = '3' ]; then
          XVFB=/usr/X11R6/bin/Xvfb
          DISPLAY=`ps axw|grep "$XVFB"|grep -v grep|awk '{print $6}'`
          if [ -z "$DISPLAY" ]; then
             [ ! -x $XVFB ] && die "XFree86-Xvfb not found. Please install it."
             ($XVFB ':0' -screen 0 100x100x8 >$null 2>&1 &) && sleep 1
             DISPLAY=`ps axw|grep "$XVFB"|grep -v grep|awk '{print $6}'`
             [ -z "$DISPLAY" ] && die "can not start XFree86-Xvfb."
          fi
          export DISPLAY
       else
          die "The JAVA_HOME environment variable is not defined correctly
           It must point to directory of Sun JDK/JRE 1.3.x or 1.4.x
           This environment variable is needed to run $imak"
       fi
    
       SS_JAR=freemarker.jar
       echo $CLASSPATH | grep $PWD | grep $SS_JAR || {
          [ ! -f $SS_LIB/$SS_JAR ] && SS_LIB=studio/WEB-INF/lib
          [ ! -f $SS_LIB/$SS_JAR ] && SS_LIB=lib
          [ ! -f $SS_LIB/$SS_JAR ] && SS_LIB=.
          [ ! -f $SS_LIB/$SS_JAR ] && die "can not find $imak libraries."
          CLASSPATH=$PWD:`echo $SS_LIB/*.jar|tr ' ' ':'`
       }
    
       JAIHOME=$PWD/$SS_LIB
       LD_LIBRARY_PATH=$JAIHOME
    
       export JAVA JAVA_OPTS CLASSPATH JAIHOME LD_LIBRARY_PATH
    
       echo -n "Starting $imak ... " && start
       if status; then
          sh $self monitor >>$logf 2>&1 &
          touch .$!.pid
          echo "[  OK  ]"
       else
          echo "[FAILED]"; exit 1
       fi
    ;;
    stop)
       echo -n "Stopping $imak ... "
       if stop; then
          echo "`date` - STOPPED" >>$logf
          echo "[  OK  ]"
       else
          echo "[FAILED]"; exit 1
       fi
    ;;
    *)
      echo "USAGE: $self [start|stop|restart|reload|status]"
    esac
    
    die
    ss.sh
    Code:
    #!/bin/sh
    #****************************************************************************
    #* <copyright>
    #*  Copyright (c) Positive Software Copyright 1999, 2004
    #* </copyright>
    #****************************************************************************
    ##added per dgbaker
    unset CLASSPATH
    
    # SiteStudio name
    studio=SiteStudio
    # Null device
    null=/dev/null
    
    cd `dirname $0`
    
    die() {
      cd $OLDPWD
      [ -z "$1" ] && exit 0
      echo 'Error: '"$1" && exit 1
    }
    
    [ -z "$JAVA_HOME" ] && {
       JAVA_HOME=/usr/java/jdk
       [ -h "$JAVA_HOME" ] || {
          JAVA_HOME=/usr/local/jdk
          [ -h "$JAVA_HOME" ] || {
             JAVA_HOME=`which java 2>$null` && \
             JAVA_HOME=`dirname $(dirname $JAVA_HOME)`
          }
       }
    }
    
    JAVA_OPTS="-Xmx128M"
    JAVA=$JAVA_HOME/bin/java
    JAVA_VERS=`$JAVA -version 2>&1|grep version|awk 'BEGIN {FS="."} {print $2}'`
    
    if [ "$JAVA_VERS" = '4' ]; then
       JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
    elif [ "$JAVA_VERS" = '3' ]; then
       XVFB=/usr/X11R6/bin/Xvfb
       DISPLAY=`ps axw|grep "$XVFB"|grep -v grep|awk '{print $6}'`
       if [ -z "$DISPLAY" ]; then
          [ ! -x $XVFB ] && die "XFree86-Xvfb not found. Please install it."
          ($XVFB ':0' -screen 0 100x100x8 >$null 2>&1 &) && sleep 1
          DISPLAY=`ps axw|grep "$XVFB"|grep -v grep|awk '{print $6}'`
          [ -z "$DISPLAY" ] && die "can not start XFree86-Xvfb."
       fi
       export DISPLAY
    else
       die "The JAVA_HOME environment variable is not defined correctly
           It must point to directory of Sun JDK/JRE 1.3.x or 1.4.x
           This environment variable is needed to run $studio"
    fi
    
    SS_JAR=freemarker.jar
    SS_LIB=studio/WEB-INF/lib
    [ ! -f $SS_LIB/$SS_JAR ] && SS_LIB=lib
    [ ! -f $SS_LIB/$SS_JAR ] && SS_LIB=.
    [ ! -f $SS_LIB/$SS_JAR ] && die "cannot find $studio libraries"
    [ ! -d $PWD/jakarta ] && die "Tomcat 4.x not found"
    
    LANG="en_US.ISO-8859-1"
    JAIHOME=$PWD/$SS_LIB
    TOMCAT_HOME=$PWD/jakarta
    LD_LIBRARY_PATH=$JAIHOME
    
    export JAVA_HOME JAVA_OPTS JAIHOME LD_LIBRARY_PATH LANG
    
    # Start or stop SiteStudio and ImageMaker
    execute(){
       local res=0
       local cmd=stop
       local act=Stopping
    
       if [ "$1" = "start" ]; then
         cmd=start
         act=Starting
       fi
       sh imaker.sh $cmd 2>$null; res=$?
       if [ "$cmd" = "stop" ]; then
          status
          res=$?
       fi
    
       echo -n "$act $studio ... "
       if [ $res -eq 0 ]; then
          $TOMCAT_HOME/bin/catalina.sh $cmd >>logs/ss.log 2>&1 &
          for s in 0 1 2 3 4 5 6 7 8 9; do
             if (! status && [ "$cmd" = "stop"  ]) || \
                (  status && [ "$cmd" = "start" ]); then
                res=0; break
             else
                res=1; sleep 1; continue
             fi
          done
       fi
    
       [ $res -eq 0 ] && echo "[  OK  ]" || echo "[FAILED]"
       return $res
    }
    
    # Return SiteStudio status: 0 if running and not 0 if not running
    status() { 
       ps axww|grep java|grep "$TOMCAT_HOME"|grep -v grep >$null 2>&1
    }
    
    case "$1" in
    stop)
       execute "stop";;
    restart)
       execute "stop"
       execute "start";;
    start)
       status && die "$studio is already running"
       execute "start";;
    status)
       sh imaker.sh $1
       echo -n "$studio $1: "
       status && echo "[RUNNING]" || echo "[STOPPED]";;
    license)
       CLASSPATH=$PWD:`echo $SS_LIB/*.jar| tr ' ' ':'`; export CLASSPATH
       $JAVA psoft.masonry.SSLicenseManager psoft_config.masonry;;
    setup)
       if [ -d fonts ]; then
          FONTS=$JAVA_HOME
          [ -d $JAVA_HOME/jre ] && FONTS=$FONTS/jre
          FONTS=$FONTS/lib/fonts
          [ -n "`ls fonts`" ] && \
          for f in `ls fonts/*.*`; do
             [ ! -f "$FONTS/`basename $f`" ] && cp $f $FONTS
          done
       fi
       CLASSPATH=$PWD:`echo $SS_LIB/*.jar| tr ' ' ':'`; export CLASSPATH
       if [ -f setup.sh ]; then
          echo "Configuring $studio ..."
          sh setup.sh
       else
          die "setup script not found"
       fi;;
    *) cat << EOF
    USAGE: ss.sh (start|stop|restart|status|setup|license)
       stop    - stop $studio"
       start   - start $studio in the background
       setup   - configure $studio
       status  - display $studio status
       restart - restart $studio
       license - display license information
    EOF
    esac
    
    die 
     
    #7 myusername, May 13, 2005
    Last edited: May 13, 2005
  8. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Try this. Created a file called test.sh with the following;

    Code:
    #!/bin/sh
    #****************************************************************************
    #* <copyright>
    #*  Copyright (c) Positive Software Copyright 1999, 2004
    #* </copyright>
    #****************************************************************************
    unset CLASSPATH
    # SiteStudio name
    studio=SiteStudio
    # Null device
    null=/dev/null
    
    cd `dirname $0`
    
    die() {
      cd $OLDPWD
      [ -z "$1" ] && exit 0
      echo 'Error: '"$1" && exit 1
    }
    
    [ -z "$JAVA_HOME" ] && {
       JAVA_HOME=/usr/java/jdk
       [ -h "$JAVA_HOME" ] || {
          JAVA_HOME=/usr/local/jdk
          [ -h "$JAVA_HOME" ] || {
             JAVA_HOME=`which java 2>$null` && \
             JAVA_HOME=`dirname $(dirname $JAVA_HOME)`
          }
       }
    }
    
    JAVA_OPTS="-Xmx128M"
    JAVA=$JAVA_HOME/bin/java
    JAVA_VERS=`$JAVA -version 2>&1|grep version|awk 'BEGIN {FS="."} {print $2}'`
    echo $JAVA_HOME 
    chmod 750 test.sh

    run it and it should list /usr/local/jdk on the screen. If not the JAVA_HOME needs adjusting.
     
  9. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Yep, it does:

    root@server [/home/SiteStudio1.6]# ./test.sh
    /usr/local/jdk

    Now are you as mystified as me?
     
  10. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Hmmm......

    Try

    ./imaker.sh restart

    Does it error?

    Also maybe try

    ./ss.sh stop
    ./ss.sh start

    grasp, grasp grasp ---->>>> straw
     
  11. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    LOL.

    Yep tried all those earlier, but for good measure:

    Code:
    root@server [/home/SiteStudio1.6]# ./imaker.sh
    Error: The JAVA_HOME environment variable is not defined correctly
           It must point to directory of Sun JDK/JRE 1.3.x or 1.4.x
           This environment variable is needed to run ImageMaker
    ....same thing on the others.

    *gulp*
     
  12. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    type env and see what JAVA_HOME is set to.
     
  13. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Currently: JAVA_HOME=/usr/local/jdk

    Which is a symlink to jdk1.5.0_02 e.g.

    Code:
    root@server [/usr/local]# ls -lah
    
    drwxr-xr-x   3 tomcat nobody 4.0K May 13 19:49 jakarta/
    lrwxrwxrwx   1 root   root     14 May 13 19:38 java -> /usr/local/jdk/
    lrwxrwxrwx   1 root   root     11 May 13 19:48 jdk -> jdk1.5.0_02/
    drwxr-xr-x   9 root   root   4.0K May 13 22:55 jdk1.5.0_02/
    lrwxrwxrwx   1 root   root     18 May 13 19:49 jre -> /usr/local/jdk/jre/
     
  14. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    In jdk1.5.0_02 is there bin/java ? or is it jre/bin/java

    Sorry if these sound stupid, but distance troubleshooting is always fun.
     
  15. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Not stupid to me! I appreciate the help.

    There is /usr/local/jdk1.5.0_02/jre/bin/java

    There is also /usr/local/jdk1.5.0_02/bin/java

    But I think the issue may be that it does not run with jdk1.5 unless you have it otherwise, I got a reply from psoft that stated this:

    Hrmmmmmm.
     
  16. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Yep, that would do it also.
     
  17. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Heeeeeyooo dgbaker, can you post me you masonry.properties file please? I have the thing all patched (mostly) and it looks like it is going to run but I fried my masonry file along the way and the new setup script seems pretty buggy,

    Mainly I am loooking for the DB stuff at the top.

    Many thanks.
     
Loading...

Share This Page